Search in sources :

Example 36 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestStaticgridSpacePartitioner2 method beforeClass.

@BeforeClass
public static void beforeClass() throws ZookeeperException, BBoxDBException {
    distributionGroupZookeeperAdapter = ZookeeperClientFactory.getZookeeperClient().getDistributionGroupAdapter();
    final String config = "[[0.0,1.0]:[0.0,1.0]];0.5;0.5";
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner", config).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) BeforeClass(org.junit.BeforeClass)

Example 37 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestStaticgridSpacePartitioner2 method testInvalidConfiguration4.

@Test(expected = BBoxDBException.class)
public void testInvalidConfiguration4() throws ZookeeperException, BBoxDBException {
    final String config = "";
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner", config).build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 38 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestStaticgridSpacePartitioner2 method testInvalidConfiguration2.

@Test(expected = BBoxDBException.class)
public void testInvalidConfiguration2() throws ZookeeperException, BBoxDBException {
    final String config = "[[0.0,5.0]:[0.0,6.0]];0.5";
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner", config).build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 39 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestStaticgridSpacePartitioner2 method testInvalidConfiguration3.

@Test(expected = BBoxDBException.class)
public void testInvalidConfiguration3() throws ZookeeperException, BBoxDBException {
    final String config = "[[0.0,5.0]:[0.0,6.0]];0.5;0.5;0.5";
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner", config).build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 40 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class GuiModel method updateDistributionRegion.

/**
 * Update the distribution region
 *
 * @throws ZookeeperException
 * @throws ZookeeperNotFoundException
 */
public void updateDistributionRegion() throws ZookeeperException, ZookeeperNotFoundException {
    logger.info("Reread distribution group: {}", distributionGroup);
    if (distributionGroup == null) {
        return;
    }
    // Show wait cursor
    SwingUtilities.invokeLater(() -> {
        if (bboxdbGui.getGlassPane() != null) {
            bboxdbGui.getGlassPane().setVisible(true);
            bboxdbGui.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        }
    });
    // Read distribution group async
    (new Thread(() -> {
        unregisterTreeChangeListener();
        if (distributionGroup == null) {
            spacePartitioner = null;
            return;
        }
        try {
            spacePartitioner = SpacePartitionerCache.getInstance().getSpacePartitionerForGroupName(distributionGroup);
            final DistributionGroupConfiguration config = DistributionGroupConfigurationCache.getInstance().getDistributionGroupConfiguration(distributionGroup);
            spacePartitioner.registerCallback(GuiModel.this);
            final StringBuilder sb = new StringBuilder();
            sb.append("Cluster name: " + getClustername());
            sb.append(", Replication factor: " + config.getReplicationFactor());
            sb.append(", Dimensions: " + config.getDimensions());
            sb.append(", Space partitioner: " + config.getSpacePartitioner());
            bboxdbGui.getStatusLabel().setText(sb.toString());
            logger.info("Read distribution group {} done", distributionGroup);
            // Reset cursor
            SwingUtilities.invokeLater(() -> {
                updateModel();
                if (bboxdbGui.getGlassPane() != null) {
                    final Cursor defaultCursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
                    bboxdbGui.getGlassPane().setCursor(defaultCursor);
                    bboxdbGui.getGlassPane().setVisible(false);
                }
            });
        } catch (Exception e) {
            logger.warn("Got exception", e);
        }
    })).start();
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Cursor(java.awt.Cursor) ZookeeperNotFoundException(org.bboxdb.distribution.zookeeper.ZookeeperNotFoundException) ZookeeperException(org.bboxdb.distribution.zookeeper.ZookeeperException)

Aggregations

DistributionGroupConfiguration (org.bboxdb.storage.entity.DistributionGroupConfiguration)43 Test (org.junit.Test)12 EmptyResultFuture (org.bboxdb.network.client.future.EmptyResultFuture)9 Before (org.junit.Before)7 ZookeeperNotFoundException (org.bboxdb.distribution.zookeeper.ZookeeperNotFoundException)4 BeforeClass (org.junit.BeforeClass)4 BoundingBox (org.bboxdb.commons.math.BoundingBox)3 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)3 ZookeeperException (org.bboxdb.distribution.zookeeper.ZookeeperException)3 BBoxDBException (org.bboxdb.misc.BBoxDBException)3 Tuple (org.bboxdb.storage.entity.Tuple)3 DistributionGroupAdapter (org.bboxdb.distribution.zookeeper.DistributionGroupAdapter)2 ZookeeperClient (org.bboxdb.distribution.zookeeper.ZookeeperClient)2 TupleStoreConfiguration (org.bboxdb.storage.entity.TupleStoreConfiguration)2 Cursor (java.awt.Cursor)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 HashSet (java.util.HashSet)1 Random (java.util.Random)1 InputParseException (org.bboxdb.commons.InputParseException)1