|
|
преди 4 години | |
|---|---|---|
| .. | ||
| filter | преди 4 години | |
| hrpc | преди 4 години | |
| pb | преди 4 години | |
| region | преди 4 години | |
| zk | преди 4 години | |
| .travis.yml | преди 4 години | |
| AUTHORS | преди 4 години | |
| COPYING | преди 4 години | |
| Makefile | преди 4 години | |
| README.md | преди 4 години | |
| admin_client.go | преди 4 години | |
| caches.go | преди 4 години | |
| check_line_len.awk | преди 4 години | |
| client.go | преди 4 години | |
| go.mod | преди 4 години | |
| go.sum | преди 4 години | |
| rpc.go | преди 4 години | |
| scanner.go | преди 4 години | |

This is a pure Go client for HBase.
Current status: beta.
HBase >= 1.0
go get github.com/tsuna/gohbase
client := gohbase.NewClient("localhost")
// 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)
getRequest, err := hrpc.NewGetStr(context.Background(), "table", "row")
getRsp, err := client.Get(getRequest)
// 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)
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)
pFilter := filter.NewPrefixFilter([]byte("7"))
scanRequest, err := hrpc.NewScanStr(context.Background(), "table",
hrpc.Filters(pFilter))
scanRsp, err := client.Scan(scanRequest)
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.
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.