Skip to content

tsuna/gohbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

328d054 · Feb 11, 2025
Feb 11, 2025
Jul 6, 2020
Apr 16, 2020
Jan 29, 2025
Jul 15, 2024
Feb 3, 2025
Aug 27, 2024
Jan 29, 2025
Jun 18, 2024
Dec 23, 2024
Jun 28, 2017
May 4, 2015
Apr 14, 2020
Nov 18, 2021
Nov 19, 2024
Jun 18, 2024
Aug 9, 2015
Dec 31, 2024
Jun 18, 2024
Jun 29, 2017
Feb 11, 2025
Feb 11, 2025
Dec 31, 2024
Jun 4, 2024
Jun 18, 2024
Dec 31, 2024
Jan 29, 2025
Jun 18, 2024
Dec 31, 2024
Dec 31, 2024
Sep 21, 2023

Repository files navigation

Golang HBase client CI codecov.io GoDoc

This is a pure Go client for HBase.

Current status: beta.

Supported Versions

HBase >= 1.0

Installation

go get github.com/tsuna/gohbase

Example Usage

Create a client

client := gohbase.NewClient("localhost")

Insert a cell

// Values maps a ColumnFamily -> Qualifiers -> Values.
values := map[string]map[string][]byte{"cf": map[string][]byte{"a": []byte{0}}}
putRequest, err := hrpc.NewPutStr(context.Background(), "table", "key", values)
rsp, err := client.Put(putRequest)

Get an entire row

getRequest, err := hrpc.NewGetStr(context.Background(), "table", "row")
getRsp, err := client.Get(getRequest)

Get a specific cell

// Perform a get for the cell with key "15", column family "cf" and qualifier "a"
family := map[string][]string{"cf": []string{"a"}}
getRequest, err := hrpc.NewGetStr(context.Background(), "table", "15",
    hrpc.Families(family))
getRsp, err := client.Get(getRequest)

Get a specific cell with a filter

pFilter := filter.NewKeyOnlyFilter(true)
family := map[string][]string{"cf": []string{"a"}}
getRequest, err := hrpc.NewGetStr(context.Background(), "table", "15",
    hrpc.Families(family), hrpc.Filters(pFilter))
getRsp, err := client.Get(getRequest)

Scan with a filter

pFilter := filter.NewPrefixFilter([]byte("7"))
scanRequest, err := hrpc.NewScanStr(context.Background(), "table",
		hrpc.Filters(pFilter))
scanRsp, err := client.Scan(scanRequest)

Contributing

Any help would be appreciated. Please use Github pull requests to send changes for review. Please sign the Contributor License Agreement when you send your first change for review.

License

Copyright © 2015 The GoHBase Authors. All rights reserved. Use of this source code is governed by the Apache License 2.0 that can be found in the COPYING file.