Search in sources :

Example 6 with NetworkOperationFuture

use of org.bboxdb.network.client.future.NetworkOperationFuture in project bboxdb by jnidzwetzki.

the class TestTupleListFuture method getFuture.

/**
 * @return
 */
private static NetworkOperationFuture getFuture() {
    final BBoxDBConnection connection = Mockito.mock(BBoxDBConnection.class);
    final Supplier<NetworkRequestPackage> supplier = () -> (null);
    final NetworkOperationFuture networkOperationFuture = new NetworkOperationFuture(connection, supplier);
    return networkOperationFuture;
}
Also used : NetworkRequestPackage(org.bboxdb.network.packages.NetworkRequestPackage) NetworkOperationFuture(org.bboxdb.network.client.future.NetworkOperationFuture) BBoxDBConnection(org.bboxdb.network.client.BBoxDBConnection)

Example 7 with NetworkOperationFuture

use of org.bboxdb.network.client.future.NetworkOperationFuture in project bboxdb by jnidzwetzki.

the class BBoxDBClient method queryBoundingBox.

/* (non-Javadoc)
	 * @see org.bboxdb.network.client.BBoxDB#queryBoundingBox(java.lang.String, org.bboxdb.storage.entity.BoundingBox)
	 */
@Override
public TupleListFuture queryBoundingBox(final String table, final BoundingBox boundingBox) {
    final RoutingHeader routingHeader = RoutingHeaderHelper.getRoutingHeaderForLocalSystemReadNE(table, boundingBox, false, connection.getServerAddress());
    final NetworkOperationFuture future = getQueryBoundingBoxFuture(table, boundingBox, routingHeader);
    return new TupleListFuture(future, new DoNothingDuplicateResolver(), table);
}
Also used : TupleListFuture(org.bboxdb.network.client.future.TupleListFuture) JoinedTupleListFuture(org.bboxdb.network.client.future.JoinedTupleListFuture) NetworkOperationFuture(org.bboxdb.network.client.future.NetworkOperationFuture) RoutingHeader(org.bboxdb.network.routing.RoutingHeader) DoNothingDuplicateResolver(org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver)

Example 8 with NetworkOperationFuture

use of org.bboxdb.network.client.future.NetworkOperationFuture in project bboxdb by jnidzwetzki.

the class BBoxDBClient method queryJoin.

/* (non-Javadoc)
	 * @see org.bboxdb.network.client.BBoxDB#queryJoin
	 */
@Override
public JoinedTupleListFuture queryJoin(final List<String> tableNames, final BoundingBox boundingBox) {
    final RoutingHeader routingHeader = RoutingHeaderHelper.getRoutingHeaderForLocalSystemReadNE(tableNames.get(0), boundingBox, true, connection.getServerAddress());
    final NetworkOperationFuture future = getJoinFuture(tableNames, boundingBox, routingHeader);
    return new JoinedTupleListFuture(future);
}
Also used : JoinedTupleListFuture(org.bboxdb.network.client.future.JoinedTupleListFuture) NetworkOperationFuture(org.bboxdb.network.client.future.NetworkOperationFuture) RoutingHeader(org.bboxdb.network.routing.RoutingHeader)

Example 9 with NetworkOperationFuture

use of org.bboxdb.network.client.future.NetworkOperationFuture in project bboxdb by jnidzwetzki.

the class BBoxDBClient method getQueryBoundingBoxContinousFuture.

/**
 * @param table
 * @param boundingBox
 * @return
 */
public NetworkOperationFuture getQueryBoundingBoxContinousFuture(final String table, final BoundingBox boundingBox) {
    return new NetworkOperationFuture(connection, () -> {
        final RoutingHeader routingHeaderSupplier = RoutingHeaderHelper.getRoutingHeaderForLocalSystemReadNE(table, boundingBox, false, connection.getServerAddress());
        final short nextSequenceNumber = connection.getNextSequenceNumber();
        return new QueryBoundingBoxContinuousRequest(nextSequenceNumber, routingHeaderSupplier, table, boundingBox);
    });
}
Also used : NetworkOperationFuture(org.bboxdb.network.client.future.NetworkOperationFuture) RoutingHeader(org.bboxdb.network.routing.RoutingHeader) QueryBoundingBoxContinuousRequest(org.bboxdb.network.packages.request.QueryBoundingBoxContinuousRequest)

Example 10 with NetworkOperationFuture

use of org.bboxdb.network.client.future.NetworkOperationFuture in project bboxdb by jnidzwetzki.

the class BBoxDBClient method queryVersionTime.

/* (non-Javadoc)
	 * @see org.bboxdb.network.client.BBoxDB#queryTime(java.lang.String, long)
	 */
@Override
public TupleListFuture queryVersionTime(final String table, final long timestamp) {
    final RoutingHeader routingHeader = RoutingHeaderHelper.getRoutingHeaderForLocalSystemReadNE(table, BoundingBox.FULL_SPACE, true, connection.getServerAddress());
    final NetworkOperationFuture future = getVersionTimeFuture(table, timestamp, routingHeader);
    return new TupleListFuture(future, new DoNothingDuplicateResolver(), table);
}
Also used : TupleListFuture(org.bboxdb.network.client.future.TupleListFuture) JoinedTupleListFuture(org.bboxdb.network.client.future.JoinedTupleListFuture) NetworkOperationFuture(org.bboxdb.network.client.future.NetworkOperationFuture) RoutingHeader(org.bboxdb.network.routing.RoutingHeader) DoNothingDuplicateResolver(org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver)

Aggregations

NetworkOperationFuture (org.bboxdb.network.client.future.NetworkOperationFuture)31 RoutingHeader (org.bboxdb.network.routing.RoutingHeader)16 List (java.util.List)12 JoinedTupleListFuture (org.bboxdb.network.client.future.JoinedTupleListFuture)12 TupleListFuture (org.bboxdb.network.client.future.TupleListFuture)11 DoNothingDuplicateResolver (org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver)9 ArrayList (java.util.ArrayList)8 BBoxDBInstance (org.bboxdb.distribution.membership.BBoxDBInstance)8 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)8 RoutingHop (org.bboxdb.network.routing.RoutingHop)8 Test (org.junit.Test)8 OperationFutureImpl (org.bboxdb.network.client.future.OperationFutureImpl)6 EmptyResultFuture (org.bboxdb.network.client.future.EmptyResultFuture)5 BBoxDBException (org.bboxdb.misc.BBoxDBException)4 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)3 BBoxDBConnection (org.bboxdb.network.client.BBoxDBConnection)2 NetworkRequestPackage (org.bboxdb.network.packages.NetworkRequestPackage)2 Tuple (org.bboxdb.storage.entity.Tuple)2 IOException (java.io.IOException)1 SocketException (java.net.SocketException)1