Documentation ¶
Overview ¶
package main
Index ¶
- Constants
- Variables
- func GetArchiveDay() string
- func MetaIdHdfsFilePart(gzMetaId string) string
- func NewPool(server string, password string, IdleTimeout time.Duration, ...) *redis.Pool
- func ParseDocRow(data []byte, rowIndex uint32) []byte
- func SliceItemToInterface(src DocItemList) []interface{}
- func SymcGet(symcurl string, keys map[string]string) (map[string]string, error)
- type AddrMemcachePool
- type BusinessTrait
- type DocDataResult
- type DocDataResultList
- type DocGzClient
- type DocIdList
- type DocItemList
- type HDFSReader
- type IndexDataResult
- type InvertedIndexGzClient
- type MemcachePool
- type Pool
- type TestTrait
- func (self *TestTrait) BusinessName() string
- func (self *TestTrait) DocFilePath(day string, name string) string
- func (self *TestTrait) DocIdStoredKey(day string, docId uint64) string
- func (self *TestTrait) DocStoredAddr() string
- func (self *TestTrait) FieldShortName(field string) string
- func (self *TestTrait) IndexFilePath(day string, field string, token string) string
- func (self *TestTrait) IndexStoredAddr() string
- func (self *TestTrait) IndexStoredKey(day string, field string, token string) string
Constants ¶
View Source
const InvertedIndexGzCount = 200
View Source
const (
PROTOCOL = "tcp" //connection protocol
)
Variables ¶
View Source
var ( MaxIdle int = 100 MaxActive int = 1000 IdleTimeout time.Duration = time.Duration(28 * time.Second) )
View Source
var RedisPool *redis.Pool
View Source
var Rp = &Pool{}
View Source
var SimgoFramework *simgo.Framework
View Source
var ToEscapeFields = map[string]int{
"fname": 1,
}
Functions ¶
func MetaIdHdfsFilePart ¶
func NewPool ¶
func NewPool(server string, password string, IdleTimeout time.Duration, MaxIdle, MaxActive int) *redis.Pool
*
- Redis Pool *
- server serverAddress 127.0.0.1:6379
- password password 127.0.0.1:6379:password
- IdleTimeout 超时
- MaxIdle 连接池最大容量
- MaxActive 最大活跃数量
- dbno 选择db127.0.0.1:6379:password:1 *
func ParseDocRow ¶
func SliceItemToInterface ¶
func SliceItemToInterface(src DocItemList) []interface{}
Types ¶
type AddrMemcachePool ¶
func (*AddrMemcachePool) Get ¶
func (self *AddrMemcachePool) Get(addr string) *MemcachePool
func (*AddrMemcachePool) Init ¶
func (self *AddrMemcachePool) Init()
type BusinessTrait ¶
type BusinessTrait interface { BusinessName() string FieldShortName(field string) string IndexStoredAddr() string IndexStoredKey(day string, field string, token string) string IndexFilePath(day string, field string, token string) string DocStoredAddr() string DocIdStoredKey(day string, docId uint64) string DocFilePath(day string, name string) string }
func BusinessTraitInstance ¶
func BusinessTraitInstance(business string) BusinessTrait
type DocDataResult ¶
func NewDocDataResult ¶
func NewDocDataResult() *DocDataResult
func (*DocDataResult) FilterColumns ¶
func (self *DocDataResult) FilterColumns(seperator string, columns []int)
func (*DocDataResult) LogId ¶
func (self *DocDataResult) LogId() uint64
func (*DocDataResult) ToJson ¶
func (self *DocDataResult) ToJson(business string) string
type DocDataResultList ¶
type DocDataResultList []*DocDataResult
func (DocDataResultList) Len ¶
func (a DocDataResultList) Len() int
func (DocDataResultList) Less ¶
func (a DocDataResultList) Less(i, j int) bool
func (DocDataResultList) Swap ¶
func (a DocDataResultList) Swap(i, j int)
type DocGzClient ¶
type DocGzClient struct { }
func (*DocGzClient) DocIdIntersect ¶
func (self *DocGzClient) DocIdIntersect(tokenDocItems *[]DocItemList) DocItemList
func (*DocGzClient) FetchDocItems ¶
func (self *DocGzClient) FetchDocItems(day string, business string, docItems *DocItemList) (dataList DocDataResultList)
type DocItemList ¶
type DocItemList []poseidon_if.DocId
func SliceInterfaceToItem ¶
func SliceInterfaceToItem(src []interface{}) DocItemList
func (DocItemList) Len ¶
func (a DocItemList) Len() int
func (DocItemList) Less ¶
func (a DocItemList) Less(i, j int) bool
func (DocItemList) Swap ¶
func (a DocItemList) Swap(i, j int)
type IndexDataResult ¶
type IndexDataResult struct { Token string Pv, Uv int DocItems DocItemList Err error }
type InvertedIndexGzClient ¶
type InvertedIndexGzClient struct{}
func (*InvertedIndexGzClient) FetchIndex ¶
func (self *InvertedIndexGzClient) FetchIndex(day string, business string, keywords map[string]string) (indexDataList []*IndexDataResult)
type MemcachePool ¶
func NewPoolInstance ¶
func NewPoolInstance(addr string, limit int) *MemcachePool
type TestTrait ¶
type TestTrait struct {
// contains filtered or unexported fields
}
func (*TestTrait) BusinessName ¶
func (*TestTrait) DocIdStoredKey ¶
func (*TestTrait) DocStoredAddr ¶
func (*TestTrait) IndexFilePath ¶
func (*TestTrait) IndexStoredAddr ¶
Click to show internal directories.
Click to hide internal directories.