Given a store name and a list of store definitions, returns the
appropriate store definition ( if it exists )

@param storeDefs List of store definitions
@param storeName The store name whose store definition is required
@return The store definition
494366
public static StoreDefinition getStoreDefinitionWithName(List<StoreDefinition> storeDefs,
                                                             String storeName) {
        StoreDefinition def = null;
        for(StoreDefinition storeDef: storeDefs) {
            if(storeDef.getName().compareTo(storeName) == 0) {
                def = storeDef;
                break;
            }
        }

        if(def == null) {
            throw new VoldemortException("Could not find store " + storeName);
        }
        return def;
    }
224063
public String getSpaces(String storeID) throws ResourceException {

        Element spacesElem = new Element("spaces");

        try {
            StorageProvider storage =
                storageProviderFactory.getStorageProvider(storeID);

            Iterator<String> spaces = storage.getSpaces();
            while (spaces.hasNext()) {
                String spaceID = spaces.next();
                Element spaceElem = new Element("space");
                spaceElem.setAttribute("id", spaceID);
                spacesElem.addContent(spaceElem);
            }
        } catch (Exception e) {
            storageProviderFactory.expireStorageProvider(storeID);
            throw new ResourceException("Error attempting to build spaces XML",
                                        e);
        }

        Document doc = new Document(spacesElem);
        XMLOutputter xmlConverter = new XMLOutputter();
        return xmlConverter.outputString(doc);
    }
1249337
@Override
    public void deleteStoreIfPresent(String storeName) {
        DBConn dbConn = getDBConnection();
        try {
            synchronized (m_schemaLock) {
                if (m_schemaMgr.columnFamilyExists(dbConn, m_keyspace, storeName)) {
                    m_schemaMgr.deleteColumnFamily(dbConn, storeName);
                }
            }
        } finally {
            returnDBConnection(dbConn);
        }
    }
817964
@NotNull
    public static String getSku(@NotNull final String appStoreName, @NotNull String storeSku) {
        return SkuManager.getInstance().getSku(appStoreName, storeSku);
    }
406093
public function get_stores_for_definition(cache_definition $definition) {
        // Check if MUC has been disabled.
        $factory = cache_factory::instance();
        if ($factory->stores_disabled()) {
            // Yip its been disabled.
            // To facilitate this we are going to always return an empty array of stores to use.
            // This will force all cache instances to use the cachestore_dummy.
            // MUC will still be used essentially so that code using it will still continue to function but because no cache stores
            // are being used interaction with MUC will be purely based around a static var.
            return array();
        }

        $availablestores = $this->get_stores($definition->get_mode(), $definition->get_requirements_bin());
        $stores = array();
        $id = $definition->get_id();

        // Now get any mappings and give them priority.
        foreach ($this->configdefinitionmappings as $mapping) {
            if ($mapping['definition'] !== $id) {
                continue;
            }
            $storename = $mapping['store'];
            if (!array_key_exists($storename, $availablestores)) {
                continue;
            }
            if (array_key_exists($storename, $stores)) {
                $store = $stores[$storename];
                unset($stores[$storename]);
                $stores[$storename] = $store;
            } else {
                $stores[$storename] = $availablestores[$storename];
            }
        }

        if (empty($stores) && !$definition->is_for_mappings_only()) {
            $mode = $definition->get_mode();
            // Load the default stores.
            foreach ($this->configmodemappings as $mapping) {
                if ($mapping['mode'] === $mode && array_key_exists($mapping['store'], $availablestores)) {
                    $store = $availablestores[$mapping['store']];
                    if (empty($store['mappingsonly'])) {
                        $stores[$mapping['store']] = $store;
                    }
                }
            }
        }

        return $stores;
    }
364463
public StoreSchema getStore(final String name) {
    for (StoreSchema store : storeSchemas)
      if (store.getName().equals(name))
        return store;
    return null;
  }
899061
private ApplicationDefinition getApplicationDefinition(Tenant tenant, String appName) {
        Iterator<DColumn> colIter =
            DBService.instance(tenant).getAllColumns(SchemaService.APPS_STORE_NAME, appName).iterator();
        if (!colIter.hasNext()) {
            return null;
        }
        return loadAppRow(tenant, getColumnMap(colIter));
    }
499709
private <T extends NamedDescriptor> T getOrCreateNamedDescriptor(Class<T> type, String name, Map<String, T> descriptors, Store store) {
        T descriptor = descriptors.get(name);
        if (descriptor == null) {
            descriptor = store.create(type);
            descriptor.setName(name);
            descriptors.put(name, descriptor);
        }
        return descriptor;
    }
1196825
def get_stores():
    '''
    
    '''
    ret = dict()
    cmd = r"Get-ChildItem -Path 'Cert:\' | " \
          r"Select-Object LocationName, StoreNames"

    items = _cmd_run(cmd=cmd, as_json=True)

    for item in items:
        ret[item['LocationName']] = list()

        for store in item['StoreNames']:
            ret[item['LocationName']].append(store)
    return ret
642375
private Map<String, TenantDefinition> getAllTenantDefs() {
        Map<String, TenantDefinition> tenantMap = new HashMap<>();
        Iterable<DRow> rowIter = DBService.instance().getAllRows(TENANTS_STORE_NAME);
        for (DRow row : rowIter) {
            TenantDefinition tenantDef = loadTenantDefinition(row);
            if (tenantDef != null) {
                tenantMap.put(tenantDef.getName(), tenantDef);
            }
        }
        return tenantMap;
    }
256886
def get_store(self, fully_qualified_name: str) -> Optional['Store']:
        

        if fully_qualified_name not in self._store_cache:
            schema = self.get_schema_object(fully_qualified_name)
            if not schema:
                return None

            if Type.is_store_type(schema.type):
                self._store_cache[fully_qualified_name] = TypeLoader.load_item(schema.type)(schema)
            else:
                self.add_errors(
                    InvalidTypeError(fully_qualified_name, {}, ATTRIBUTE_TYPE,
                                     InvalidTypeError.Reason.INCORRECT_BASE, schema.type,
                                     InvalidTypeError.BaseTypes.STORE))

        return self._store_cache.get(fully_qualified_name, None)
372579
public static List<String> getAllUserStoreNamesOnNode(AdminClient adminClient, Integer nodeId) {
        List<String> storeNames = Lists.newArrayList();
        List<StoreDefinition> storeDefinitionList = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeId)
                                                                               .getValue();

        for(StoreDefinition storeDefinition: storeDefinitionList) {
            storeNames.add(storeDefinition.getName());
        }
        return storeNames;
    }
755933
@NotNull
    public String getSku(@NotNull String appstoreName, @NotNull String storeSku) {
        checkSkuMappingParams(appstoreName, storeSku);

        Map<String, String> skuMap = storeSku2skuMappings.get(appstoreName);
        if (skuMap != null && skuMap.containsKey(storeSku)) {
            final String s = skuMap.get(storeSku);
            Logger.d("getSku() restore sku from storeSku: ", storeSku, " -> ", s);
            return s;
        }
        return storeSku;
    }
29107
public static HashMap<StoreDefinition, Integer> getUniqueStoreDefinitionsWithCounts(List<StoreDefinition> storeDefs) {

        HashMap<StoreDefinition, Integer> uniqueStoreDefs = Maps.newHashMap();
        for(StoreDefinition storeDef: storeDefs) {
            if(uniqueStoreDefs.isEmpty()) {
                uniqueStoreDefs.put(storeDef, 1);
            } else {
                StoreDefinition sameStore = null;

                // Go over all the other stores to find if this is unique
                for(StoreDefinition uniqueStoreDef: uniqueStoreDefs.keySet()) {
                    if(uniqueStoreDef.getReplicationFactor() == storeDef.getReplicationFactor()
                       && uniqueStoreDef.getRoutingStrategyType()
                                        .compareTo(storeDef.getRoutingStrategyType()) == 0) {

                        // Further check for the zone routing case
                        if(uniqueStoreDef.getRoutingStrategyType()
                                         .compareTo(RoutingStrategyType.ZONE_STRATEGY) == 0) {
                            boolean zonesSame = true;
                            for(int zoneId: uniqueStoreDef.getZoneReplicationFactor().keySet()) {
                                if(storeDef.getZoneReplicationFactor().get(zoneId) == null
                                   || storeDef.getZoneReplicationFactor().get(zoneId) != uniqueStoreDef.getZoneReplicationFactor()
                                                                                                       .get(zoneId)) {
                                    zonesSame = false;
                                    break;
                                }
                            }
                            if(zonesSame) {
                                sameStore = uniqueStoreDef;
                            }
                        } else {
                            sameStore = uniqueStoreDef;
                        }

                        if(sameStore != null) {
                            // Bump up the count
                            int currentCount = uniqueStoreDefs.get(sameStore);
                            uniqueStoreDefs.put(sameStore, currentCount + 1);
                            break;
                        }
                    }
                }

                if(sameStore == null) {
                    // New store
                    uniqueStoreDefs.put(storeDef, 1);
                }
            }
        }

        return uniqueStoreDefs;
    }
977755
public CompletableFuture<String> getScope(final String scopeName) {
        Preconditions.checkNotNull(scopeName);
        return streamStore.getScopeConfiguration(scopeName);
    }
1264719
public static Map<String, StoreDefinition> getSystemStoreDefMap() {
        Map<String, StoreDefinition> sysStoreDefMap = Maps.newHashMap();
        List<StoreDefinition> storesDefs = SystemStoreConstants.getAllSystemStoreDefs();
        for(StoreDefinition def: storesDefs) {
            sysStoreDefMap.put(def.getName(), def);
        }
        return sysStoreDefMap;
    }
1283827
protected List<ContentStore> getSecondaryStores(ContentStoreManager storeManager,
                                                    String primaryStoreId)
        throws ContentStoreException {
        Map<String, ContentStore> stores =
            new HashMap<>(storeManager.getContentStores());
        List<ContentStore> secondaryStores = new ArrayList<>();

        for (ContentStore store : stores.values()) {
            if (!store.getStoreId().equals(primaryStoreId)) {
                secondaryStores.add(store);
            }
        }
        return secondaryStores;
    }