@Override public String computeResults(final OperationParams params) { if (parameters.size() < 1) { throw new ParameterException("Must specify store name"); } final String inputStoreName = parameters.get(0); // Attempt to load store. final File configFile = getGeoWaveConfigFile(params); // Attempt to load input store. final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } inputStoreOptions = inputStoreLoader.getDataStorePlugin(); final String[] typeNames = inputStoreOptions.createInternalAdapterStore().getTypeNames(); final StringBuffer buffer = new StringBuffer(); for (final String typeName : typeNames) { buffer.append(typeName).append(' '); } return buffer.toString(); } }
private DataStorePluginOptions loadStore(String storeName, File configFile) { final StoreLoader storeLoader = new StoreLoader(storeName); if (!storeLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find left store: " + storeLoader.getStoreName()); } return storeLoader.getDataStorePlugin(); } }
public DataStorePluginOptions getStorePlugin(final String storeName) { final StoreLoader inputStoreLoader = new StoreLoader(storeName); if (!inputStoreLoader.loadFromConfig(config.getPropFile())) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } return inputStoreLoader.getDataStorePlugin(); }
final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
public VectorMRExportJobRunner createRunner(OperationParams params) { // Ensure we have all the required arguments if (parameters.size() != 2) { throw new ParameterException( "Requires arguments: <path to base directory to write to> <store name>"); } String hdfsPath = parameters.get(0); String storeName = parameters.get(1); // Config file File configFile = getGeoWaveConfigFile(params); Properties configProperties = ConfigOptions.loadProperties(configFile); String hdfsHostPort = ConfigHDFSCommand.getHdfsUrl(configProperties); // Attempt to load store. if (storeOptions == null) { StoreLoader storeLoader = new StoreLoader(storeName); if (!storeLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + storeLoader.getStoreName()); } storeOptions = storeLoader.getDataStorePlugin(); } VectorMRExportJobRunner vectorRunner = new VectorMRExportJobRunner(storeOptions, mrOptions, hdfsHostPort, hdfsPath); return vectorRunner; }
@Override public Void computeResults(final OperationParams params) { // Ensure we have all the required arguments if (parameters.size() != 2) { throw new ParameterException("Requires arguments: <store name> <type name>"); } final String inputStoreName = parameters.get(0); final String typeName = parameters.get(1); // Attempt to load store. final File configFile = getGeoWaveConfigFile(params); final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } inputStoreOptions = inputStoreLoader.getDataStorePlugin(); LOGGER.info("Deleting everything in store: " + inputStoreName + " with type name: " + typeName); inputStoreOptions.createDataStore().delete( QueryBuilder.newBuilder().addTypeName(typeName).build()); return null; } }
@Override public Void computeResults(final OperationParams params) { if (parameters.size() < 1) { throw new ParameterException("Must specify store name"); } final String inputStoreName = parameters.get(0); // Attempt to load store. final File configFile = getGeoWaveConfigFile(params); // Attempt to load input store. final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } inputStoreOptions = inputStoreLoader.getDataStorePlugin(); LOGGER.info("Deleting everything in store: " + inputStoreName); inputStoreOptions.createDataStore().delete(QueryBuilder.newBuilder().build()); return null; } }
public static void main(final String[] args) throws Exception { ConfigOptions opts = new ConfigOptions(); MainParameterHolder holder = new MainParameterHolder(); OperationParser parser = new OperationParser(); parser.addAdditionalObject(opts); parser.addAdditionalObject(holder); // Second round to get everything else. CommandLineOperationParams params = parser.parse(args); // Set the datastore plugin if (holder.getMainParameter().size() == 0) { throw new ParameterException("Must specify datastore name as first argument."); } // Load the params for config file. opts.prepare(params); StoreLoader loader = new StoreLoader(holder.getMainParameter().get(0)); loader.loadFromConfig((File) params.getContext().get(ConfigOptions.PROPERTIES_FILE_CONTEXT)); final int res = ToolRunner.run( new Configuration(), new GeoWaveDedupeJobRunner(loader.getDataStorePlugin()), args); System.exit(res); }
public RasterTileResizeJobRunner createRunner(final OperationParams params) { // Ensure we have all the required arguments if (parameters.size() != 2) { throw new ParameterException("Requires arguments: <input store name> <output store name>"); } final String inputStoreName = parameters.get(0); final String outputStoreName = parameters.get(1); // Config file final File configFile = getGeoWaveConfigFile(params); // Attempt to load input store. final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } inputStoreOptions = inputStoreLoader.getDataStorePlugin(); // Attempt to load output store. final StoreLoader outputStoreLoader = new StoreLoader(outputStoreName); if (!outputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + outputStoreLoader.getStoreName()); } outputStoreOptions = outputStoreLoader.getDataStorePlugin(); if (options.getHdfsHostPort() == null) { Properties configProperties = ConfigOptions.loadProperties(configFile); String hdfsFSUrl = ConfigHDFSCommand.getHdfsUrl(configProperties); options.setHdfsHostPort(hdfsFSUrl); } RasterTileResizeJobRunner runner = new RasterTileResizeJobRunner(inputStoreOptions, outputStoreOptions, options); return runner; }
public StoreCopyJobRunner createRunner(OperationParams params) { // Ensure we have all the required arguments if (parameters.size() != 2) { throw new ParameterException("Requires arguments: <input store name> <output store name>"); } String inputStoreName = parameters.get(0); String outputStoreName = parameters.get(1); // Config file File configFile = getGeoWaveConfigFile(params); if (options.getHdfsHostPort() == null) { Properties configProperties = ConfigOptions.loadProperties(configFile); String hdfsFSUrl = ConfigHDFSCommand.getHdfsUrl(configProperties); options.setHdfsHostPort(hdfsFSUrl); } StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } inputStoreOptions = inputStoreLoader.getDataStorePlugin(); // Attempt to load output store. StoreLoader outputStoreLoader = new StoreLoader(outputStoreName); if (!outputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + outputStoreLoader.getStoreName()); } outputStoreOptions = outputStoreLoader.getDataStorePlugin(); String jobName = "Copy " + inputStoreName + " to " + outputStoreName; StoreCopyJobRunner runner = new StoreCopyJobRunner(inputStoreOptions, outputStoreOptions, options, jobName); return runner; }
/** Prep the driver & run the operation. */ @Override public void execute(final OperationParams params) { // Ensure we have all the required arguments if (parameters.size() != 1) { throw new ParameterException("Requires arguments: <store name>"); } final String inputStoreName = parameters.get(0); // Attempt to load input store. if (inputStoreOptions == null) { final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(getGeoWaveConfigFile(params))) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName()); } inputStoreOptions = inputStoreLoader.getDataStorePlugin(); } // Get all statistics, remove all statistics, then re-add final DataStatisticsStore statsStore = inputStoreOptions.createDataStatisticsStore(); final InternalAdapterStore internalAdapterStore = inputStoreOptions.createInternalAdapterStore(); inputStoreOptions.createDataStoreOperations().mergeStats(statsStore, internalAdapterStore); }
final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
String hdfsHostPort = ConfigHDFSCommand.getHdfsUrl(configProperties); final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
final StoreLoader storeOptions = new StoreLoader(storeName); if (!storeOptions.loadFromConfig(getGeoWaveConfigFile(params))) { throw new ParameterException("Cannot find store name: " + storeOptions.getStoreName());
final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(configFile)) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
final String indexList = parameters.get(1); final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName); if (!inputStoreLoader.loadFromConfig(getGeoWaveConfigFile(params))) { throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());