HbaseThriftPool by ahyun

<PackageReference Include="HbaseThriftPool" Version="1.1.2.1" />

 HbaseThriftPool 1.1.2.1

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); } } }

<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>HbaseThriftPool</id>
    <version>1.1.2.1</version>
    <title>HbaseThrift 连接池</title>
    <authors>ahyun</authors>
    <owners>ahyun</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>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 &lt;= 10000; i++)
                {
                    try
                    {
                        sw.Restart();
                        string row = System.Guid.NewGuid().ToString();
                        hclient.Client.mutateRow("1".ToBytes(), row.ToBytes(), new List&lt;Mutation&gt; { 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);
                    }
                }
            }</description>
    <copyright>Ahyun.com.cn</copyright>
    <tags>Hbase,Thrift,Pool</tags>
    <dependencies>
      <group targetFramework=".NETFramework4.6">
        <dependency id="HBaseThrift" version="1.0.0" />
        <dependency id="ApacheThrift" version="0.9.3" />
      </group>
    </dependencies>
  </metadata>
</package>