gohbase: github.com/tsuna/gohbase Index | Files | Directories

package gohbase

import "github.com/tsuna/gohbase"


Package Files

admin_client.go caches.go client.go rpc.go scanner.go


var (

    // TableNotFound is returned when attempting to access a table that
    // doesn't exist on this cluster.
    TableNotFound = errors.New("table not found")

    // ErrCannotFindRegion is returned when it took too many tries to find a
    // region for the request. It's likely that hbase:meta has overlaps or some other
    // inconsistency.
    ErrCannotFindRegion = errors.New("cannot find region for the rpc")

    // ErrClientClosed is returned when the gohbase client has been closed
    ErrClientClosed = errors.New("client is closed")


type AdminClient Uses

type AdminClient interface {
    CreateTable(t *hrpc.CreateTable) error
    DeleteTable(t *hrpc.DeleteTable) error
    EnableTable(t *hrpc.EnableTable) error
    DisableTable(t *hrpc.DisableTable) error
    CreateSnapshot(t *hrpc.Snapshot) error
    DeleteSnapshot(t *hrpc.Snapshot) error
    ListSnapshots(t *hrpc.ListSnapshots) ([]*pb.SnapshotDescription, error)
    RestoreSnapshot(t *hrpc.Snapshot) error
    ClusterStatus() (*pb.ClusterStatus, error)
    ListTableNames(t *hrpc.ListTableNames) ([]*pb.TableName, error)
    // SetBalancer sets balancer state and returns previous state
    SetBalancer(sb *hrpc.SetBalancer) (bool, error)
    // MoveRegion moves a region to a different RegionServer
    MoveRegion(mr *hrpc.MoveRegion) error

AdminClient to perform admistrative operations with HMaster

func NewAdminClient Uses

func NewAdminClient(zkquorum string, options ...Option) AdminClient

NewAdminClient creates an admin HBase client.

type Client Uses

type Client interface {
    Scan(s *hrpc.Scan) hrpc.Scanner
    Get(g *hrpc.Get) (*hrpc.Result, error)
    Put(p *hrpc.Mutate) (*hrpc.Result, error)
    Delete(d *hrpc.Mutate) (*hrpc.Result, error)
    Append(a *hrpc.Mutate) (*hrpc.Result, error)
    Increment(i *hrpc.Mutate) (int64, error)
    CheckAndPut(p *hrpc.Mutate, family string, qualifier string,
        expectedValue []byte) (bool, error)

Client a regular HBase client

func NewClient Uses

func NewClient(zkquorum string, options ...Option) Client

NewClient creates a new HBase client.

type Option Uses

type Option func(*client)

Option is a function used to configure optional config items for a Client.

func CompressionCodec Uses

func CompressionCodec(codec string) Option

CompressionCodec will return an option to set compression codec between client and server. The only currently supported codec is "snappy". Default is no compression.

func EffectiveUser Uses

func EffectiveUser(user string) Option

EffectiveUser will return an option that will set the user used when accessing regions.

func FlushInterval Uses

func FlushInterval(interval time.Duration) Option

FlushInterval will return an option that will set the timeout for flushing the RPC queues used in a given client

func RegionLookupTimeout Uses

func RegionLookupTimeout(to time.Duration) Option

RegionLookupTimeout will return an option that sets the region lookup timeout

func RegionReadTimeout Uses

func RegionReadTimeout(to time.Duration) Option

RegionReadTimeout will return an option that sets the region read timeout

func RpcQueueSize Uses

func RpcQueueSize(size int) Option

RpcQueueSize will return an option that will set the size of the RPC queues used in a given client

func ZookeeperRoot Uses

func ZookeeperRoot(root string) Option

ZookeeperRoot will return an option that will set the zookeeper root path used in a given client.

func ZookeeperTimeout Uses

func ZookeeperTimeout(to time.Duration) Option

ZookeeperTimeout will return an option that will set the zookeeper session timeout.

type RPCClient Uses

type RPCClient interface {
    SendRPC(rpc hrpc.Call) (proto.Message, error)

RPCClient is core client of gohbase. It's exposed for testing.


regionPackage region contains data structures to represent HBase regions.
test/mockPackage mock is a generated GoMock package.
test/mock/regionPackage mock is a generated GoMock package.
test/mock/zkPackage mock is a generated GoMock package.
zkPackage zk encapsulates our interactions with ZooKeeper.

Package gohbase imports 18 packages (graph) and is imported by 16 packages. Updated 2020-11-25. Refresh now. Tools for package owners.