use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testMiscMethods.
/**
* Test misc methods
*/
@Test(timeout = 60000)
public void testMiscMethods() {
final BBoxDBClient bboxDBClient = connectToServer().getBboxDBClient();
Assert.assertTrue(bboxDBClient.toString().length() > 10);
Assert.assertTrue(bboxDBClient.getTuplesPerPage() >= -1);
bboxDBClient.isPagingEnabled();
disconnect(bboxDBClient);
}
use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class RegionMerger method mergeDataByNetworkRead.
/**
* Merge the region by a network read
*
* @param region
* @param tupleStoreName
* @param tupleRedistributor
* @param childRegion
* @throws InterruptedException
* @throws StorageManagerException
* @throws Exception
*/
private void mergeDataByNetworkRead(final DistributionRegion region, final TupleStoreName tupleStoreName, final TupleRedistributor tupleRedistributor, final DistributionRegion childRegion) throws InterruptedException, StorageManagerException {
final List<BBoxDBInstance> systems = childRegion.getSystems();
assert (!systems.isEmpty()) : "Systems can not be empty";
final BBoxDBInstance firstSystem = systems.get(0);
final BBoxDBConnection connection = MembershipConnectionService.getInstance().getConnectionForInstance(firstSystem);
assert (connection != null) : "Connection can not be null: " + firstSystem.getStringValue();
final BoundingBox bbox = childRegion.getConveringBox();
final String fullname = tupleStoreName.getFullname();
final BBoxDBClient bboxDBClient = connection.getBboxDBClient();
final TupleListFuture result = bboxDBClient.queryBoundingBox(fullname, bbox);
result.waitForAll();
if (result.isFailed()) {
throw new StorageManagerException("Exception while fetching tuples: " + result.getAllMessages());
}
for (final Tuple tuple : result) {
tupleRedistributor.redistributeTuple(tuple);
}
}
Aggregations