// NewETCDBindingStorage returns a new instance of BindingStorage
503103
func NewETCDBindingStorage(server *cluster.Server, conf *config.Config) *ETCDBindingStorage {
	b := &ETCDBindingStorage{
		config:     conf,
		thisServer: server,
		stopChan:   make(chan struct{}),
	}
	b.configure()
	return b
}
944523
func newStorageIdValue(ctx Context, result *names.StorageTag) (*storageIdValue, error) {
	v := &storageIdValue{result: result, ctx: ctx}
	if s, err := ctx.HookStorage(); err == nil {
		*v.result = s.Tag()
	} else if !errors.IsNotFound(err) {
		return nil, errors.Trace(err)
	}
	return v, nil
}
332275
func (b *storageDBWrapper) blobStorage(blobDB string) blobstore.ManagedStorage {
	dataStore := blobstore.NewGridFS(blobDB, blobDB, b.session)
	return blobstore.NewManagedStorage(b.db, dataStore)
}
1198215
func NewBindHandle(ctx sessionctx.Context) *BindHandle {
	handle := &BindHandle{}
	handle.sctx.Context = ctx
	handle.bindInfo.Value.Store(make(cache, 32))
	handle.bindInfo.parser = parser.New()
	handle.invalidBindRecordMap.Value.Store(make(map[string]*invalidBindRecordMap))
	return handle
}
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
}
589552
func (s *IdentityUsage) SetDataStorage(v int64) *IdentityUsage {
	s.DataStorage = &v
	return s
}
129631
func (s *DBClusterSnapshot) SetStorageEncrypted(v bool) *DBClusterSnapshot {
	s.StorageEncrypted = &v
	return s
}
128189
func (rpc *EthRPC) EthGetStorageAt(data string, position int, tag string) (string, error) {
	var result string

	err := rpc.call("eth_getStorageAt", &result, data, IntToHex(position), tag)
	return result, err
}
1209828
func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool) {
	apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(nodeinternal.GroupName, legacyscheme.Scheme, legacyscheme.ParameterCodec, legacyscheme.Codecs)

	if apiResourceConfigSource.VersionEnabled(nodev1alpha1.SchemeGroupVersion) {
		apiGroupInfo.VersionedResourcesStorageMap[nodev1alpha1.SchemeGroupVersion.Version] = p.v1alpha1Storage(apiResourceConfigSource, restOptionsGetter)
	}

	if apiResourceConfigSource.VersionEnabled(nodev1beta1.SchemeGroupVersion) {
		apiGroupInfo.VersionedResourcesStorageMap[nodev1beta1.SchemeGroupVersion.Version] = p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
	}

	return apiGroupInfo, true
}
899350
func NewLayeredStorage(s ...Storage) (Storage, error) {
	if len(s) <= 1 {
		return nil, errors.Errorf("expected multiple stores")
	}
	return layeredStorage(s), nil
}
166174
func (a *HostAgent) addStorageTenant(tenantID string) {
	for _, tid := range a.storageTenants {
		if tid == tenantID {
			return
		}
	}
	a.storageTenants = append(a.storageTenants, tenantID)
}
355645
func NewLocalMapStorage(
	name string,
	KeyStringFunc ToStringFunc,
	ItemToKeyStringFunc ToStringFunc) Storage {

	_, storage := newLocalMapStorage(name, KeyStringFunc, ItemToKeyStringFunc)
	return storage
}
7300
func NewStorageProviderRegistry(reg storage.ProviderRegistry) storage.ProviderRegistry {
	return storage.ChainedProviderRegistry{reg, provider.CommonStorageProviders()}
}
1241823
func (document *XmlDocument) CreateCDataNode(data string) (cdata *CDataNode) {
	dataLen := len(data)
	dataBytes := GetCString([]byte(data))
	dataPtr := unsafe.Pointer(&dataBytes[0])
	nodePtr := C.xmlNewCDataBlock(document.Ptr, (*C.xmlChar)(dataPtr), C.int(dataLen))
	if nodePtr != nil {
		cdata = NewNode(unsafe.Pointer(nodePtr), document).(*CDataNode)
	}
	return
}
1089842
func NewAdapter(storeageAdapterType string) (Adapter, error) {
	if storeageAdapterType == "" || storeageAdapterType == "file" {
		adapter, err := file.NewStorageAdapter(LogRoot)
		if err != nil {
			return nil, err
		}
		return adapter, nil
	}
	match := memoryAdapterRegex.FindStringSubmatch(storeageAdapterType)
	if match == nil {
		return nil, fmt.Errorf("Unrecognized storage adapter type: '%s'", storeageAdapterType)
	}
	sizeStr := match[1]
	if sizeStr == "" {
		sizeStr = "1000"
	}
	size, err := strconv.Atoi(sizeStr)
	if err != nil {
		return nil, err
	}
	adapter, err := ringbuffer.NewStorageAdapter(size)
	if err != nil {
		return nil, err
	}
	return adapter, nil
}
1127925
func (b *ETCDBindingStorage) PutBinding(uid string) error {
	_, err := b.cli.Put(context.Background(), getUserBindingKey(uid, b.thisServer.Type), b.thisServer.ID, clientv3.WithLease(b.leaseID))
	return err
}
1055724
func NewSetDOMStorageItemArgs(storageID StorageID, key string, value string) *SetDOMStorageItemArgs {
	args := new(SetDOMStorageItemArgs)
	args.StorageID = storageID
	args.Key = key
	args.Value = value
	return args
}