use of org.bboxdb.network.client.BBoxDBConnection in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testInsertedTimeQuery.
/**
* Execute the version inserted query
* @throws BBoxDBException
* @throws InterruptedException
*/
@Test(timeout = 60000)
public void testInsertedTimeQuery() throws InterruptedException, BBoxDBException {
final BBoxDBConnection bboxdbConnection = connectToServer();
final BBoxDBClient bboxDBClient = bboxdbConnection.getBboxDBClient();
NetworkQueryHelper.testInsertedTimeQuery(bboxDBClient, DISTRIBUTION_GROUP);
disconnect(bboxDBClient);
}
use of org.bboxdb.network.client.BBoxDBConnection in project bboxdb by jnidzwetzki.
the class TestTupleListFuture method testRejectedExeption.
@Test(expected = RejectedException.class)
public void testRejectedExeption() throws InterruptedException, RejectedException {
final TupleListFutureStore tupleListFutureStore = new TupleListFutureStore();
tupleListFutureStore.shutdown();
final BBoxDBConnection connection = Mockito.mock(BBoxDBConnection.class);
final Supplier<NetworkRequestPackage> supplier = () -> (null);
final NetworkOperationFuture networkOperationFuture = new NetworkOperationFuture(connection, supplier);
tupleListFutureStore.put(new TupleListFuture(networkOperationFuture, new DoNothingDuplicateResolver(), ""));
}
use of org.bboxdb.network.client.BBoxDBConnection in project bboxdb by jnidzwetzki.
the class TestClient method testSettleRequests2.
/**
* Test the settle requests method 2
*/
@Test(timeout = 10000)
public void testSettleRequests2() {
final BBoxDBConnection client = Mockito.spy(BBoxDBConnection.class);
Mockito.when(client.getInFlightCalls()).thenReturn(10);
client.settlePendingCalls(1000);
Mockito.verify(client, Mockito.atLeast(1)).getInFlightCalls();
}
use of org.bboxdb.network.client.BBoxDBConnection in project bboxdb by jnidzwetzki.
the class TestClient method testMisc.
/**
* Test misc methods
*/
@Test(timeout = 10000)
public void testMisc() {
final BBoxDBConnection bBoxDBConnection = new BBoxDBConnection();
bBoxDBConnection.setMaxInFlightCalls((short) 1000);
Assert.assertEquals(1000, bBoxDBConnection.getMaxInFlightCalls());
}
use of org.bboxdb.network.client.BBoxDBConnection in project bboxdb by jnidzwetzki.
the class DistributedRecoveryService method handleOutdatedRegions.
/**
* Handle the outdated distribution regions
* @param distributionGroupName
* @param outdatedRegions
*/
protected void handleOutdatedRegions(final String distributionGroupName, final List<OutdatedDistributionRegion> outdatedRegions) {
for (final OutdatedDistributionRegion outdatedDistributionRegion : outdatedRegions) {
final BBoxDBConnection connection = MembershipConnectionService.getInstance().getConnectionForInstance(outdatedDistributionRegion.getNewestInstance());
final long regionId = outdatedDistributionRegion.getDistributedRegion().getRegionId();
final List<TupleStoreName> allTables = TupleStoreUtil.getAllTablesForDistributionGroupAndRegionId(storageRegistry, distributionGroupName, regionId);
for (final TupleStoreName ssTableName : allTables) {
try {
runRecoveryForTable(ssTableName, outdatedDistributionRegion, connection.getBboxDBClient());
} catch (RejectedException | StorageManagerException | ExecutionException e) {
logger.error("Got an exception while performing recovery for table: " + ssTableName.getFullname());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.error("Got an exception while performing recovery for table: " + ssTableName.getFullname());
}
}
}
}
Aggregations