Search in sources :

Example 1 with StartGrpcServerCommand

use of org.locationtech.geowave.service.grpc.cli.StartGrpcServerCommand in project geowave by locationtech.

the class GeoWaveGrpcIT method init.

protected void init() throws Exception {
    Configurator.setRootLevel(Level.WARN);
    ZipUtils.unZipFile(new File(BasicKafkaIT.class.getClassLoader().getResource(TEST_DATA_ZIP_RESOURCE_PATH).toURI()), TestUtils.TEST_CASE_BASE);
    // set up the config file for the services
    configFile = File.createTempFile("test_config", null);
    GeoWaveGrpcServiceOptions.geowaveConfigFile = configFile;
    operationParams = new ManualOperationParams();
    operationParams.getContext().put(ConfigOptions.PROPERTIES_FILE_CONTEXT, configFile);
    // add a store and index manually before we try to ingest
    // this accurately simulates how the services will perform the ingest
    // from config file parameters (as opposed to programatic
    // creation/loading)
    final AddStoreCommand command = new AddStoreCommand();
    command.setParameters(GeoWaveGrpcTestUtils.storeName);
    command.setPluginOptions(dataStore);
    command.execute(operationParams);
    // finally add an output store for things like KDE etc
    final AddStoreCommand commandOut = new AddStoreCommand();
    commandOut.setParameters(GeoWaveGrpcTestUtils.outputStoreName);
    commandOut.setPluginOptions(dataStore);
    commandOut.execute(operationParams);
    // set up s3
    final ConfigAWSCommand configS3 = new ConfigAWSCommand();
    configS3.setS3UrlParameter("s3.amazonaws.com");
    configS3.execute(operationParams);
    // mimic starting the server from command line
    final StartGrpcServerCommand startCmd = new StartGrpcServerCommand();
    final StartGrpcServerCommandOptions grpcCmdOpts = new StartGrpcServerCommandOptions();
    grpcCmdOpts.setPort(GeoWaveGrpcServiceOptions.port);
    grpcCmdOpts.setNonBlocking(true);
    startCmd.setCommandOptions(grpcCmdOpts);
    startCmd.execute(operationParams);
    // fire up the client
    client = new GeoWaveGrpcTestClient(GeoWaveGrpcServiceOptions.host, GeoWaveGrpcServiceOptions.port);
    LOGGER.warn("-----------------------------------------");
    LOGGER.warn("*                                       *");
    LOGGER.warn("* FINISHED Init  *");
    LOGGER.warn("*         " + ((System.currentTimeMillis() - startMillis) / 1000) + "s elapsed.                 *");
    LOGGER.warn("*                                       *");
    LOGGER.warn("-----------------------------------------");
}
Also used : StartGrpcServerCommandOptions(org.locationtech.geowave.service.grpc.cli.StartGrpcServerCommandOptions) ConfigAWSCommand(org.locationtech.geowave.core.ingest.operations.ConfigAWSCommand) StartGrpcServerCommand(org.locationtech.geowave.service.grpc.cli.StartGrpcServerCommand) AddStoreCommand(org.locationtech.geowave.core.store.cli.store.AddStoreCommand) File(java.io.File) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Aggregations

File (java.io.File)1 ManualOperationParams (org.locationtech.geowave.core.cli.parser.ManualOperationParams)1 ConfigAWSCommand (org.locationtech.geowave.core.ingest.operations.ConfigAWSCommand)1 AddStoreCommand (org.locationtech.geowave.core.store.cli.store.AddStoreCommand)1 StartGrpcServerCommand (org.locationtech.geowave.service.grpc.cli.StartGrpcServerCommand)1 StartGrpcServerCommandOptions (org.locationtech.geowave.service.grpc.cli.StartGrpcServerCommandOptions)1