Search in sources :

Example 1 with ParameterEnum

use of org.locationtech.geowave.analytic.param.ParameterEnum in project geowave by locationtech.

the class PropertyManagement method setConfig.

public void setConfig(final ParameterEnum<?>[] parameters, final Configuration config, final Class<?> scope) {
    for (final ParameterEnum param : parameters) {
        Object value;
        try {
            value = getProperty(param);
            param.getHelper().setValue(config, scope, value);
        } catch (final Exception e) {
            LOGGER.error("Property " + param.self().toString() + " is not available", e);
            throw new IllegalArgumentException("Property " + param.self().toString() + " is not available", e);
        }
    }
}
Also used : ParameterEnum(org.locationtech.geowave.analytic.param.ParameterEnum) ParseException(org.apache.commons.cli.ParseException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 2 with ParameterEnum

use of org.locationtech.geowave.analytic.param.ParameterEnum in project geowave by locationtech.

the class GeoWaveKMeansIT method runKJumpPlusPlus.

private void runKJumpPlusPlus(final QueryConstraints query) throws Exception {
    final MultiLevelJumpKMeansClusteringJobRunner jobRunner2 = new MultiLevelJumpKMeansClusteringJobRunner();
    final int res2 = jobRunner2.run(MapReduceTestUtils.getConfiguration(), new PropertyManagement(new ParameterEnum[] { ExtractParameters.Extract.QUERY, ExtractParameters.Extract.MIN_INPUT_SPLIT, ExtractParameters.Extract.MAX_INPUT_SPLIT, ClusteringParameters.Clustering.ZOOM_LEVELS, ExtractParameters.Extract.OUTPUT_DATA_TYPE_ID, StoreParam.INPUT_STORE, GlobalParameters.Global.BATCH_ID, MapReduceParameters.MRConfig.HDFS_BASE_DIR, JumpParameters.Jump.RANGE_OF_CENTROIDS, JumpParameters.Jump.KPLUSPLUS_MIN, ClusteringParameters.Clustering.MAX_ITERATIONS }, new Object[] { QueryBuilder.newBuilder().constraints(query).build(), MapReduceTestUtils.MIN_INPUT_SPLITS, MapReduceTestUtils.MAX_INPUT_SPLITS, 2, "centroid", new PersistableStore(dataStorePluginOptions), "bx2", TestUtils.TEMP_DIR + File.separator + MapReduceTestEnvironment.HDFS_BASE_DIRECTORY + "/t2", new NumericRange(4, 7), 5, 2 }));
    Assert.assertEquals(0, res2);
    final DataStore dataStore = dataStorePluginOptions.createDataStore();
    final IndexStore indexStore = dataStorePluginOptions.createIndexStore();
    final PersistentAdapterStore adapterStore = dataStorePluginOptions.createAdapterStore();
    final InternalAdapterStore internalAdapterStore = dataStorePluginOptions.createInternalAdapterStore();
    final int jumpRresultCounLevel1 = countResults(dataStore, indexStore, adapterStore, internalAdapterStore, "bx2", 1, 1);
    final int jumpRresultCounLevel2 = countResults(dataStore, indexStore, adapterStore, internalAdapterStore, "bx2", 2, jumpRresultCounLevel1);
    Assert.assertTrue(jumpRresultCounLevel1 >= 2);
    Assert.assertTrue(jumpRresultCounLevel2 >= 2);
    // for travis-ci to run, we want to limit the memory consumption
    System.gc();
}
Also used : ParameterEnum(org.locationtech.geowave.analytic.param.ParameterEnum) NumericRange(org.locationtech.geowave.core.index.numeric.NumericRange) PersistentAdapterStore(org.locationtech.geowave.core.store.adapter.PersistentAdapterStore) MultiLevelJumpKMeansClusteringJobRunner(org.locationtech.geowave.analytic.mapreduce.clustering.runner.MultiLevelJumpKMeansClusteringJobRunner) InternalAdapterStore(org.locationtech.geowave.core.store.adapter.InternalAdapterStore) DataStore(org.locationtech.geowave.core.store.api.DataStore) PersistableStore(org.locationtech.geowave.analytic.store.PersistableStore) PropertyManagement(org.locationtech.geowave.analytic.PropertyManagement) IndexStore(org.locationtech.geowave.core.store.index.IndexStore)

Example 3 with ParameterEnum

use of org.locationtech.geowave.analytic.param.ParameterEnum in project geowave by locationtech.

the class GeoWaveNNIT method runNN.

private void runNN(final QueryConstraints query) throws Exception {
    final NNJobRunner jobRunner = new NNJobRunner();
    // final int res = 1;
    // GeoWaveMain.main(new String[] {
    // "analytic",
    // "nn",
    // "--query.adapters",
    // "testnn",
    // "--query.index",
    // new
    // SpatialDimensionalityTypeProvider().createPrimaryIndex().getId().getString(),
    // "-emn",
    // Integer.toString(MIN_INPUT_SPLITS),
    // "-emx",
    // Integer.toString(MAX_INPUT_SPLITS),
    // "-pmd",
    // "0.2",
    // "-pdt",
    // "0.2,0.2",
    // "-pc",
    // OrthodromicDistancePartitioner.class.toString(),
    // "-oop",
    // hdfsBaseDirectory + "/t1/pairs",
    // "-hdfsbase",
    // hdfsBaseDirectory + "/t1",
    // "-orc",
    // "3",
    // "-ofc",
    // SequenceFileOutputFormatConfiguration.class.toString(),
    // "-ifc",
    // GeoWaveInputFormatConfiguration.class.toString(),
    // "foo"
    // });
    final int res = jobRunner.run(MapReduceTestUtils.getConfiguration(), new PropertyManagement(new ParameterEnum[] { ExtractParameters.Extract.QUERY, ExtractParameters.Extract.MIN_INPUT_SPLIT, ExtractParameters.Extract.MAX_INPUT_SPLIT, PartitionParameters.Partition.MAX_DISTANCE, PartitionParameters.Partition.DISTANCE_THRESHOLDS, PartitionParameters.Partition.PARTITIONER_CLASS, StoreParam.INPUT_STORE, OutputParameters.Output.HDFS_OUTPUT_PATH, MapReduceParameters.MRConfig.HDFS_BASE_DIR, OutputParameters.Output.REDUCER_COUNT, OutputParameters.Output.OUTPUT_FORMAT, InputParameters.Input.INPUT_FORMAT }, new Object[] { QueryBuilder.newBuilder().constraints(query).build(), Integer.toString(MapReduceTestUtils.MIN_INPUT_SPLITS), Integer.toString(MapReduceTestUtils.MAX_INPUT_SPLITS), 0.2, "0.2,0.2", OrthodromicDistancePartitioner.class, new PersistableStore(dataStorePluginOptions), TestUtils.TEMP_DIR + File.separator + MapReduceTestEnvironment.HDFS_BASE_DIRECTORY + "/t1/pairs", TestUtils.TEMP_DIR + File.separator + MapReduceTestEnvironment.HDFS_BASE_DIRECTORY + "/t1", 3, SequenceFileOutputFormatConfiguration.class, GeoWaveInputFormatConfiguration.class }));
    Assert.assertEquals(0, res);
    Assert.assertTrue(readFile() > 0);
    // for travis-ci to run, we want to limit the memory consumption
    System.gc();
}
Also used : NNJobRunner(org.locationtech.geowave.analytic.mapreduce.nn.NNJobRunner) ParameterEnum(org.locationtech.geowave.analytic.param.ParameterEnum) SequenceFileOutputFormatConfiguration(org.locationtech.geowave.analytic.mapreduce.SequenceFileOutputFormatConfiguration) GeoWaveInputFormatConfiguration(org.locationtech.geowave.analytic.mapreduce.GeoWaveInputFormatConfiguration) OrthodromicDistancePartitioner(org.locationtech.geowave.analytic.partitioner.OrthodromicDistancePartitioner) PersistableStore(org.locationtech.geowave.analytic.store.PersistableStore) PropertyManagement(org.locationtech.geowave.analytic.PropertyManagement)

Example 4 with ParameterEnum

use of org.locationtech.geowave.analytic.param.ParameterEnum in project geowave by locationtech.

the class DBScanIT method runScan.

private void runScan(final QueryConstraints query) throws Exception {
    final DBScanIterationsJobRunner jobRunner = new DBScanIterationsJobRunner();
    final Configuration conf = MapReduceTestUtils.getConfiguration();
    final int res = jobRunner.run(conf, new PropertyManagement(new ParameterEnum[] { ExtractParameters.Extract.QUERY, ExtractParameters.Extract.MIN_INPUT_SPLIT, ExtractParameters.Extract.MAX_INPUT_SPLIT, PartitionParameters.Partition.MAX_DISTANCE, PartitionParameters.Partition.PARTITIONER_CLASS, ClusteringParameters.Clustering.MINIMUM_SIZE, StoreParam.INPUT_STORE, MapReduceParameters.MRConfig.HDFS_BASE_DIR, OutputParameters.Output.REDUCER_COUNT, InputParameters.Input.INPUT_FORMAT, GlobalParameters.Global.BATCH_ID, PartitionParameters.Partition.PARTITION_DECREASE_RATE, PartitionParameters.Partition.PARTITION_PRECISION }, new Object[] { QueryBuilder.newBuilder().constraints(query).build(), Integer.toString(MapReduceTestUtils.MIN_INPUT_SPLITS), Integer.toString(MapReduceTestUtils.MAX_INPUT_SPLITS), 10000.0, OrthodromicDistancePartitioner.class, 10, new PersistableStore(dataStorePluginOptions), TestUtils.TEMP_DIR + File.separator + MapReduceTestEnvironment.HDFS_BASE_DIRECTORY + "/t1", 2, GeoWaveInputFormatConfiguration.class, "bx5", 0.15, 0.95 }));
    Assert.assertEquals(0, res);
    Assert.assertTrue(readHulls() > 2);
    // for travis-ci to run, we want to limit the memory consumption
    System.gc();
}
Also used : ParameterEnum(org.locationtech.geowave.analytic.param.ParameterEnum) GeoWaveInputFormatConfiguration(org.locationtech.geowave.analytic.mapreduce.GeoWaveInputFormatConfiguration) DBScanIterationsJobRunner(org.locationtech.geowave.analytic.mapreduce.dbscan.DBScanIterationsJobRunner) GeoWaveInputFormatConfiguration(org.locationtech.geowave.analytic.mapreduce.GeoWaveInputFormatConfiguration) Configuration(org.apache.hadoop.conf.Configuration) OrthodromicDistancePartitioner(org.locationtech.geowave.analytic.partitioner.OrthodromicDistancePartitioner) PersistableStore(org.locationtech.geowave.analytic.store.PersistableStore) PropertyManagement(org.locationtech.geowave.analytic.PropertyManagement) Point(org.locationtech.jts.geom.Point)

Example 5 with ParameterEnum

use of org.locationtech.geowave.analytic.param.ParameterEnum in project geowave by locationtech.

the class GeoWaveKMeansIT method runKPlusPlus.

private void runKPlusPlus(final QueryConstraints query) throws Exception {
    final MultiLevelKMeansClusteringJobRunner jobRunner = new MultiLevelKMeansClusteringJobRunner();
    final int res = jobRunner.run(MapReduceTestUtils.getConfiguration(), new PropertyManagement(new ParameterEnum[] { ExtractParameters.Extract.QUERY, ExtractParameters.Extract.MIN_INPUT_SPLIT, ExtractParameters.Extract.MAX_INPUT_SPLIT, ClusteringParameters.Clustering.ZOOM_LEVELS, ClusteringParameters.Clustering.MAX_ITERATIONS, ClusteringParameters.Clustering.RETAIN_GROUP_ASSIGNMENTS, ExtractParameters.Extract.OUTPUT_DATA_TYPE_ID, StoreParam.INPUT_STORE, GlobalParameters.Global.BATCH_ID, MapReduceParameters.MRConfig.HDFS_BASE_DIR, SampleParameters.Sample.MAX_SAMPLE_SIZE, SampleParameters.Sample.MIN_SAMPLE_SIZE }, new Object[] { QueryBuilder.newBuilder().constraints(query).build(), MapReduceTestUtils.MIN_INPUT_SPLITS, MapReduceTestUtils.MAX_INPUT_SPLITS, 2, 2, false, "centroid", new PersistableStore(dataStorePluginOptions), "bx1", TestUtils.TEMP_DIR + File.separator + MapReduceTestEnvironment.HDFS_BASE_DIRECTORY + "/t1", 3, 2 }));
    Assert.assertEquals(0, res);
    final DataStore dataStore = dataStorePluginOptions.createDataStore();
    final IndexStore indexStore = dataStorePluginOptions.createIndexStore();
    final PersistentAdapterStore adapterStore = dataStorePluginOptions.createAdapterStore();
    final InternalAdapterStore internalAdapterStore = dataStorePluginOptions.createInternalAdapterStore();
    final int resultCounLevel1 = countResults(dataStore, indexStore, adapterStore, internalAdapterStore, "bx1", // level
    1, 1);
    final int resultCounLevel2 = countResults(dataStore, indexStore, adapterStore, internalAdapterStore, "bx1", // level
    2, resultCounLevel1);
    Assert.assertTrue(resultCounLevel2 >= 2);
    // for travis-ci to run, we want to limit the memory consumption
    System.gc();
}
Also used : ParameterEnum(org.locationtech.geowave.analytic.param.ParameterEnum) PersistentAdapterStore(org.locationtech.geowave.core.store.adapter.PersistentAdapterStore) MultiLevelKMeansClusteringJobRunner(org.locationtech.geowave.analytic.mapreduce.clustering.runner.MultiLevelKMeansClusteringJobRunner) InternalAdapterStore(org.locationtech.geowave.core.store.adapter.InternalAdapterStore) DataStore(org.locationtech.geowave.core.store.api.DataStore) PersistableStore(org.locationtech.geowave.analytic.store.PersistableStore) PropertyManagement(org.locationtech.geowave.analytic.PropertyManagement) IndexStore(org.locationtech.geowave.core.store.index.IndexStore)

Aggregations

ParameterEnum (org.locationtech.geowave.analytic.param.ParameterEnum)5 PropertyManagement (org.locationtech.geowave.analytic.PropertyManagement)4 PersistableStore (org.locationtech.geowave.analytic.store.PersistableStore)4 GeoWaveInputFormatConfiguration (org.locationtech.geowave.analytic.mapreduce.GeoWaveInputFormatConfiguration)2 OrthodromicDistancePartitioner (org.locationtech.geowave.analytic.partitioner.OrthodromicDistancePartitioner)2 InternalAdapterStore (org.locationtech.geowave.core.store.adapter.InternalAdapterStore)2 PersistentAdapterStore (org.locationtech.geowave.core.store.adapter.PersistentAdapterStore)2 DataStore (org.locationtech.geowave.core.store.api.DataStore)2 IndexStore (org.locationtech.geowave.core.store.index.IndexStore)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ParseException (org.apache.commons.cli.ParseException)1 Configuration (org.apache.hadoop.conf.Configuration)1 SequenceFileOutputFormatConfiguration (org.locationtech.geowave.analytic.mapreduce.SequenceFileOutputFormatConfiguration)1 MultiLevelJumpKMeansClusteringJobRunner (org.locationtech.geowave.analytic.mapreduce.clustering.runner.MultiLevelJumpKMeansClusteringJobRunner)1 MultiLevelKMeansClusteringJobRunner (org.locationtech.geowave.analytic.mapreduce.clustering.runner.MultiLevelKMeansClusteringJobRunner)1 DBScanIterationsJobRunner (org.locationtech.geowave.analytic.mapreduce.dbscan.DBScanIterationsJobRunner)1 NNJobRunner (org.locationtech.geowave.analytic.mapreduce.nn.NNJobRunner)1 NumericRange (org.locationtech.geowave.core.index.numeric.NumericRange)1 Point (org.locationtech.jts.geom.Point)1