HbaseThrift 连接池 NuGet Package

HbaseThrift 连接池

//初始化连接池
HBaseClientPool.InitHBaseClientPool("192.168.0.242:9090|192.168.0.246:9090|192.168.0.250:9090");
//使用using 释放连接到连接池
using (var hclient = HBaseClientPool.GetHclient())
{
Stopwatch sw = new Stopwatch();

for (int i = 0; i <= 10000; i++)
{
try
{
sw.Restart();
string row = System.Guid.NewGuid().ToString();
hclient.Client.mutateRow("1".ToBytes(), row.ToBytes(), new List<Mutation> { new Mutation { Column = "b:abc".ToBytes(), Value = DateTime.Now.ToBytes() } }, null);
sw.Stop();
Console.WriteLine($"时间:{DateTime.Now} 耗时:{sw.ElapsedMilliseconds} ");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}.




Got any HbaseThrift 连接池 Question?





Info

Version: 1.1.2.1
Author(s): ahyun
Last Update: Friday, July 6, 2018
.NET Fiddle: Create the first Fiddle
NuGet Url: https://www.nuget.org/packages/HbaseThriftPool


Install
Install-Package HbaseThriftPool
dotnet add package HbaseThriftPool
paket add HbaseThriftPool
HbaseThriftPool Download (Unzip the "nupkg" after downloading)



Tags



STATS

must-have-score

avg-downloads-per-day

1

days-since-last-release

2330