Documentation
¶
Index ¶
- func Families(fam map[string][]string) func(Call) error
- func Filters(fl filter.Filter) func(Call) error
- type Call
- type Get
- func (g *Get) ExistsOnly() error
- func (b *Get) GetContext() context.Context
- func (g *Get) GetFamilies() map[string][]string
- func (g *Get) GetFilter() filter.Filter
- func (g *Get) GetName() string
- func (b *Get) GetRegion() *regioninfo.Info
- func (b *Get) GetResultChan() chan RPCResult
- func (b *Get) Key() []byte
- func (g *Get) NewResponse() proto.Message
- func (g *Get) Serialize() ([]byte, error)
- func (g *Get) SetFamilies(f map[string][]string) error
- func (g *Get) SetFilter(f filter.Filter) error
- func (b *Get) SetRegion(region *regioninfo.Info)
- func (b *Get) Table() []byte
- type Mutate
- func NewAppStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
- func NewDelStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
- func NewIncStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
- func NewPutStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
- func (b *Mutate) GetContext() context.Context
- func (m *Mutate) GetName() string
- func (b *Mutate) GetRegion() *regioninfo.Info
- func (b *Mutate) GetResultChan() chan RPCResult
- func (b *Mutate) Key() []byte
- func (m *Mutate) NewResponse() proto.Message
- func (m *Mutate) Serialize() ([]byte, error)
- func (m *Mutate) SetFamilies(fam map[string][]string) error
- func (m *Mutate) SetFilter(ft filter.Filter) error
- func (b *Mutate) SetRegion(region *regioninfo.Info)
- func (b *Mutate) Table() []byte
- type RPCResult
- type Scan
- func NewCloseFromID(ctx context.Context, table []byte, scannerID uint64, startRow []byte) *Scan
- func NewScan(ctx context.Context, table []byte, options ...func(Call) error) (*Scan, error)
- func NewScanFromID(ctx context.Context, table []byte, scannerID uint64, startRow []byte) *Scan
- func NewScanRange(ctx context.Context, table, startRow, stopRow []byte, ...) (*Scan, error)
- func NewScanRangeStr(ctx context.Context, table, startRow, stopRow string, ...) (*Scan, error)
- func NewScanStr(ctx context.Context, table string, options ...func(Call) error) (*Scan, error)
- func (b *Scan) GetContext() context.Context
- func (s *Scan) GetFamilies() map[string][]string
- func (s *Scan) GetFilter() filter.Filter
- func (s *Scan) GetName() string
- func (b *Scan) GetRegion() *regioninfo.Info
- func (s *Scan) GetRegionStop() []byte
- func (b *Scan) GetResultChan() chan RPCResult
- func (s *Scan) GetStartRow() []byte
- func (s *Scan) GetStopRow() []byte
- func (b *Scan) Key() []byte
- func (s *Scan) NewResponse() proto.Message
- func (s *Scan) Serialize() ([]byte, error)
- func (s *Scan) SetFamilies(fam map[string][]string) error
- func (s *Scan) SetFilter(ft filter.Filter) error
- func (b *Scan) SetRegion(region *regioninfo.Info)
- func (b *Scan) Table() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Call ¶
type Call interface { Table() []byte Key() []byte GetRegion() *regioninfo.Info SetRegion(region *regioninfo.Info) GetName() string Serialize() ([]byte, error) // Returns a newly created (default-state) protobuf in which to store the // response of this call. NewResponse() proto.Message GetResultChan() chan RPCResult GetContext() context.Context SetFamilies(fam map[string][]string) error SetFilter(ft filter.Filter) error }
Call represents an HBase RPC call.
type Get ¶
type Get struct {
// contains filtered or unexported fields
}
Get represents a Get HBase call.
func NewGet ¶
NewGet is called to construct a Get* object which is then passed as the sole parameter for a client.Get(). Uses functional options for arguments, for more information see - http://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis Allows usage like the following -
get, err := hrpc.NewGet(ctx, table, key) get, err := hrpc.NewGet(ctx, table, key, hrpc.Families(fam)) get, err := hrpc.NewGet(ctx, table, key, hrpc.Filters(filter)) get, err := hrpc.NewGet(ctx, table, key, hrpc.Families(fam), hrpc.Filters(filter))
func NewGetBefore ¶
func NewGetBefore(ctx context.Context, table, key []byte, options ...func(Call) error) (*Get, error)
NewGetBefore creates a new Get request for the row right before the given key in the given table and family. Accepts functional options.
func (*Get) ExistsOnly ¶
ExistsOnly makes this Get request not return any KeyValue, merely whether or not the given row key exists in the table.
func (*Get) GetContext ¶
func (*Get) GetFamilies ¶
GetFamilies returns current set family
func (*Get) GetRegion ¶
func (b *Get) GetRegion() *regioninfo.Info
func (*Get) GetResultChan ¶
func (b *Get) GetResultChan() chan RPCResult
func (*Get) NewResponse ¶
NewResponse creates an empty protobuf message to read the response of this RPC.
func (*Get) SetFamilies ¶
SetFamilies sets families to use and returns the object
func (*Get) SetRegion ¶
func (b *Get) SetRegion(region *regioninfo.Info)
type Mutate ¶
type Mutate struct {
// contains filtered or unexported fields
}
Mutate represents a mutation on HBase.
func NewAppStr ¶
func NewAppStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
NewAppStr creates a new Mutation request that will append the given values to their existing values in HBase under the given table and key.
func NewDelStr ¶
func NewDelStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
NewDelStr creates a new Mutation request that will delete the given values from HBase under the given table and key.
func NewIncStr ¶
func NewIncStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
NewIncStr creates a new Mutation request that will increment the given values in HBase under the given table and key.
func NewPutStr ¶
func NewPutStr(ctx context.Context, table, key string, values map[string]map[string][]byte) (*Mutate, error)
NewPutStr creates a new Mutation request that will put the given values into HBase under the given table and key.
func (*Mutate) GetContext ¶
func (*Mutate) GetRegion ¶
func (b *Mutate) GetRegion() *regioninfo.Info
func (*Mutate) GetResultChan ¶
func (b *Mutate) GetResultChan() chan RPCResult
func (*Mutate) NewResponse ¶
NewResponse creates an empty protobuf message to read the response of this RPC.
func (*Mutate) Serialize ¶
Serialize converts this mutate object into a protobuf message suitable for sending to an HBase server
func (*Mutate) SetFamilies ¶
SetFamilies always returns an error when used on Mutate objects. Do not use. Exists solely so Mutate can implement the Call interface.
func (*Mutate) SetFilter ¶
SetFilter always returns an error when used on Mutate objects. Do not use. Exists solely so Mutate can implement the Call interface.
func (*Mutate) SetRegion ¶
func (b *Mutate) SetRegion(region *regioninfo.Info)
type RPCResult ¶
RPCResult is struct that will contain both the resulting message from an RPC call, and any errors that may have occurred related to making the RPC call.
type Scan ¶
type Scan struct {
// contains filtered or unexported fields
}
Scan represents a scanner on an HBase table.
func NewCloseFromID ¶
NewCloseFromID creates a new Scan request that will close the scan for a given scanner ID.
func NewScan ¶
NewScan is called to construct a Scan* object which is then passed as the sole parameter for a client.Scan(). Uses functional options for arguments, see http://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis for more information.
Allows usage like the following -
scan, err := hrpc.NewScan(ctx, table) scan, err := hrpc.NewScan(ctx, table, hrpc.Families(fam)) scan, err := hrpc.NewScan(ctx, table, hrpc.Filters(filter)) scan, err := hrpc.NewScan(ctx, table, hrpc.Families(fam), hrpc.Filters(filter))
func NewScanFromID ¶
NewScanFromID creates a new Scan request that will return additional results from a given scanner ID.
func NewScanRange ¶
func NewScanRange(ctx context.Context, table, startRow, stopRow []byte, options ...func(Call) error) (*Scan, error)
NewScanRange is equivalent to NewScan but adds two additional parameters - startRow, stopRow. This allows a range to be scanned without having to go through the overhead of using a RowFilter
func NewScanRangeStr ¶
func NewScanRangeStr(ctx context.Context, table, startRow, stopRow string, options ...func(Call) error) (*Scan, error)
NewScanRangeStr wraps NewScanRange but allows table, startRow, stopRow to be specified as strings
func NewScanStr ¶
NewScanStr wraps NewScan but allows the table to be specified as a string.
func (*Scan) GetContext ¶
func (*Scan) GetFamilies ¶
GetFamilies returns the set families.
func (*Scan) GetRegion ¶
func (b *Scan) GetRegion() *regioninfo.Info
func (*Scan) GetRegionStop ¶
GetRegionStop returns the stop key of the region currently being scanned.
func (*Scan) GetResultChan ¶
func (b *Scan) GetResultChan() chan RPCResult
func (*Scan) GetStartRow ¶
GetStartRow returns the set startRow.
func (*Scan) NewResponse ¶
NewResponse creates an empty protobuf message to read the response of this RPC.
func (*Scan) Serialize ¶
Serialize will convert this Scan into a serialized protobuf message ready to be sent to an HBase node.
func (*Scan) SetFamilies ¶
SetFamilies sets the request's families.
func (*Scan) SetRegion ¶
func (b *Scan) SetRegion(region *regioninfo.Info)