@Override public boolean updateConfigForGroup(String group, CacheConfig config, Object configObject) { Set<RegionConfig.Index> updatedIndexes = (Set<RegionConfig.Index>) configObject; if (updatedIndexes == null) { return false; } for (RegionConfig.Index index : updatedIndexes) { RegionConfig regionConfig = getValidRegionConfig(index.getFromClause(), config); if (regionConfig == null) { throw new IllegalStateException("RegionConfig is null"); } regionConfig.getIndexes().add(index); } return true; }
for (RegionConfig.Index indexDefinition : indexDefinitions) { String indexName = indexDefinition.getName(); String regionPath = indexDefinition.getFromClause(); String indexedExpression = indexDefinition.getExpression(); IndexType indexType = IndexType.valueOfSynonym(indexDefinition.getType());
@Override public boolean updateConfigForGroup(String group, CacheConfig config, Object element) { RegionConfig.Index indexFromCommand = (RegionConfig.Index) element; String indexName = indexFromCommand.getName(); String regionName = indexFromCommand.getFromClause(); if (regionName != null) { RegionConfig regionConfig = config.findRegionConfiguration(regionName); if (regionConfig == null) { String errorMessage = "Region " + regionName + " not found"; if (!ConfigurationPersistenceService.CLUSTER_CONFIG.equals(group)) { errorMessage += " in group " + group; } throw new EntityNotFoundException(errorMessage); } if (indexName.isEmpty()) { regionConfig.getIndexes().clear(); } else { CacheElement.removeElement(regionConfig.getIndexes(), indexName); } } else { // Need to search for the index name as region was not specified for (RegionConfig r : config.getRegions()) { CacheElement.removeElement(r.getIndexes(), indexName); } } return true; }
QueryService queryService = cache.getQueryService(); String indexName = indexInfo.getName(); String regionPath = indexInfo.getFromClause();
String indexName = indexInfo.getName(); String indexedExpression = indexInfo.getExpression(); String fromClause = indexInfo.getFromClause(); if (indexInfo.isKeyIndex()) { queryService.createKeyIndex(indexName, indexedExpression, fromClause); } catch (RegionNotFoundException e) { String message = CliStrings.format(CliStrings.CREATE_INDEX__INVALID__REGIONPATH, indexInfo.getFromClause()); context.getResultSender().lastResult(new CliFunctionResult(memberId, false, message)); } catch (IndexInvalidException e) {
@Override public boolean updateConfigForGroup(String group, CacheConfig config, Object element) { RegionConfig.Index index = (RegionConfig.Index) element; String regionPath = getValidRegionName(index.getFromClause(), config); RegionConfig regionConfig = config.findRegionConfiguration(regionPath); if (regionConfig == null) { throw new EntityNotFoundException("Region " + index.getFromClause() + " not found."); } regionConfig.getIndexes().add(index); return true; } }