Documentation ¶
Index ¶
- type Client
- func (c *Client) AddHook(hookFn HookFunc)
- func (c *Client) Append(ctx context.Context, table string, key string, ...) (*hrpc.Result, error)
- func (c *Client) Close() error
- func (c *Client) ClusterStatus() (*pb.ClusterStatus, error)
- func (c *Client) CreateSnapshot(ctx context.Context, name string, table string, opts ...func(hrpc.Call) error) error
- func (c *Client) CreateTable(ctx context.Context, table []byte, families map[string]map[string]string, ...) error
- func (c *Client) Delete(ctx context.Context, table string, key string, ...) (*hrpc.Result, error)
- func (c *Client) DeleteSnapshot(ctx context.Context, name string, table string, opts ...func(hrpc.Call) error) error
- func (c *Client) DeleteTable(ctx context.Context, table []byte) error
- func (c *Client) DisableTable(ctx context.Context, table []byte) error
- func (c *Client) EnableTable(ctx context.Context, table []byte) error
- func (c *Client) Get(ctx context.Context, table, key []byte, options ...func(hrpc.Call) error) (result *hrpc.Result, err error)
- func (c *Client) GetStr(ctx context.Context, table, key string, options ...func(hrpc.Call) error) (result *hrpc.Result, err error)
- func (c *Client) Increment(ctx context.Context, table string, key string, ...) (int64, error)
- func (c *Client) IncrementSingle(ctx context.Context, table string, key string, family string, qualifier string, ...) (int64, error)
- func (c *Client) ListSnapshots(ctx context.Context) ([]*pb.SnapshotDescription, error)
- func (c *Client) ListTableNames(ctx context.Context, opts ...func(hrpc.Call) error) ([]*pb.TableName, error)
- func (c *Client) MoveRegion(ctx context.Context, regionName []byte, opts ...func(hrpc.Call) error) error
- func (c *Client) Ping(ctx context.Context) (err error)
- func (c *Client) PutStr(ctx context.Context, table string, key string, ...) (*hrpc.Result, error)
- func (c *Client) RestoreSnapshot(ctx context.Context, name string, table string, opts ...func(hrpc.Call) error) error
- func (c *Client) Scan(ctx context.Context, table []byte, options ...func(hrpc.Call) error) (scanner hrpc.Scanner, err error)
- func (c *Client) ScanAll(ctx context.Context, table []byte, options ...func(hrpc.Call) error) (results []*hrpc.Result, err error)
- func (c *Client) ScanRange(ctx context.Context, table, startRow, stopRow []byte, ...) (scanner hrpc.Scanner, err error)
- func (c *Client) ScanRangeStr(ctx context.Context, table, startRow, stopRow string, ...) (hrpc.Scanner, error)
- func (c *Client) ScanStr(ctx context.Context, table string, options ...func(hrpc.Call) error) (hrpc.Scanner, error)
- func (c *Client) ScanStrAll(ctx context.Context, table string, options ...func(hrpc.Call) error) ([]*hrpc.Result, error)
- func (c *Client) SetBalancer(ctx context.Context, enabled bool) (bool, error)
- type Config
- type HookFunc
- type Proxy
- type ZKConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client hbase client.
func (*Client) Append ¶
func (c *Client) Append(ctx context.Context, table string, key string, values map[string]map[string][]byte, options ...func(hrpc.Call) error) (*hrpc.Result, error)
Append do a append command.
func (*Client) ClusterStatus ¶
func (c *Client) ClusterStatus() (*pb.ClusterStatus, error)
ClusterStatus .
func (*Client) CreateSnapshot ¶
func (c *Client) CreateSnapshot(ctx context.Context, name string, table string, opts ...func(hrpc.Call) error) error
CreateSnapshot .
func (*Client) CreateTable ¶
func (c *Client) CreateTable(ctx context.Context, table []byte, families map[string]map[string]string, opts ...func(*hrpc.CreateTable)) error
CreateTable .
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, table string, key string, values map[string]map[string][]byte, options ...func(hrpc.Call) error) (*hrpc.Result, error)
Delete is used to perform Delete operations on a single row. To delete entire row, values should be nil.
To delete specific families, qualifiers map should be nil:
map[string]map[string][]byte{ "cf1": nil, "cf2": nil, }
To delete specific qualifiers:
map[string]map[string][]byte{ "cf": map[string][]byte{ "q1": nil, "q2": nil, }, }
To delete all versions before and at a timestamp, pass hrpc.Timestamp() option. By default all versions will be removed.
To delete only a specific version at a timestamp, pass hrpc.DeleteOneVersion() option along with a timestamp. For delete specific qualifiers request, if timestamp is not passed, only the latest version will be removed. For delete specific families request, the timestamp should be passed or it will have no effect as it's an expensive operation to perform.
func (*Client) DeleteSnapshot ¶
func (c *Client) DeleteSnapshot(ctx context.Context, name string, table string, opts ...func(hrpc.Call) error) error
DeleteSnapshot .
func (*Client) DeleteTable ¶
DeleteTable .
func (*Client) DisableTable ¶
DisableTable .
func (*Client) EnableTable ¶
EnableTable .
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, table, key []byte, options ...func(hrpc.Call) error) (result *hrpc.Result, err error)
Get get result for the given table and row key. NOTE: if err != nil then result != nil, if result not exists result.Cells length is 0
func (*Client) GetStr ¶
func (c *Client) GetStr(ctx context.Context, table, key string, options ...func(hrpc.Call) error) (result *hrpc.Result, err error)
GetStr do a get command. NOTE: if err != nil then result != nil, if result not exists result.Cells length is 0
func (*Client) Increment ¶
func (c *Client) Increment(ctx context.Context, table string, key string, values map[string]map[string][]byte, options ...func(hrpc.Call) error) (int64, error)
Increment the given values in HBase under the given table and key.
func (*Client) IncrementSingle ¶
func (c *Client) IncrementSingle(ctx context.Context, table string, key string, family string, qualifier string, amount int64, options ...func(hrpc.Call) error) (int64, error)
IncrementSingle increment the given value by amount in HBase under the given table, key, family and qualifier.
func (*Client) ListSnapshots ¶
ListSnapshots .
func (*Client) ListTableNames ¶
func (c *Client) ListTableNames(ctx context.Context, opts ...func(hrpc.Call) error) ([]*pb.TableName, error)
ListTableNames .
func (*Client) MoveRegion ¶
func (c *Client) MoveRegion(ctx context.Context, regionName []byte, opts ...func(hrpc.Call) error) error
MoveRegion .
func (*Client) PutStr ¶
func (c *Client) PutStr(ctx context.Context, table string, key string, values map[string]map[string][]byte, options ...func(hrpc.Call) error) (*hrpc.Result, error)
PutStr insert the given family-column-values in the given row key of the given table.
func (*Client) RestoreSnapshot ¶
func (c *Client) RestoreSnapshot(ctx context.Context, name string, table string, opts ...func(hrpc.Call) error) error
RestoreSnapshot .
func (*Client) Scan ¶
func (c *Client) Scan(ctx context.Context, table []byte, options ...func(hrpc.Call) error) (scanner hrpc.Scanner, err error)
Scan do a scan command.
func (*Client) ScanAll ¶
func (c *Client) ScanAll(ctx context.Context, table []byte, options ...func(hrpc.Call) error) (results []*hrpc.Result, err error)
ScanAll do scan command and return all result NOTE: if err != nil the results is safe for range operate even not result found
func (*Client) ScanRange ¶
func (c *Client) ScanRange(ctx context.Context, table, startRow, stopRow []byte, options ...func(hrpc.Call) error) (scanner hrpc.Scanner, err error)
ScanRange get a scanner for the given table and key range. The range is half-open, i.e. [startRow; stopRow[ -- stopRow is not included in the range.
func (*Client) ScanRangeStr ¶
func (c *Client) ScanRangeStr(ctx context.Context, table, startRow, stopRow string, options ...func(hrpc.Call) error) (hrpc.Scanner, error)
ScanRangeStr get a scanner for the given table and key range. The range is half-open, i.e. [startRow; stopRow[ -- stopRow is not included in the range.
func (*Client) ScanStr ¶
func (c *Client) ScanStr(ctx context.Context, table string, options ...func(hrpc.Call) error) (hrpc.Scanner, error)
ScanStr scan string
type Config ¶
type Config struct { Zookeeper *ZKConfig RPCQueueSize int FlushInterval time.Duration EffectiveUser string RegionLookupTimeout time.Duration RegionReadTimeout time.Duration TestRowKey string Options []gohbase.Option }
Config hbase config
type HookFunc ¶
HookFunc hook function call before every method and hook return function will call after finish.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy 代理
func (*Proxy) SetNameSpace ¶
SetNameSpace 设置组