Documentation ¶
Index ¶
- Variables
- func DebugState(c Client) ([]byte, error)
- type AdminClient
- type Client
- type Option
- func CompressionCodec(codec string) Option
- func EffectiveUser(user string) Option
- func FlushInterval(interval time.Duration) Option
- func Logger(logger *slog.Logger) Option
- func RegionDialer(dialer func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func RegionLookupTimeout(to time.Duration) Option
- func RegionReadTimeout(to time.Duration) Option
- func RpcQueueSize(size int) Option
- func ZooKeeperDialer(dialer func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func ZookeeperRoot(root string) Option
- func ZookeeperTimeout(to time.Duration) Option
- type RPCClient
Constants ¶
This section is empty.
Variables ¶
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") )
Constants
var ( // NotExecutedError is returned when an RPC in a batch is not // executed due to encountering a different error in the batch. NotExecutedError = errors.New( "RPC in batch not executed due to another error") )
Functions ¶
func DebugState ¶
DebugState information about the clients keyRegionCache, and clientRegionCache
Types ¶
type AdminClient ¶
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 administrative operations with HMaster
func NewAdminClient ¶
func NewAdminClient(zkquorum string, options ...Option) AdminClient
NewAdminClient creates an admin HBase client.
type Client ¶
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) SendBatch(ctx context.Context, batch []hrpc.Call) (res []hrpc.RPCResult, allOK bool) CacheRegions(table []byte) error Close() }
Client a regular HBase client
type Option ¶
type Option func(*client)
Option is a function used to configure optional config items for a Client.
func CompressionCodec ¶
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 ¶
EffectiveUser will return an option that will set the user used when accessing regions.
func FlushInterval ¶
FlushInterval will return an option that will set the timeout for flushing the RPC queues used in a given client
func RegionDialer ¶
RegionDialer will return an option that uses the specified Dialer for connecting to region servers. This allows for connecting through proxies.
func RegionLookupTimeout ¶
RegionLookupTimeout will return an option that sets the region lookup timeout
func RegionReadTimeout ¶
RegionReadTimeout will return an option that sets the region read timeout
func RpcQueueSize ¶
RpcQueueSize will return an option that will set the size of the RPC queues used in a given client
func ZooKeeperDialer ¶
func ZooKeeperDialer(dialer func( ctx context.Context, network, addr string) (net.Conn, error)) Option
ZooKeeperDialer will return an option to pass the given dialer function into the ZooKeeper client Connect() call, which allows for customizing network connections.
func ZookeeperRoot ¶
ZookeeperRoot will return an option that will set the zookeeper root path used in a given client.
func ZookeeperTimeout ¶
ZookeeperTimeout will return an option that will set the zookeeper session timeout.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package region contains data structures to represent HBase regions.
|
Package region contains data structures to represent HBase regions. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock/region
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock/zk
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package zk encapsulates our interactions with ZooKeeper.
|
Package zk encapsulates our interactions with ZooKeeper. |