use of org.bboxdb.network.client.BBoxDBCluster in project bboxdb by jnidzwetzki.
the class TestBoundingBoxQuery method run.
@Override
public void run() {
System.out.format("# Reading %s%n", filename);
final BoundingBox boundingBox = ExperimentHelper.determineBoundingBox(filename, format);
System.out.println("Connecting to BBoxDB cluster");
final BBoxDB bboxDBConnection = new BBoxDBCluster(endpoint, cluster);
if (!bboxDBConnection.connect()) {
System.err.println("Unable to connect to the BBoxDB cluster, exiting");
System.exit(-1);
}
final List<Double> experimentSize = Arrays.asList(0.001, 0.01, 0.1, 1.0);
experimentSize.forEach(e -> runExperiment(e, boundingBox, bboxDBConnection));
pendingFutures.shutdown();
}
use of org.bboxdb.network.client.BBoxDBCluster in project bboxdb by jnidzwetzki.
the class DataRedistributionLoader method main.
/**
* Main Main Main Main Main Main
* @param args
*/
public static void main(final String[] args) {
if (args.length != 4) {
System.err.println("Usage: <Class> <File1>:<File2>:<FileN> <Number of files to load> " + "<ZookeeperEndpoint> <Clustername>");
System.exit(-1);
}
final String zookeeperEndpoint = args[2];
final String clustername = args[3];
final BBoxDBCluster bboxDBCluster = new BBoxDBCluster(zookeeperEndpoint, clustername);
bboxDBCluster.connect();
if (!bboxDBCluster.isConnected()) {
System.err.println("Unable to connect to zookeeper at: " + zookeeperEndpoint);
System.exit(-1);
}
final int numberOfFilesToLoad = MathUtil.tryParseIntOrExit(args[1], () -> "Unable to parse: " + args[1]);
final DataRedistributionLoader dataRedistributionLoader = new DataRedistributionLoader(args[0], numberOfFilesToLoad, bboxDBCluster);
dataRedistributionLoader.run();
}
use of org.bboxdb.network.client.BBoxDBCluster in project bboxdb by jnidzwetzki.
the class AbstractBenchmark method prepare.
/**
* The default prepare method
*/
protected void prepare() throws Exception {
// Set the benchmark flag to active
benchmarkActive = true;
// Connect to the BBoxDB cluster
final Collection<String> zookeeperNodes = BBoxDBConfigurationManager.getConfiguration().getZookeepernodes();
final String clustername = BBoxDBConfigurationManager.getConfiguration().getClustername();
bboxdbClient = new BBoxDBCluster(zookeeperNodes, clustername);
bboxdbClient.connect();
if (!bboxdbClient.isConnected()) {
throw new Exception("Connection could not be established: " + zookeeperNodes);
}
executorService = Executors.newScheduledThreadPool(10);
}
Aggregations