Documentation ¶
Overview ¶
Author: Aosen QQ: 316052486 Data: 2016-01-14 Desc: 基于mysql的pipline实现, 本实例仅供参考,还需根据实际开发需求进行改装
Index ¶
- Constants
- Variables
- func OpenOrCreateKv(path string, options *kv.Options) (*kv.DB, error)
- type KVPipline
- func (self *KVPipline) Close(shard int)
- func (self *KVPipline) Conn(shard int)
- func (self *KVPipline) Delete(shard int, key []byte)
- func (self *KVPipline) GetStorageShards() int
- func (self *KVPipline) Init()
- func (self *KVPipline) Recover(shard int, ...) error
- func (self *KVPipline) Set(shard int, key, value []byte)
- type MongoPipline
- func (self *MongoPipline) Close(shard int)
- func (self *MongoPipline) Conn(shard int)
- func (self *MongoPipline) Delete(shard int, key []byte)
- func (self *MongoPipline) GetStorageShards() int
- func (self *MongoPipline) Init()
- func (self *MongoPipline) Recover(shard int, ...) error
- func (self *MongoPipline) Set(shard int, key, value []byte)
- type MysqlPipline
- func (self *MysqlPipline) Close(shard int)
- func (self *MysqlPipline) Conn(shard int)
- func (self *MysqlPipline) Delete(shard int, key []byte)
- func (self *MysqlPipline) GetStorageShards() int
- func (self *MysqlPipline) Init()
- func (self *MysqlPipline) Recover(shard int, ...) error
- func (self *MysqlPipline) Set(shard int, key, value []byte)
Constants ¶
View Source
const ( PersistentStorageFilePrefix = "db" StorageFolder = "data" )
Variables ¶
View Source
var CreateTable string = `` /* 126-byte string literal not displayed */
Functions ¶
Types ¶
type KVPipline ¶
type KVPipline struct {
// contains filtered or unexported fields
}
func (*KVPipline) GetStorageShards ¶
type MongoPipline ¶
type MongoPipline struct {
// contains filtered or unexported fields
}
func InitMongo ¶
func InitMongo(db string, shardnum int, url string, collectionPrefix string) *MongoPipline
func (*MongoPipline) Delete ¶
func (self *MongoPipline) Delete(shard int, key []byte)
func (*MongoPipline) GetStorageShards ¶
func (self *MongoPipline) GetStorageShards() int
func (*MongoPipline) Init ¶
func (self *MongoPipline) Init()
func (*MongoPipline) Recover ¶
func (self *MongoPipline) Recover(shard int, internalIndexDocument func(docId uint64, data search.DocumentIndexData)) error
func (*MongoPipline) Set ¶
func (self *MongoPipline) Set(shard int, key, value []byte)
将key-value存储到哪个集合中
type MysqlPipline ¶
type MysqlPipline struct {
// contains filtered or unexported fields
}
func (*MysqlPipline) GetStorageShards ¶
func (self *MysqlPipline) GetStorageShards() int
func (*MysqlPipline) Recover ¶
func (self *MysqlPipline) Recover(shard int, internalIndexDocument func(docId uint64, data search.DocumentIndexData)) error
数据恢复
Click to show internal directories.
Click to hide internal directories.