Search in sources :

Example 11 with RoutingHeader

use of org.bboxdb.network.routing.RoutingHeader in project bboxdb by jnidzwetzki.

the class TestRoutingHeader method testRoutingHeaderHopParser1.

/**
 * Test the hop parser
 */
@Test(timeout = 60000)
public void testRoutingHeaderHopParser1() {
    final RoutingHeader routingHeader = new RoutingHeader((short) 0, new ArrayList<RoutingHop>());
    // Get routing list as string and parse list
    final String stringRoutingList = routingHeader.getRoutingListAsString();
    routingHeader.setRoutingList(stringRoutingList);
    final List<RoutingHop> parsedRoutingList = routingHeader.getRoutingList();
    Assert.assertEquals(0, parsedRoutingList.size());
}
Also used : RoutingHeader(org.bboxdb.network.routing.RoutingHeader) RoutingHop(org.bboxdb.network.routing.RoutingHop) Test(org.junit.Test)

Example 12 with RoutingHeader

use of org.bboxdb.network.routing.RoutingHeader 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 13 with RoutingHeader

use of org.bboxdb.network.routing.RoutingHeader 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 14 with RoutingHeader

use of org.bboxdb.network.routing.RoutingHeader 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 15 with RoutingHeader

use of org.bboxdb.network.routing.RoutingHeader 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

RoutingHeader (org.bboxdb.network.routing.RoutingHeader)52 Test (org.junit.Test)18 NetworkOperationFuture (org.bboxdb.network.client.future.NetworkOperationFuture)16 RoutingHop (org.bboxdb.network.routing.RoutingHop)15 ArrayList (java.util.ArrayList)12 JoinedTupleListFuture (org.bboxdb.network.client.future.JoinedTupleListFuture)12 BBoxDBInstance (org.bboxdb.distribution.membership.BBoxDBInstance)11 PackageEncodeException (org.bboxdb.network.packages.PackageEncodeException)11 Tuple (org.bboxdb.storage.entity.Tuple)11 TupleStoreName (org.bboxdb.storage.entity.TupleStoreName)11 List (java.util.List)10 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)10 TupleListFuture (org.bboxdb.network.client.future.TupleListFuture)10 ByteBuffer (java.nio.ByteBuffer)9 InsertTupleRequest (org.bboxdb.network.packages.request.InsertTupleRequest)9 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)9 DoNothingDuplicateResolver (org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver)8 BoundingBox (org.bboxdb.commons.math.BoundingBox)6 BBoxDBException (org.bboxdb.misc.BBoxDBException)6 JoinedTuple (org.bboxdb.storage.entity.JoinedTuple)6