Versions in this module Expand all Collapse all v0 v0.3.2 May 10, 2018 Changes in this version type TableStats + ApproximateKeyNum int64 + DiskBytesUsage int64 v0.3.0 Apr 8, 2018 Changes in this version + const APIAddLearnerNode + const APIAddNode + const APICheckBackup + const APIGetIndexes + const APIGetLeader + const APIGetMembers + const APIGetSnapshotSyncInfo + const APIIsRaftSynced + const APINodeAllReady + const APIRemoveNode + const DIR_PERM + const DefaultExpirationPolicy + const FILE_PERM + const HashName + const InternalPrefix + const KEYSEP + const KVName + const LOG_DEBUG + const LOG_DETAIL + const LOG_ERR + const LOG_INFO + const LOG_WARN + const LearnerRoleLogSyncer + const LearnerRoleSearcher + const ListName + const MAX_PARTITION_NUM + const MAX_REPLICATOR + const NamespaceTableSeperator + const RangeClose + const RangeLOpen + const RangeOpen + const RangeROpen + const SetName + const ZSetName + var BuildTime = "unset" + var Commit = "unset" + var ErrDeprecatedAPI = errors.New("deprecated api") + var ErrEpochMismatch = errors.New("epoch mismatch") + var ErrInvalidArgs = errors.New("invalid arguments") + var ErrInvalidCommand = errors.New("invalid command") + var ErrInvalidPrefix = errors.New("invalid prefix") + var ErrInvalidRedisKey = errors.New("invalid redis key") + var ErrInvalidScanCursor = errors.New("invalid scan cursor") + var ErrInvalidScanType = errors.New("invalid scan type") + var ErrInvalidTableName = errors.New("table name is invalid") + var ErrNotSupport = errors.New("not supported") + var ErrQueueTimeout = errors.New("queue request timeout") + var ErrScanCursorNoTable = errors.New("scan cursor must has table") + var ErrStopped = errors.New("the node stopped") + var ErrUnexpectError = errors.New("unexpected error") + var InvalidScore int64 = -1 << 63 + var MAX_BATCH_NUM = 5000 + var MAX_SCAN_JOB = 10 + var MaxScore float64 = math.Inf(1) + var MinScore float64 = math.Inf(-1) + var SCAN_CURSOR_SEP = []byte(";") + var SCAN_NODE_SEP = []byte(":") + var VerBinary = "unset" + func APIRequest(method string, endpoint string, body io.Reader, timeout time.Duration, ...) (int, error) + func Decorate(f APIHandler, ds ...Decorator) httprouter.Handle + func DeepCopyCmd(cmd redcon.Command) redcon.Command + func ExtractNamesapce(rawKey []byte) (string, []byte, error) + func ExtractTable(rawKey []byte) ([]byte, []byte, error) + func GetIPv4ForInterfaceName(ifname string) string + func GetNamespaceAndPartition(fullNamespace string) (string, int) + func GetNsDesp(ns string, part int) string + func IsFullScanCommand(cmd string) bool + func IsInternalTableName(tb string) bool + func IsMergeCommand(cmd string) bool + func IsMergeIndexSearchCommand(cmd string) bool + func IsMergeKeysCommand(cmd string) bool + func IsMergeScanCommand(cmd string) bool + func IsValidNamespaceName(ns string) bool + func IsValidTableName(tb []byte) bool + func NewDeadlineTransport(timeout time.Duration) *http.Transport + func NewDefaultLogger(module string) *defaultLogger + func RespondV1(w http.ResponseWriter, code int, data interface{}) + func RunFileSync(remote string, srcPath string, dstPath string, stopCh chan struct{}) error + func VerString(app string) string + type APIHandler func(http.ResponseWriter, *http.Request, httprouter.Params) (interface{}, error) + func PlainText(f APIHandler) APIHandler + func V1(f APIHandler) APIHandler + type CmdRouter struct + func NewCmdRouter() *CmdRouter + func (r *CmdRouter) GetCmdHandler(name string) (CommandFunc, bool, bool) + func (r *CmdRouter) GetMergeCmdHandler(name string) (MergeCommandFunc, bool, bool) + func (r *CmdRouter) Register(isWrite bool, name string, f CommandFunc) bool + func (r *CmdRouter) RegisterMerge(name string, f MergeCommandFunc) bool + func (r *CmdRouter) RegisterWriteMerge(name string, f MergeCommandFunc) bool + type CommandFunc func(redcon.Conn, redcon.Command) + type CommandRspFunc func(redcon.Conn, redcon.Command, interface{}) + type DataType byte + const ALL + const HASH + const KV + const LIST + const NONE + const SET + const ZSET + func (d DataType) String() string + type Decorator func(APIHandler) APIHandler + func HttpLog(log *LevelLogger, level int32) Decorator + type ExpirationPolicy byte + const ConsistencyDeletion + const LocalDeletion + const PeriodicalRotation + const UnknownPolicy + func StringToExpirationPolicy(s string) (ExpirationPolicy, error) + type ExpiredDataBuffer interface + Write func(DataType, []byte) error + type FieldPair struct + Field []byte + Value []byte + type FullScanResult struct + Error error + NextCursor []byte + PartionId string + Results []interface{} + Type DataType + type GLogger struct + func (gl *GLogger) Output(maxdepth int, s string) error + func (gl *GLogger) OutputErr(maxdepth int, s string) error + func (gl *GLogger) OutputWarning(maxdepth int, s string) error + type HIndexRespWithValues struct + HsetValues [][]byte + IndexV interface{} + PKey []byte + type HsetIndexSchema struct + IndexField string + Name string + PrefixLen int32 + State IndexState + Unique int32 + ValueType IndexPropertyDType + func (s *HsetIndexSchema) IsValidNewSchema() bool + type HttpErr struct + Code int + Text string + func (e HttpErr) Error() string + type IClusterInfo interface + GetClusterName func() string + GetSnapshotSyncInfo func(fullNS string) ([]SnapshotSyncInfo, error) + UpdateMeForNamespaceLeader func(fullNS string) (bool, error) + type IndexPropertyDType int32 + const Int32V + const Int64V + const MaxVT + const StringV + type IndexSchema struct + HsetIndexes []*HsetIndexSchema + JSONIndexes []*JSONIndexSchema + type IndexState int32 + const BuildDoneIndex + const BuildingIndex + const DeletedIndex + const InitIndex + const MaxIndexState + const ReadyIndex + type InternalCommandFunc func(redcon.Command, int64) (interface{}, error) + type JSONIndexSchema struct + State IndexState + type KFVals struct + PK []byte + Vals []KVRecordRet + type KVRecord struct + Key []byte + Value []byte + type KVRecordRet struct + Err error + Rec KVRecord + type KVals struct + PK []byte + Vals [][]byte + type LevelLogger struct + Logger Logger + func NewLevelLogger(level int32, l Logger) *LevelLogger + func (ll *LevelLogger) Debug(args ...interface{}) + func (ll *LevelLogger) DebugDepth(d int, l string) + func (ll *LevelLogger) Debugf(f string, args ...interface{}) + func (ll *LevelLogger) Error(args ...interface{}) + func (ll *LevelLogger) ErrorDepth(d int, l string) + func (ll *LevelLogger) Errorf(f string, args ...interface{}) + func (ll *LevelLogger) Fatal(args ...interface{}) + func (ll *LevelLogger) Fatalf(f string, args ...interface{}) + func (ll *LevelLogger) Info(args ...interface{}) + func (ll *LevelLogger) InfoDepth(d int, l string) + func (ll *LevelLogger) Infof(f string, args ...interface{}) + func (ll *LevelLogger) Level() int32 + func (ll *LevelLogger) Panic(args ...interface{}) + func (ll *LevelLogger) Panicf(f string, args ...interface{}) + func (ll *LevelLogger) SetLevel(l int32) + func (ll *LevelLogger) Warning(args ...interface{}) + func (ll *LevelLogger) Warningf(f string, args ...interface{}) + type LogSyncStats struct + Index uint64 + IsLeader bool + Name string + Term uint64 + type Logger interface + Output func(maxdepth int, s string) error + OutputErr func(maxdepth int, s string) error + OutputWarning func(maxdepth int, s string) error + type MemberInfo struct + GroupID uint64 + GroupName string + ID uint64 + NodeID uint64 + RaftURLs []string + func (self *MemberInfo) IsEqual(other *MemberInfo) bool + type MergeCommandFunc func(redcon.Command) (interface{}, error) + type MergeLogger struct + func NewMergeLogger(logger *LevelLogger) *MergeLogger + func (l *MergeLogger) MergeError(entries ...interface{}) + func (l *MergeLogger) MergeErrorf(format string, args ...interface{}) + func (l *MergeLogger) MergeInfo(entries ...interface{}) + func (l *MergeLogger) MergeInfof(format string, args ...interface{}) + func (l *MergeLogger) MergeWarning(entries ...interface{}) + func (l *MergeLogger) MergeWarningf(format string, args ...interface{}) + type MergeWriteCommandFunc func(redcon.Command, interface{}) (interface{}, error) + type NamespaceStats struct + ClusterWriteStats *WriteStats + DBWriteStats *WriteStats + EngType string + InternalStats map[string]interface{} + IsLeader bool + Name string + TStats []TableStats + type SMCmdRouter struct + func NewSMCmdRouter() *SMCmdRouter + func (r *SMCmdRouter) GetInternalCmdHandler(name string) (InternalCommandFunc, bool) + func (r *SMCmdRouter) RegisterInternal(name string, f InternalCommandFunc) bool + type ScanResult struct + Error error + Keys [][]byte + NextCursor []byte + PartionId string + type ScanStats struct + ScanCount uint64 + ScanLatencyStats [16]int64 + func (ss *ScanStats) Copy() *ScanStats + func (ss *ScanStats) IncScanCount() + func (ss *ScanStats) UpdateLatencyStats(latencyUs int64) + func (ss *ScanStats) UpdateScanStats(latencyUs int64) + type ScorePair struct + Member []byte + Score float64 + type SearchResultHeap []*HIndexRespWithValues + func (sh *SearchResultHeap) Pop() interface{} + func (sh *SearchResultHeap) Push(x interface{}) + func (sh SearchResultHeap) Len() int + func (sh SearchResultHeap) Less(i, j int) bool + func (sh SearchResultHeap) Swap(i, j int) + type ServerStats struct + NSStats []NamespaceStats + ScanStats *ScanStats + type SnapshotSyncInfo struct + DataRoot string + HttpAPIPort string + NodeID uint64 + RemoteAddr string + ReplicaID uint64 + RsyncModule string + type StoppableListener struct + func NewStoppableListener(addr string, stopc <-chan struct{}) (*StoppableListener, error) + func (ln StoppableListener) Accept() (c net.Conn, err error) + type StringArray []string + func (a *StringArray) Set(s string) error + func (a *StringArray) String() string + type TableStats struct + KeyNum int64 + Name string + type WriteCmd struct + Args [][]byte + Operation string + type WriteStats struct + ValueSizeStats [16]int64 + WriteLatencyStats [16]int64 + func (ws *WriteStats) BatchUpdateLatencyStats(latencyUs int64, cnt int64) + func (ws *WriteStats) Copy() *WriteStats + func (ws *WriteStats) UpdateLatencyStats(latencyUs int64) + func (ws *WriteStats) UpdateSizeStats(vSize int64) + func (ws *WriteStats) UpdateWriteStats(vSize int64, latencyUs int64)