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