0
我已經使用c#的thrift接口從Hbase獲取實時數據。我的問題是,過濾查詢花費太多時間來從hbase的響應。示例代碼如下:如何提高Thrift客戶端掃描器查詢到Hbase的性能
string TableName="testtable";
Dictionary<byte[], byte[]> attributes = new Dictionary<byte[], byte[]>();
TScan scanFilter = new TScan();
scanFilter.FilterString = ToByteArray("((RowFilter(<=,'binary:1053_1371222000')) AND (RowFilter(>=,'binary:1053_1371217740'))) OR (RowFilter(<=,'binary:1055_1371222000')) AND (RowFilter(>=,'binary:1055_1371217740')))");
var scanner = _client.scannerOpenWithScan(ToByteArray(TableName), scanFilter, attributes);
for (var entry = _client.scannerGet(scanner); entry.Count > 0; entry = _client.scannerGet(scanner))
{
foreach (var rowResult in entry)
{
string rowkey = Encoding.UTF8.GetString(rowResult.Row);
Console.Write("{0} => ", rowkey);
}
}
_client.scannerClose(scanner);
我的問題是:
1)有多少,讓我們提升節儉查詢的性能(優化)到HBase的。 2)如何在Hbase上緩存Thrift查詢響應。 3)如何管理主節點上Thrift服務器的負載均衡。