12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package timemachine
- import (
- "time"
- "go-common/app/interface/main/activity/conf"
- "go-common/library/cache/memcache"
- "go-common/library/sync/pipeline/fanout"
- "go-common/library/database/hbase.v2"
- )
- type Dao struct {
- c *conf.Config
- hbase *hbase.Client
- mc *memcache.Pool
- cache *fanout.Fanout
-
- mcTmExpire int32
-
-
- }
- func New(c *conf.Config) (d *Dao) {
- d = &Dao{
- c: c,
- hbase: hbase.NewClient(c.Hbase),
- mc: memcache.NewPool(c.TimeMc.Timemachine),
- cache: fanout.New("timemachine", fanout.Worker(8), fanout.Buffer(10240)),
- }
- d.mcTmExpire = int32(time.Duration(c.TimeMc.TmExpire) / time.Second)
-
-
- return d
- }
|