HBaseNet 0.1.0-rc2-final

This is a prerelease version of HBaseNet.
There is a newer version of this package available.
See the version list below for details.
Install-Package HBaseNet -Version 0.1.0-rc2-final
dotnet add package HBaseNet --version 0.1.0-rc2-final
<PackageReference Include="HBaseNet" Version="0.1.0-rc2-final" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HBaseNet --version 0.1.0-rc2-final
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HBaseNet, 0.1.0-rc2-final"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install HBaseNet as a Cake Addin
#addin nuget:?package=HBaseNet&version=0.1.0-rc2-final&prerelease

// Install HBaseNet as a Cake Tool
#tool nuget:?package=HBaseNet&version=0.1.0-rc2-final&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

HBaseNet

This is a pure CSharp client for HBase.

Supported Versions

HBase >= 1.0

Example Usage

Create a client

var ZkQuorum = "zooKeep-host-ip";
var admin = await new AdminClient(ZkQuorum).Build();
if (admin == null) return;
var client = await new StandardClient(ZkQuorum).Build();
if (client == null) return;

Admin operation

var table = "student";
var cols = new[]
{
    new ColumnFamily("info")
    {
        Compression = Compression.GZ,
        KeepDeletedCells = KeepDeletedCells.TRUE
    },
    new ColumnFamily("special")
    {
        Compression = Compression.GZ,
        KeepDeletedCells = KeepDeletedCells.TTL,
        DataBlockEncoding = DataBlockEncoding.PREFIX
    }
};
var create = new CreateTableCall(table, cols)
{
    SplitKeys = new[] { "0", "5" }
};
var listTable = new ListTableNamesCall();
var disable = new DisableTableCall(table);
var delete = new DeleteTableCall(table);

var ct = await admin.CreateTable(create);

var tables = await admin.ListTableNames(listTable);

var dt = await admin.DisableTable(disable);

var del = await admin.DeleteTable(delete);

Generally operation

var table = "student";

// put
var rowKey = "123";
var values = new Dictionary<string, IDictionary<string,byte[]>>
{
    {
        "default", new Dictionary<string, byte[]>
        {
            {"key", "value".ToUtf8Bytes()}
        }
    }
};
var rs = await client.Put(new MutateCall(table, rowKey, values));

// scan
var sc = new ScanCall(table, "1", "")
{
    NumberOfRows = 100000
};
using var scanner = client.Scan(sc);
var scanResults = new List<Result>();
while (scanner.CanContinueNext)
{
    var per = await scanner.Next();
    if (true != per?.Any()) continue;
    scanResults.AddRange(per);
}

// get
var getResult = await client.Get(new GetCall(table, rowKey));

// delete
var delResult = await client.Delete(new MutateCall(table, rowKey, null));

You can also refer to the "Samples/HBaseNet.Console" project.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 327 1/5/2021
0.1.0-rc2-final 224 8/2/2020