@Override public void execute(OperationParams params) { Properties existingProps = getGeoWaveConfigProperties(params); if (parameters.size() < 2) { throw new ParameterException("Must specify <existing index> <new index> names"); } // This is the new index name. String newIndex = parameters.get(1); String newIndexNamespace = IndexPluginOptions.getIndexNamespace(newIndex); // Make sure we're not already in the index. IndexPluginOptions existPlugin = new IndexPluginOptions(); if (existPlugin.load(existingProps, newIndexNamespace)) { throw new ParameterException("That index already exists: " + newIndex); } // Save the options. newPluginOptions.save(existingProps, newIndexNamespace); // Make default? if (Boolean.TRUE.equals(makeDefault)) { existingProps.setProperty(IndexPluginOptions.DEFAULT_PROPERTY_NAMESPACE, newIndex); } // Write properties file ConfigOptions.writeProperties(getGeoWaveConfigFile(params), existingProps); }
pluginOptions.selectPlugin(type); pluginOptions.setBasicIndexOptions(basicIndexOptions); opts = pluginOptions.getDimensionalityOptions(); } else { Properties existingProps = getGeoWaveConfigProperties(params); if (pluginOptions.load( existingProps, IndexPluginOptions.getIndexNamespace(defaultIndex))) { this.type = pluginOptions.getType(); opts = pluginOptions.getDimensionalityOptions();
private static IndexPluginOptions loadIndexPluginOptions( final Properties props, final String name) { final IndexPluginOptions indexPlugin = new IndexPluginOptions(); final String indexNamespace = IndexPluginOptions.getIndexNamespace(name); if (!indexPlugin.load(props, indexNamespace)) { return null; } return indexPlugin; }
@Override public boolean prepare(final OperationParams params) { pluginOptions.selectPlugin("spatial_temporal"); pluginOptions.setBasicIndexOptions(basicIndexOptions); pluginOptions.setDimensionalityTypeOptions(opts); // Successfully prepared. return true; }
public void addIndex(String name, String type) { if (name != null && type != null) { IndexPluginOptions indexOptions = new IndexPluginOptions(); indexOptions.selectPlugin(type); getDimensionalityPlugins().put(name, indexOptions); } }
final Index primaryIndex = dimensionType.createIndex(); if (primaryIndex == null) { LOGGER.error("Could not get index instance, getIndex() returned null;");
IndexPluginOptions existPlugin = new IndexPluginOptions(); if (existPlugin.load(existingProps, getNamespace())) { throw new ParameterException("That index already exists: " + getPluginName()); pluginOptions.save(existingProps, getNamespace());
final IndexPluginOptions pluginOptions = new IndexPluginOptions(); pluginOptions.selectPlugin(indexType); pluginOptions.save(props, IndexPluginOptions.getIndexNamespace(indexType)); final AddIndexCommand addIndex = new AddIndexCommand(); addIndex.setParameters(indexType);
if (dimensionType.getType().equals("spatial")) { final Index primaryIndex = dimensionType.createIndex(); if (primaryIndex == null) { LOGGER.error("Could not get index instance, getIndex() returned null;");
final List<IndexPluginOptions> indexOptions = new ArrayList<>(indexTypes.length); for (final String indexType : indexTypes) { final IndexPluginOptions indexOption = new IndexPluginOptions(); indexOption.selectPlugin(indexType); if (crsCode != null) { if (indexOption.getDimensionalityOptions() instanceof SpatialOptions) { ((SpatialOptions) indexOption.getDimensionalityOptions()).setCrs(crsCode); } else { ((SpatialTemporalOptions) indexOption.getDimensionalityOptions()).setCrs(crsCode);
public String getNamespace() { return IndexPluginOptions.getIndexNamespace(getPluginName()); }
@Override public boolean prepare(OperationParams params) { super.prepare(params); Properties existingProps = getGeoWaveConfigProperties(params); // Load the old index, so that we can override the values String oldIndex = null; if (parameters.size() >= 1) { oldIndex = parameters.get(0); if (!newPluginOptions.load(existingProps, IndexPluginOptions.getIndexNamespace(oldIndex))) { throw new ParameterException("Could not find index: " + oldIndex); } } // Successfully prepared. return true; }
@Override public String getType() { List<String> typeString = new ArrayList<String>(); for (Entry<String, IndexPluginOptions> entry : getDimensionalityPlugins().entrySet()) { typeString.add(String.format("%s=%s", entry.getKey(), entry.getValue().getType())); } if (typeString.isEmpty()) { return null; } return StringUtils.join(typeString, ","); }
public BaseIndexBuilder() { this(new IndexPluginOptions()); }
int i = 0; for (final IndexPluginOptions dimensionType : indexOptions) { final Index primaryIndex = dimensionType.createIndex(); if (primaryIndex == null) { LOGGER.error("Could not get index instance, getIndex() returned null;");
final IndexPluginOptions existPlugin = new IndexPluginOptions(); if (existPlugin.load(existingProps, getNamespace())) { throw new DuplicateEntryException("That store already exists: " + getPluginName()); pluginOptions.save(existingProps, getNamespace());
final List<IndexPluginOptions> indexOptions = new ArrayList<>(indexTypes.length); for (final String indexType : indexTypes) { final IndexPluginOptions indexOption = new IndexPluginOptions(); indexOption.selectPlugin(indexType); indexOptions.add(indexOption);
final IndexPluginOptions options = new IndexPluginOptions(); if (!options.load(existingProps, IndexPluginOptions.getIndexNamespace(indexes[i]))) { throw new TargetNotFoundException("That index does not exist: " + indexes[i]);
@Override public boolean prepare(final OperationParams params) { pluginOptions.selectPlugin("spatial"); pluginOptions.setBasicIndexOptions(basicIndexOptions); pluginOptions.setDimensionalityTypeOptions(opts); return true; }
public String getNamespace() { return IndexPluginOptions.getIndexNamespace(getPluginName()); }