@Override public void execute(final OperationParams params) { computeResults(params); }
@Override public void clearCommand( org.locationtech.geowave.service.grpc.protobuf.ClearCommandParametersProtos request, StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos> responseObserver) { ClearCommand cmd = new ClearCommand(); Map<FieldDescriptor, Object> m = request.getAllFields(); GeoWaveGrpcServiceCommandUtil.setGrpcToCommandFields(m, cmd); final File configFile = GeoWaveGrpcServiceOptions.geowaveConfigFile; final OperationParams params = new ManualOperationParams(); params.getContext().put(ConfigOptions.PROPERTIES_FILE_CONTEXT, configFile); cmd.prepare(params); LOGGER.info("Executing ClearCommand..."); try { cmd.computeResults(params); final VoidResponseProtos resp = VoidResponseProtos.newBuilder().build(); responseObserver.onNext(resp); responseObserver.onCompleted(); } catch (final Exception e) { LOGGER.error("Exception encountered executing command", e); } }
final ClearCommand clearCommand = new ClearCommand(); clearCommand.setParameters("temp-out"); clearCommand.execute(params); } else { LOGGER.warn(
@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; } }