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);
}
}
}
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();
}
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();
}
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();
}
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();
}
Aggregations