// DEPRECATED. NewMemStore is a compatible alias for redis.New
547511
func NewRedisStore(pool *redis.Pool, keyPrefix string, db int) *redigostore.RedigoStore {
	st, err := redigostore.New(pool, keyPrefix, db)
	if err != nil {
		// As of this writing, creating a Redis store never returns an error
		// so this should be safe while providing some ability to return errors
		// in the future.
		panic(err)
	}
	return st
}
1037285
func New(config Config) session.Store {
	return &redisStore{
		client: config.Client,
		prefix: config.Prefix,
	}
}
461751
func NewFilestore(bs blockstore.Blockstore, fm *FileManager) *Filestore {
	return &Filestore{fm, bs}
}
947518
func NewWithPrefix(pool *redis.Pool, prefix string) *RedisStore {
	return &RedisStore{
		pool:   pool,
		prefix: prefix,
	}
}
1216778
func NewInMemoryStore() *InMemoryStore {
	return &InMemoryStore{
		Filters:   make(map[string]string),
		NextBatch: make(map[string]string),
		Rooms:     make(map[string]*Room),
	}
}
560469
func NewInMemoryKeyStore() bccsp.KeyStore {
	eks := &inmemoryKeyStore{}
	eks.keys = make(map[string]bccsp.Key)
	return eks
}
695669
func NewEDStore(encryptionCipher string, encryptionKey []byte, idx uint64) (*EDStore, error) {
	code, keyHash, err := createMasterKeyHash(encryptionCipher, encryptionKey)
	if err != nil {
		return nil, err
	}
	s, err := newEDStore(code, keyHash, idx)
	if err != nil {
		return nil, err
	}
	// On success, erase the key
	for i := 0; i < len(encryptionKey); i++ {
		encryptionKey[i] = 'x'
	}
	return s, nil
}
1145747
func NewMysqlStore(c *sql.DB, sid string, kv map[interface{}]interface{}) *MysqlStore {
	return &MysqlStore{
		c:    c,
		sid:  sid,
		data: kv,
	}
}
589402
func NewEventStore() *EventStore {
	s := &EventStore{
		db: map[string]map[uuid.UUID]aggregateRecord{},
	}
	return s
}
1351978
func NewNodeStore(addr common.Address, store GlobalStorer) *NodeStore {
	return &NodeStore{
		store: store,
		addr:  addr,
	}
}
26875
func newDeadStoreManager(err error) *storeManager {
	var m storeManager
	m.tomb.Kill(errors.Trace(err))
	return &m
}
948256
func New(options LockStoreOptions) LockStore {
	testTryLockCallback := options.testTryLockCallback
	if testTryLockCallback == nil {
		testTryLockCallback = func() {}
	}

	lock := _LockStoreImp{
		granularity:         options.Granularity,
		testTryLockCallback: testTryLockCallback,
	}

	switch options.Granularity {
	case PerKeyGranularity:
		lock.perKeyLocks = make(map[string]*_LockImp)
	case ShardedGranularity:
		lock.shardedLocks = make([]*sync.RWMutex, options.LockCount)
		for i := range lock.shardedLocks {
			lock.shardedLocks[i] = &sync.RWMutex{}
		}
	}

	return &lock
}
903373
func NewMemcacheStore(c *memcache.Client, sid string, expire int32, kv map[interface{}]interface{}) *MemcacheStore {
	return &MemcacheStore{
		c:      c,
		sid:    sid,
		expire: expire,
		data:   kv,
	}
}
500971
func NewRedisQueueStore(client *redis.Client, prefix string) *RedisQueueStore {
	if !strings.HasSuffix(prefix, ":") {
		prefix += ":"
	}
	return &RedisQueueStore{
		RedisStore: NewRedisStore(client, prefix),
	}
}
1121921
func NewDataStore(scope string, cfg *ScopeCfg) (DataStore, error) {
	if cfg == nil || cfg.Client.Provider == "" || cfg.Client.Address == "" {
		c, ok := defaultScopes[scope]
		if !ok || c.Client.Provider == "" || c.Client.Address == "" {
			return nil, fmt.Errorf("unexpected scope %s without configuration passed", scope)
		}

		cfg = c
	}

	var cached bool
	if scope == LocalScope {
		cached = true
	}

	return newClient(scope, cfg.Client.Provider, cfg.Client.Address, cfg.Client.Config, cached)
}
10620
func NewCodeStore(idStore *IDStore, options CodeStoreOptions) (*CodeStore, error) {
	return newCodeStore(idStore, options)
}
890842
func NewMemoryStore(seed map[data.RoleName][]byte) *MemoryStore {
	var (
		consistent = make(map[string][]byte)
		initial    = make(map[string][]byte)
	)
	// add all seed meta to consistent
	for name, d := range seed {
		checksum := sha256.Sum256(d)
		path := utils.ConsistentName(name.String(), checksum[:])
		initial[name.String()] = d
		consistent[path] = d
	}

	return &MemoryStore{
		data:       initial,
		consistent: consistent,
	}
}