2.2.base-daemon.shstopthrift2 hbase- daemon.shstopthrift22.3.base-daemon.shstartthrift2 Ning︿ 相互妾弬鏁help 卙四暟钖?/span> 鏄惁樿 四暟科
-h、--助けて min鎸囧畾鍦禁止潃潃甛屼絶嶆敮鎸?span>TNonblockingServer鍜?/span>THsHaServer锛屼袱袱Key呮€絵画槸汮综合椤'?/span>0.0.0.0'?/span>
-p,--port
|
9090 | 缁戝鎸囧畾绔彛岄粯璁やnegative9090 |
-f,--framed | TframedTransport | |
-c,--compact | Huancuan敤TCompactProtocol锛岄粯璁ゆ槸TBinaryProtocol | |
-threadpool | 鏄?/span> | framedTransport TNonblockingServer |
-hsha
|
寓敤瀹絵幇浜?span> framedTransport鄄?/span>THsHaServer | |
//{ //MYLOG_ERROR("thriftException:(% d)%sn",ex.getType(),ex.what()); //} // catch(apache::thrift::transport::TApplicationException&ex) //{ // MYLOG_ERROR("thriftException:%sn",ex.what()); //} //catch(apache ::thrift::TException&ex) //{ //MYLOG_ERROR("thriftException:% sn",ex.what()); //} //Transport鄄ら粯璁ょTframedTransport(TBufferTransports) .h)雃它缮鍙€夋嫨锛?/span> //TBufferedTransport (TBufferTransports.h) //THttpTransport //TZlibTransport //TFDTransport(TSimpleFileTransport) // //プロトコル旄ら粯璁ょ殑apache::thrift::protocol::TBinaryProtocol锛它缮鍙€夋嫨锛?/span> //TCompactProtocol //TJSONProtocol //TDebugProtocol template classProtocol=apache::thrift::protocol::TBin aryProtocol, classTransport =apache::thrift::transport::TframedTransport> classCThriftClientHelper //HBasethrift2C++缂栫▼绀轰緥 #include"&&BaseService.h" //鎴栨寚瀹氱增链暟锛歝reate'test',{NAME=>'cf1',VERSIONS= >2},{NAME=>'cf2',VERSIONS=>3} //鍒犻櫎琛紝鎸夐『搴忔墽琛屼互涓嬩袱鏉Baseshell 鍛造リング保護锛? /span> //「テスト」を無効にする );0倹約 ); { hbase_client.connect();//杩炴帴hbasethrift2server fprintf(stdout,"connect%s:%dokn",h)ベースIP。 c_str(),hbase_port); 叆鍙傛暟璁ストーリー疆 std::vector ボ損傷灉 for(inti=0;i { consthbase::thrift2::TColumnValue&column_column_value_ref=result.i n .what()); } catch(apache::thrift::transport::TTransportException&ex) { //濡傛灉鍜屾湇鍔$ 魶sport鐨凾凾凾屾湇鍔$魅sport鐨凾凾岃繖阅殑閿殑閿殑閿殑閿分鏄€淓AGAIN(タイムアウト)'?/span> fprintf (標準エラー、 "(%d)%sn",ex.getType(),ex.what()); } catch(apache::thrift::TApplicationException&ex) { fprintf(stderr,"%sn") ,ex.what()); fprintf(stderr,"%sn",ex.what()); } return0; }
HBase C++缂栫▼hbase thrift c ++ ..
|