Search in sources :

Example 6 with BBoxDBCluster

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();
}
Also used : BBoxDB(org.bboxdb.network.client.BBoxDB) BoundingBox(org.bboxdb.commons.math.BoundingBox) BBoxDBCluster(org.bboxdb.network.client.BBoxDBCluster)

Example 7 with BBoxDBCluster

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();
}
Also used : BBoxDBCluster(org.bboxdb.network.client.BBoxDBCluster)

Example 8 with BBoxDBCluster

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);
}
Also used : BBoxDBCluster(org.bboxdb.network.client.BBoxDBCluster)

Aggregations

BBoxDBCluster (org.bboxdb.network.client.BBoxDBCluster)8 BoundingBox (org.bboxdb.commons.math.BoundingBox)2 BBoxDB (org.bboxdb.network.client.BBoxDB)2 ArrayList (java.util.ArrayList)1 EmptyResultFuture (org.bboxdb.network.client.future.EmptyResultFuture)1 TupleListFuture (org.bboxdb.network.client.future.TupleListFuture)1 DistributionGroupConfiguration (org.bboxdb.storage.entity.DistributionGroupConfiguration)1 Tuple (org.bboxdb.storage.entity.Tuple)1 TupleStoreConfiguration (org.bboxdb.storage.entity.TupleStoreConfiguration)1 Test (org.junit.Test)1