Documentation ¶
Index ¶
- Constants
- func GetBalancerStatusByUrl(csUrl string) (bool, error)
- func GetColShardType(session *mgo.Session, namespace string) ([]string, string, error)
- func GetDDLNamespace(log *oplog.PartialLog) string
- func IsSharding(session *mgo.Session) bool
- func TestSharding(t *testing.T)
- type ChunkRange
- type DBChunkMap
- type ShardCollection
- type ShardCollectionSpec
- type ShardingChunkMap
Constants ¶
View Source
const ( ConfigDB = "config" SettingsCol = "settings" ShardCol = "shards" ChunkCol = "chunks" CollectionCol = "collections" HashedShard = "hashed" RangedShard = "ranged" ConfigShardLogInterval = 3 // s )
Variables ¶
This section is empty.
Functions ¶
func GetBalancerStatusByUrl ¶
get balancer status from config server
func GetColShardType ¶
input given namespace, return all keys and shard type(range or hashed)
func GetDDLNamespace ¶
func GetDDLNamespace(log *oplog.PartialLog) string
func IsSharding ¶
func TestSharding ¶
Types ¶
type ChunkRange ¶
type ChunkRange struct { // the minimum/maximum of the chunk range of multiple columns shard key has multiple values Mins []interface{} Maxs []interface{} }
type DBChunkMap ¶
type DBChunkMap map[string]*ShardCollection
type ShardCollection ¶
type ShardCollection struct { Chunks []*ChunkRange // shard key may have multiple columns, for example {a:1, b:1, c:1} Keys []string ShardType string }
type ShardCollectionSpec ¶
func GetShardCollectionSpec ¶
func GetShardCollectionSpec(session *mgo.Session, log *oplog.PartialLog) *ShardCollectionSpec
type ShardingChunkMap ¶
type ShardingChunkMap map[string]map[string]*ShardCollection
{replset: {namespace: []ChunkRange} }
func GetChunkMapByUrl ¶
func GetChunkMapByUrl(csUrl string) (ShardingChunkMap, error)
Click to show internal directories.
Click to hide internal directories.