Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPlacement = defaultPlacement{}
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
TenantID string
DatasetName string
Tenant uint64
Dataset uint64
Fingerprint uint64
}
Key represents the distribution key.
type Placement ¶
type Placement struct {
// Note that the instances reference shared objects, and must not be modified.
Instances []*ring.InstanceDesc
Shard uint32
// contains filtered or unexported fields
}
Placement represents the placement for the given distribution key.
type Strategy ¶
type Strategy interface {
// NumTenantShards returns the number of shards
// for a tenant from n total.
NumTenantShards(k Key, n uint32) (size uint32)
// NumDatasetShards returns the number of shards
// for a dataset from n total.
NumDatasetShards(k Key, n uint32) (size uint32)
// PickShard returns the shard index
// for a given key from n total.
PickShard(k Key, n uint32) (shard uint32)
}
Click to show internal directories.
Click to hide internal directories.