Search in sources :

Example 1 with VoidResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCoreIngestService method sparkToGeoWaveCommand.

@Override
public void sparkToGeoWaveCommand(final org.locationtech.geowave.service.grpc.protobuf.SparkToGeoWaveCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos> responseObserver) {
    final SparkToGeoWaveCommand cmd = new SparkToGeoWaveCommand();
    final 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);
    if (!cmd.prepare(params)) {
        LOGGER.error("Failed to prepare parameters for SparkToGeowaveCommand");
    }
    LOGGER.info("Executing SparkToGeowaveCommand...");
    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);
        responseObserver.onError(e);
    }
}
Also used : VoidResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) SparkToGeoWaveCommand(org.locationtech.geowave.core.ingest.operations.SparkToGeoWaveCommand) File(java.io.File) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Example 2 with VoidResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCoreIngestService method localToHdfsCommand.

@Override
public void localToHdfsCommand(final org.locationtech.geowave.service.grpc.protobuf.LocalToHdfsCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos> responseObserver) {
    final LocalToHdfsCommand cmd = new LocalToHdfsCommand();
    final 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 LocalToHdfsCommand...");
    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);
        responseObserver.onError(e);
    }
}
Also used : VoidResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) LocalToHdfsCommand(org.locationtech.geowave.core.ingest.operations.LocalToHdfsCommand) File(java.io.File) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Example 3 with VoidResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCoreIngestService method kafkaToGeoWaveCommand.

@Override
public void kafkaToGeoWaveCommand(final org.locationtech.geowave.service.grpc.protobuf.KafkaToGeoWaveCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos> responseObserver) {
    final KafkaToGeoWaveCommand cmd = new KafkaToGeoWaveCommand();
    final 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 KafkaToGeowaveCommand...");
    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);
        responseObserver.onError(e);
    }
}
Also used : KafkaToGeoWaveCommand(org.locationtech.geowave.core.ingest.operations.KafkaToGeoWaveCommand) VoidResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) File(java.io.File) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Example 4 with VoidResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCoreIngestService method localToGeoWaveCommand.

@Override
public void localToGeoWaveCommand(final org.locationtech.geowave.service.grpc.protobuf.LocalToGeoWaveCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos> responseObserver) {
    final LocalToGeoWaveCommand cmd = new LocalToGeoWaveCommand();
    final 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 LocalToGeowaveCommand...");
    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);
        responseObserver.onError(e);
    }
}
Also used : VoidResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) LocalToGeoWaveCommand(org.locationtech.geowave.core.ingest.operations.LocalToGeoWaveCommand) File(java.io.File) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Example 5 with VoidResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCoreMapreduceService method configHDFSCommand.

@Override
public void configHDFSCommand(final org.locationtech.geowave.service.grpc.protobuf.ConfigHDFSCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos> responseObserver) {
    final ConfigHDFSCommand cmd = new ConfigHDFSCommand();
    final 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 ConfigHDFSCommand...");
    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);
        responseObserver.onError(e);
    }
}
Also used : VoidResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) ConfigHDFSCommand(org.locationtech.geowave.mapreduce.operations.ConfigHDFSCommand) File(java.io.File) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Aggregations

FieldDescriptor (com.google.protobuf.Descriptors.FieldDescriptor)19 File (java.io.File)19 OperationParams (org.locationtech.geowave.core.cli.api.OperationParams)19 ManualOperationParams (org.locationtech.geowave.core.cli.parser.ManualOperationParams)19 VoidResponseProtos (org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos)19 LocalToMapReduceToGeoWaveCommand (org.locationtech.geowave.core.ingest.operations.LocalToMapReduceToGeoWaveCommand)2 DBScanCommand (org.locationtech.geowave.analytic.mapreduce.operations.DBScanCommand)1 KdeCommand (org.locationtech.geowave.analytic.mapreduce.operations.KdeCommand)1 NearestNeighborCommand (org.locationtech.geowave.analytic.mapreduce.operations.NearestNeighborCommand)1 KDESparkCommand (org.locationtech.geowave.analytic.spark.kde.operations.KDESparkCommand)1 KmeansSparkCommand (org.locationtech.geowave.analytic.spark.kmeans.operations.KmeansSparkCommand)1 SparkSqlCommand (org.locationtech.geowave.analytic.spark.sparksql.operations.SparkSqlCommand)1 SpatialJoinCommand (org.locationtech.geowave.analytic.spark.spatial.operations.SpatialJoinCommand)1 KafkaToGeoWaveCommand (org.locationtech.geowave.core.ingest.operations.KafkaToGeoWaveCommand)1 LocalToGeoWaveCommand (org.locationtech.geowave.core.ingest.operations.LocalToGeoWaveCommand)1 LocalToHdfsCommand (org.locationtech.geowave.core.ingest.operations.LocalToHdfsCommand)1 LocalToKafkaCommand (org.locationtech.geowave.core.ingest.operations.LocalToKafkaCommand)1 MapReduceToGeoWaveCommand (org.locationtech.geowave.core.ingest.operations.MapReduceToGeoWaveCommand)1 SparkToGeoWaveCommand (org.locationtech.geowave.core.ingest.operations.SparkToGeoWaveCommand)1 RecalculateStatsCommand (org.locationtech.geowave.core.store.cli.stats.RecalculateStatsCommand)1