Search in sources :

Example 1 with SpatialJoinCommand

use of org.locationtech.geowave.analytic.spark.spatial.operations.SpatialJoinCommand in project geowave by locationtech.

the class GeoWaveGrpcAnalyticSparkService method spatialJoinCommand.

@Override
public void spatialJoinCommand(final SpatialJoinCommandParametersProtos request, final StreamObserver<VoidResponseProtos> responseObserver) {
    final SpatialJoinCommand cmd = new SpatialJoinCommand();
    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 SpatialJoinCommand...");
    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) File(java.io.File) SpatialJoinCommand(org.locationtech.geowave.analytic.spark.spatial.operations.SpatialJoinCommand) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Aggregations

FieldDescriptor (com.google.protobuf.Descriptors.FieldDescriptor)1 File (java.io.File)1 SpatialJoinCommand (org.locationtech.geowave.analytic.spark.spatial.operations.SpatialJoinCommand)1 OperationParams (org.locationtech.geowave.core.cli.api.OperationParams)1 ManualOperationParams (org.locationtech.geowave.core.cli.parser.ManualOperationParams)1 VoidResponseProtos (org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos)1