hbase

package module
v0.0.0-...-cefb827 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2015 License: BSD-3-Clause, MIT Imports: 22 Imported by: 0

README

UNMAINTAINED, take a look at pingcap/go-hbase #go-hbase

Derived from Lazyshot/go-hbase.
add coprocessor support, thread-safe, admin commands(create/drop table with attrs).

Support HBase > 0.98.4

Documentation

Index

Constants

View Source
const (
	TypeMinimum             = Type(0)
	TypePut                 = Type(4)
	TypeDelete              = Type(8)
	TypeDeleteFamilyVersion = Type(10)
	TypeDeleteColumn        = Type(12)
	TypeDeleteFamily        = Type(14)
	TypeMaximum             = Type(0xff)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesSlice

type BytesSlice [][]byte

func (BytesSlice) Len

func (s BytesSlice) Len() int

func (BytesSlice) Less

func (s BytesSlice) Less(i, j int) bool

func (BytesSlice) Swap

func (s BytesSlice) Swap(i, j int)

type Column

type Column struct {
	Family []byte
	Qual   []byte
}

func NewColumn

func NewColumn(family, qual []byte) *Column

func (*Column) ParseFromString

func (c *Column) ParseFromString(s string)

func (*Column) String

func (c *Column) String() string

func (*Column) Write

func (c *Column) Write(w io.Writer)

type ColumnCoordinate

type ColumnCoordinate struct {
	Table []byte
	Row   []byte
	Column
}

func NewColumnCoordinate

func NewColumnCoordinate(table, row, family, qual []byte) *ColumnCoordinate

func (*ColumnCoordinate) Equal

func (c *ColumnCoordinate) Equal(a *ColumnCoordinate) bool

func (*ColumnCoordinate) GetColumn

func (c *ColumnCoordinate) GetColumn() *Column

func (*ColumnCoordinate) ParseField

func (*ColumnCoordinate) ParseFromString

func (c *ColumnCoordinate) ParseFromString(s string)

func (*ColumnCoordinate) String

func (c *ColumnCoordinate) String() string

func (*ColumnCoordinate) Write

func (c *ColumnCoordinate) Write(w io.Writer)

type ColumnFamilyDescriptor

type ColumnFamilyDescriptor struct {
	// contains filtered or unexported fields
}

func NewColumnFamilyDescriptor

func NewColumnFamilyDescriptor(name string) *ColumnFamilyDescriptor

func (*ColumnFamilyDescriptor) AddAttr

func (c *ColumnFamilyDescriptor) AddAttr(attrName string, val []byte)

func (*ColumnFamilyDescriptor) AddStrAddr

func (c *ColumnFamilyDescriptor) AddStrAddr(attrName string, val string)

type CoprocessorServiceCall

type CoprocessorServiceCall struct {
	Row          []byte
	ServiceName  string
	MethodName   string
	RequestParam []byte
}

func (*CoprocessorServiceCall) ToProto

func (c *CoprocessorServiceCall) ToProto() pb.Message

type Delete

type Delete struct {
	Row         []byte
	Families    set
	FamilyQuals map[string]set
	Ts          map[string]uint64
}

func NewDelete

func NewDelete(row []byte) *Delete

func (*Delete) AddColumn

func (d *Delete) AddColumn(family, qual []byte)

func (*Delete) AddColumnWithTimestamp

func (d *Delete) AddColumnWithTimestamp(family, qual []byte, ts uint64)

func (*Delete) AddFamily

func (d *Delete) AddFamily(family []byte)

func (*Delete) AddString

func (d *Delete) AddString(famqual string) error

func (*Delete) AddStringColumn

func (d *Delete) AddStringColumn(family, qual string)

func (*Delete) AddStringFamily

func (d *Delete) AddStringFamily(family string)

func (*Delete) GetRow

func (d *Delete) GetRow() []byte

func (*Delete) ToProto

func (d *Delete) ToProto() pb.Message

type Get

type Get struct {
	Row         []byte
	Families    set
	FamilyQuals map[string]set
	Versions    int32
	TsRangeFrom uint64
	TsRangeTo   uint64
}

func NewGet

func NewGet(row []byte) *Get

func (*Get) AddColumn

func (g *Get) AddColumn(family, qual []byte)

func (*Get) AddFamily

func (g *Get) AddFamily(family []byte)

func (*Get) AddString

func (g *Get) AddString(famqual string) error

func (*Get) AddStringColumn

func (g *Get) AddStringColumn(family, qual string)

func (*Get) AddStringFamily

func (g *Get) AddStringFamily(family string)

func (*Get) AddTimeRange

func (g *Get) AddTimeRange(from uint64, to uint64)

func (*Get) GetRow

func (g *Get) GetRow() []byte

func (*Get) ToProto

func (g *Get) ToProto() pb.Message

type HBaseClient

type HBaseClient interface {
	Get(tbl string, g *Get) (*ResultRow, error)
	Put(tbl string, p *Put) (bool, error)
	Delete(tbl string, d *Delete) (bool, error)
	TableExists(tbl string) bool
	DropTable(t TableName) error
	DisableTable(t TableName) error
	CreateTable(t *TableDescriptor, splits [][]byte) error
	ServiceCall(table string, call *CoprocessorServiceCall) (*proto.CoprocessorServiceResponse, error)
	LocateRegion(table, row []byte, useCache bool) *RegionInfo
	Close() error
}

export client interface

func NewClient

func NewClient(zkHosts []string, zkRoot string) (HBaseClient, error)

type Kv

type Kv struct {
	Row   []byte
	Ts    uint64
	Value []byte
	// history results
	Values map[uint64][]byte
	Column
}

type Put

type Put struct {
	Row        []byte
	Families   [][]byte
	Qualifiers [][][]byte
	Values     [][][]byte
}

func NewPut

func NewPut(row []byte) *Put

func (*Put) AddStringValue

func (p *Put) AddStringValue(family, column, value string)

func (*Put) AddValue

func (p *Put) AddValue(family, qual, value []byte)

func (*Put) GetRow

func (p *Put) GetRow() []byte

func (*Put) ToProto

func (p *Put) ToProto() pb.Message

type RegionInfo

type RegionInfo struct {
	Server         string
	StartKey       []byte
	EndKey         []byte
	Name           string
	Ts             string
	TableNamespace string
	TableName      string
	Offline        bool
	Split          bool
}

type ResultRow

type ResultRow struct {
	Row           []byte
	Columns       map[string]*Kv
	SortedColumns []*Kv
}

func NewResultRow

func NewResultRow(result *proto.Result) *ResultRow

type Scan

type Scan struct {
	StartRow []byte
	StopRow  []byte

	MaxVersions uint32
	TsRangeFrom uint64
	TsRangeTo   uint64
	// contains filtered or unexported fields
}

func NewScan

func NewScan(table []byte, batchSize int, c HBaseClient) *Scan

func (*Scan) AddAttr

func (s *Scan) AddAttr(name string, val []byte)

func (*Scan) AddColumn

func (s *Scan) AddColumn(family, qual []byte)

func (*Scan) AddFamily

func (s *Scan) AddFamily(family []byte)

func (*Scan) AddStringColumn

func (s *Scan) AddStringColumn(family, qual string)

func (*Scan) AddStringFamily

func (s *Scan) AddStringFamily(family string)

func (*Scan) Close

func (s *Scan) Close()

func (*Scan) Closed

func (s *Scan) Closed() bool

func (*Scan) CreateGetFromScan

func (s *Scan) CreateGetFromScan(row []byte) *Get

func (*Scan) Next

func (s *Scan) Next() *ResultRow

type TableDescriptor

type TableDescriptor struct {
	// contains filtered or unexported fields
}

func NewTableDesciptor

func NewTableDesciptor(tblName TableName) *TableDescriptor

func (*TableDescriptor) AddColumnDesc

func (t *TableDescriptor) AddColumnDesc(cf *ColumnFamilyDescriptor)

func (*TableDescriptor) AddStrAddr

func (c *TableDescriptor) AddStrAddr(attrName string, val string)

type TableName

type TableName struct {
	// contains filtered or unexported fields
}

func NewTableNameWithDefaultNS

func NewTableNameWithDefaultNS(tblName string) TableName

type Type

type Type byte

Directories

Path Synopsis
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL