Documentation ¶
Overview ¶
Cassandra backend for GroupIDX. For expiring entries, Cassandra's automatic expiration feature ('USING TTL xxx' in CQL) is used, so it's super efficient.
Index ¶
- Constants
- Variables
- func Initialize(session *gocql.Session)
- func InitializeN2Layer(session *gocql.Session)
- func MaintainanceCtrTable(session *gocql.Session)
- type Granularity
- type N2LayerGroupDB
- func (g *N2LayerGroupDB) ArticleGroupList(group []byte, first, last int64, targ func(int64))
- func (g *N2LayerGroupDB) ArticleGroupMove(group []byte, i int64, backward bool, id_buf []byte) (ni int64, id []byte, ok bool)
- func (g *N2LayerGroupDB) ArticleGroupStat(group []byte, num int64, id_buf []byte) ([]byte, bool)
- func (g *N2LayerGroupDB) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error
- func (g *N2LayerGroupDB) AssignArticleToGroups(groups [][]byte, nums []int64, exp uint64, id []byte) (err error)
- func (N2LayerGroupDB) GroupHeadInsert(groups [][]byte, buf []int64) ([]int64, error)
- func (N2LayerGroupDB) GroupHeadRevert(groups [][]byte, nums []int64) error
- func (g *N2LayerGroupDB) GroupRealtimeQuery(group []byte) (number int64, low int64, high int64, ok bool)
- func (g *N2LayerGroupDB) ListArticleGroupRaw(group []byte, first, last int64, targ func(int64, []byte))
- func (g *N2LayerGroupDB) Validate()
- type SimpleGroupDB
- func (g *SimpleGroupDB) ArticleGroupList(group []byte, first, last int64, targ func(int64))
- func (g *SimpleGroupDB) ArticleGroupMove(group []byte, i int64, backward bool, id_buf []byte) (ni int64, id []byte, ok bool)
- func (g *SimpleGroupDB) ArticleGroupStat(group []byte, num int64, id_buf []byte) ([]byte, bool)
- func (g *SimpleGroupDB) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error
- func (g *SimpleGroupDB) AssignArticleToGroups(groups [][]byte, nums []int64, exp uint64, id []byte) (err error)
- func (SimpleGroupDB) GroupHeadInsert(groups [][]byte, buf []int64) ([]int64, error)
- func (SimpleGroupDB) GroupHeadRevert(groups [][]byte, nums []int64) error
- func (g *SimpleGroupDB) GroupRealtimeQuery(group []byte) (number int64, low int64, high int64, ok bool)
- func (g *SimpleGroupDB) ListArticleGroupRaw(group []byte, first, last int64, targ func(int64, []byte))
- func (g *SimpleGroupDB) Validate()
Constants ¶
const DAY = 60 * 60 * 24
24 Hours in seconds
Variables ¶
var ENoSuchGroup = errors.New("Missing Group")
var EUnimplemented = errors.New("EUnimplemented")
Functions ¶
func Initialize ¶
func InitializeN2Layer ¶
func MaintainanceCtrTable ¶
Maintainance routine for the Countertable 'agrpcnt'.
Types ¶
type Granularity ¶
type Granularity struct { // expiry alignment in seconds, defaults to 1 second. EPA uint64 // expiry round up. Round up if true, round down if false. EPRU bool // counter table alignment in seconds, defaults to 60*60*24 (24 hours) CTA uint64 // counter table round up. Round up if true, round down if false. // if CTA is 0, this flag is ignored and the counter-table value is rounded up. CTRU bool }
type N2LayerGroupDB ¶
type N2LayerGroupDB struct { Granularity Session *gocql.Session OnAssign gocql.Consistency OnIncrement gocql.Consistency // contains filtered or unexported fields }
A two-level Datastore that, instead of storing an entire Newsgroup in a partition divides it up into blocks of up to approx. 16 million entries. A seperate hash partition is created (in a seperate table) to keept track of those partitions, especially to allow ordered traversion of all partitions in the korrect order.
func (*N2LayerGroupDB) ArticleGroupList ¶
func (g *N2LayerGroupDB) ArticleGroupList(group []byte, first, last int64, targ func(int64))
Efficient traversal of a newsgroup.
func (*N2LayerGroupDB) ArticleGroupMove ¶
func (*N2LayerGroupDB) ArticleGroupStat ¶
func (*N2LayerGroupDB) AssignArticleToGroup ¶
func (g *N2LayerGroupDB) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error
func (*N2LayerGroupDB) AssignArticleToGroups ¶
func (N2LayerGroupDB) GroupHeadInsert ¶
EUnimplemented
func (N2LayerGroupDB) GroupHeadRevert ¶
EUnimplemented
func (*N2LayerGroupDB) GroupRealtimeQuery ¶
func (*N2LayerGroupDB) ListArticleGroupRaw ¶
func (g *N2LayerGroupDB) ListArticleGroupRaw(group []byte, first, last int64, targ func(int64, []byte))
func (*N2LayerGroupDB) Validate ¶
func (g *N2LayerGroupDB) Validate()
Validates the Object arguments such as OnIncrement.
Should be called before the object is being used, for reliability.
type SimpleGroupDB ¶
type SimpleGroupDB struct { Granularity Session *gocql.Session OnAssign gocql.Consistency OnIncrement gocql.Consistency // contains filtered or unexported fields }
A simple Datastore using one partition key per newsgroup. It has the advantage, that it is very simple, and thus has low overhead, and few moving parts. But it has the disadvantage, that huge newsgroup may cause a skew distribution across partitions.
func (*SimpleGroupDB) ArticleGroupList ¶
func (g *SimpleGroupDB) ArticleGroupList(group []byte, first, last int64, targ func(int64))
Efficient traversal of a newsgroup.
func (*SimpleGroupDB) ArticleGroupMove ¶
func (*SimpleGroupDB) ArticleGroupStat ¶
func (*SimpleGroupDB) AssignArticleToGroup ¶
func (g *SimpleGroupDB) AssignArticleToGroup(group []byte, num, exp uint64, id []byte) error
func (*SimpleGroupDB) AssignArticleToGroups ¶
func (SimpleGroupDB) GroupHeadInsert ¶
EUnimplemented
func (SimpleGroupDB) GroupHeadRevert ¶
EUnimplemented
func (*SimpleGroupDB) GroupRealtimeQuery ¶
func (*SimpleGroupDB) ListArticleGroupRaw ¶
func (g *SimpleGroupDB) ListArticleGroupRaw(group []byte, first, last int64, targ func(int64, []byte))
func (*SimpleGroupDB) Validate ¶
func (g *SimpleGroupDB) Validate()
Validates the Object arguments such as OnIncrement.
Should be called before the object is being used, for reliability.