Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeKey(entryKey []byte) (*pb.Key, error)
- func EncodeKey(key *pb.Key) (entryKey, rowKey []byte)
- func EncodeKeyPrefix(key *pb.Key, lastField Field) ([]byte, error)
- func Equal(left *pb.Key, right *pb.Key) bool
- func FetchRecord(key *pb.Key, item *badger.Item, headOnly bool) (*pb.Record, error)
- func NewLogger(logdir, filename string) (*zap.Logger, error)
- func RecordFetched(key *pb.Key, item *badger.Item, data []byte) *pb.Record
- func RecordNotFetched(key *pb.Key, item *badger.Item) *pb.Record
- func RecordNotFound(key *pb.Key) *pb.Record
- func SanitizeKeyLen(len int) int
- type BlockSender
- type Configuration
- type DefaultServer
- func (this *DefaultServer) Close()
- func (this *DefaultServer) Get(ctx context.Context, keyRequest *pb.KeyRequest) (*pb.Record, error)
- func (this *DefaultServer) GetRange(ctx context.Context, rangeRequest *pb.RangeRequest) (*pb.Block, error)
- func (this *DefaultServer) GetRecent(ctx context.Context, keyRequest *pb.KeyRequest) (*pb.Record, error)
- func (this *DefaultServer) GetRegion(keyRequest *pb.KeyRequest, response pb.KeyValueService_GetRegionServer) error
- func (this *DefaultServer) GetRow(keyRequest *pb.KeyRequest, response pb.KeyValueService_GetRowServer) error
- func (this *DefaultServer) GetSpace(keyRequest *pb.KeyRequest, response pb.KeyValueService_GetSpaceServer) error
- func (this *DefaultServer) Put(ctx context.Context, recordRequest *pb.RecordRequest) (*pb.Status, error)
- func (this *DefaultServer) Remove(ctx context.Context, keyRequest *pb.KeyRequest) (*pb.Status, error)
- func (this *DefaultServer) Scan(scanRequest *pb.ScanRequest, response pb.KeyValueService_ScanServer) error
- func (this *DefaultServer) ServeGRPC() error
- func (this *DefaultServer) Touch(ctx context.Context, recordRequest *pb.RecordRequest) (*pb.Status, error)
- type Field
- type KeyValueStorage
- type KeyValueStorageCtx
- func (this *KeyValueStorageCtx) Close() error
- func (this *KeyValueStorageCtx) Get(keyRequest *pb.KeyRequest) (*pb.Record, error)
- func (this *KeyValueStorageCtx) GetArea(keyRequest *pb.KeyRequest, lastField Field, sender BlockSender) error
- func (this *KeyValueStorageCtx) GetRange(rangeRequest *pb.RangeRequest) (*pb.Block, error)
- func (this *KeyValueStorageCtx) GetRecent(keyRequest *pb.KeyRequest) (*pb.Record, error)
- func (this *KeyValueStorageCtx) Put(recordRequest *pb.RecordRequest) (*pb.Status, error)
- func (this *KeyValueStorageCtx) Remove(keyRequest *pb.KeyRequest) (*pb.Status, error)
- func (this *KeyValueStorageCtx) Scan(scanRequest *pb.ScanRequest, sender BlockSender) error
- func (this *KeyValueStorageCtx) Touch(recordRequest *pb.RecordRequest) (*pb.Status, error)
Constants ¶
View Source
const ( MaxKeyLength = 65535 SizeOfUUID = 16 )
View Source
const ( MajorKeyField = Field(iota) RegionNameField MinorKeyField TimestampField )
Variables ¶
Functions ¶
func FetchRecord ¶
func SanitizeKeyLen ¶
Types ¶
type BlockSender ¶
type Configuration ¶
type Configuration struct { Host string `yaml:"host"` HttpPort int `yaml:"httpPort"` GrpcPort int `yaml:"grpcPort"` HttpAddress string GrpcAddress string DataDir string `yaml:"dataDir"` KeyDir string ValueDir string WalDir string SnapDir string LogDir string NumCPU int `yaml:"numCPU"` // use all of <= 0 }
func LoadConfiguration ¶
func LoadConfiguration(fileName string) (conf *Configuration, err error)
func NewDefaultConfiguration ¶
func NewDefaultConfiguration(dataDir string) (conf *Configuration, err error)
type DefaultServer ¶
type DefaultServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(conf *Configuration) (server *DefaultServer, err error)
func (*DefaultServer) Close ¶
func (this *DefaultServer) Close()
func (*DefaultServer) Get ¶
func (this *DefaultServer) Get(ctx context.Context, keyRequest *pb.KeyRequest) (*pb.Record, error)
Gets exact match entry
func (*DefaultServer) GetRange ¶
func (this *DefaultServer) GetRange(ctx context.Context, rangeRequest *pb.RangeRequest) (*pb.Block, error)
Gets range of timestamps inside a row
func (*DefaultServer) GetRecent ¶
func (this *DefaultServer) GetRecent(ctx context.Context, keyRequest *pb.KeyRequest) (*pb.Record, error)
Gets early or equal timestamp entry
func (*DefaultServer) GetRegion ¶
func (this *DefaultServer) GetRegion(keyRequest *pb.KeyRequest, response pb.KeyValueService_GetRegionServer) error
Gets the whole region of records
func (*DefaultServer) GetRow ¶
func (this *DefaultServer) GetRow(keyRequest *pb.KeyRequest, response pb.KeyValueService_GetRowServer) error
Gets the whole raw of records with all available timestamps with latest versions
func (*DefaultServer) GetSpace ¶
func (this *DefaultServer) GetSpace(keyRequest *pb.KeyRequest, response pb.KeyValueService_GetSpaceServer) error
Gets the whole space of records associated with majorKey
func (*DefaultServer) Put ¶
func (this *DefaultServer) Put(ctx context.Context, recordRequest *pb.RecordRequest) (*pb.Status, error)
Puts the record
func (*DefaultServer) Remove ¶
func (this *DefaultServer) Remove(ctx context.Context, keyRequest *pb.KeyRequest) (*pb.Status, error)
Remove the record
func (*DefaultServer) Scan ¶
func (this *DefaultServer) Scan(scanRequest *pb.ScanRequest, response pb.KeyValueService_ScanServer) error
Gets all records
func (*DefaultServer) ServeGRPC ¶
func (this *DefaultServer) ServeGRPC() error
func (*DefaultServer) Touch ¶
func (this *DefaultServer) Touch(ctx context.Context, recordRequest *pb.RecordRequest) (*pb.Status, error)
Touches the record
type KeyValueStorage ¶
type KeyValueStorage interface { Get(keyRequest *pb.KeyRequest) (*pb.Record, error) GetRecent(keyRequest *pb.KeyRequest) (*pb.Record, error) GetRange(rangeRequest *pb.RangeRequest) (*pb.Block, error) GetArea(keyRequest *pb.KeyRequest, lastField Field, sender BlockSender) error Scan(scanRequest *pb.ScanRequest, sender BlockSender) error Touch(recordRequest *pb.RecordRequest) (*pb.Status, error) Put(recordRequest *pb.RecordRequest) (*pb.Status, error) Remove(keyRequest *pb.KeyRequest) (*pb.Status, error) Close() error }
type KeyValueStorageCtx ¶
type KeyValueStorageCtx struct {
// contains filtered or unexported fields
}
func OpenKeyValueStorage ¶
func OpenKeyValueStorage(conf *Configuration, log *zap.Logger) (context *KeyValueStorageCtx, err error)
func (*KeyValueStorageCtx) Close ¶
func (this *KeyValueStorageCtx) Close() error
func (*KeyValueStorageCtx) Get ¶
func (this *KeyValueStorageCtx) Get(keyRequest *pb.KeyRequest) (*pb.Record, error)
func (*KeyValueStorageCtx) GetArea ¶
func (this *KeyValueStorageCtx) GetArea(keyRequest *pb.KeyRequest, lastField Field, sender BlockSender) error
func (*KeyValueStorageCtx) GetRange ¶
func (this *KeyValueStorageCtx) GetRange(rangeRequest *pb.RangeRequest) (*pb.Block, error)
func (*KeyValueStorageCtx) GetRecent ¶
func (this *KeyValueStorageCtx) GetRecent(keyRequest *pb.KeyRequest) (*pb.Record, error)
func (*KeyValueStorageCtx) Put ¶
func (this *KeyValueStorageCtx) Put(recordRequest *pb.RecordRequest) (*pb.Status, error)
func (*KeyValueStorageCtx) Remove ¶
func (this *KeyValueStorageCtx) Remove(keyRequest *pb.KeyRequest) (*pb.Status, error)
func (*KeyValueStorageCtx) Scan ¶
func (this *KeyValueStorageCtx) Scan(scanRequest *pb.ScanRequest, sender BlockSender) error
func (*KeyValueStorageCtx) Touch ¶
func (this *KeyValueStorageCtx) Touch(recordRequest *pb.RecordRequest) (*pb.Status, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.