Search in sources :

Example 1 with DoNothingDuplicateResolver

use of org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver 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 2 with DoNothingDuplicateResolver

use of org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver 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)

Example 3 with DoNothingDuplicateResolver

use of org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver in project bboxdb by jnidzwetzki.

the class BBoxDBCluster method queryVersionTime.

@Override
public TupleListFuture queryVersionTime(final String table, final long timestamp) throws BBoxDBException {
    if (membershipConnectionService.getNumberOfConnections() == 0) {
        throw new BBoxDBException("queryTime called, but connection list is empty");
    }
    if (logger.isDebugEnabled()) {
        logger.debug("Query by for timestamp {} in table {}", timestamp, table);
    }
    final DistributionRegion distributionRegion = getRootNode(table);
    final Supplier<List<NetworkOperationFuture>> futureProvider = () -> {
        final List<RoutingHop> hops = RoutingHopHelper.getRoutingHopsForRead(distributionRegion, BoundingBox.FULL_SPACE);
        final List<NetworkOperationFuture> futures = new ArrayList<>();
        for (final RoutingHop hop : hops) {
            final BBoxDBInstance instance = hop.getDistributedInstance();
            final BBoxDBConnection connection = membershipConnectionService.getConnectionForInstance(instance);
            final RoutingHeader routingHeader = new RoutingHeader((short) 0, Arrays.asList(hop));
            final NetworkOperationFuture future = connection.getBboxDBClient().getVersionTimeFuture(table, timestamp, routingHeader);
            futures.add(future);
        }
        return futures;
    };
    return new TupleListFuture(futureProvider, new DoNothingDuplicateResolver(), table);
}
Also used : DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) 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) ArrayList(java.util.ArrayList) List(java.util.List) RoutingHop(org.bboxdb.network.routing.RoutingHop) BBoxDBInstance(org.bboxdb.distribution.membership.BBoxDBInstance) BBoxDBException(org.bboxdb.misc.BBoxDBException)

Example 4 with DoNothingDuplicateResolver

use of org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver in project bboxdb by jnidzwetzki.

the class BBoxDBCluster method queryBoundingBox.

@Override
public TupleListFuture queryBoundingBox(final String table, final BoundingBox boundingBox) throws BBoxDBException {
    if (logger.isDebugEnabled()) {
        logger.debug("Query by for bounding box {} in table {}", boundingBox, table);
    }
    final DistributionRegion distributionRegion = getRootNode(table);
    final Supplier<List<NetworkOperationFuture>> futureProvider = () -> {
        final List<RoutingHop> hops = RoutingHopHelper.getRoutingHopsForRead(distributionRegion, boundingBox);
        final List<NetworkOperationFuture> futures = new ArrayList<>();
        for (final RoutingHop hop : hops) {
            final BBoxDBInstance instance = hop.getDistributedInstance();
            final BBoxDBConnection connection = membershipConnectionService.getConnectionForInstance(instance);
            final RoutingHeader routingHeader = new RoutingHeader((short) 0, Arrays.asList(hop));
            final NetworkOperationFuture future = connection.getBboxDBClient().getQueryBoundingBoxFuture(table, boundingBox, routingHeader);
            futures.add(future);
        }
        return futures;
    };
    return new TupleListFuture(futureProvider, new DoNothingDuplicateResolver(), table);
}
Also used : DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) 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) ArrayList(java.util.ArrayList) List(java.util.List) RoutingHop(org.bboxdb.network.routing.RoutingHop) BBoxDBInstance(org.bboxdb.distribution.membership.BBoxDBInstance)

Example 5 with DoNothingDuplicateResolver

use of org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver in project bboxdb by jnidzwetzki.

the class BBoxDBClient method queryInsertedTime.

/* (non-Javadoc)
	 * @see org.bboxdb.network.client.BBoxDB#queryTime(java.lang.String, long)
	 */
@Override
public TupleListFuture queryInsertedTime(final String table, final long timestamp) {
    final RoutingHeader routingHeader = RoutingHeaderHelper.getRoutingHeaderForLocalSystemReadNE(table, BoundingBox.FULL_SPACE, true, connection.getServerAddress());
    final NetworkOperationFuture future = getInsertedTimeFuture(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

DoNothingDuplicateResolver (org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver)11 NetworkOperationFuture (org.bboxdb.network.client.future.NetworkOperationFuture)9 TupleListFuture (org.bboxdb.network.client.future.TupleListFuture)9 JoinedTupleListFuture (org.bboxdb.network.client.future.JoinedTupleListFuture)8 RoutingHeader (org.bboxdb.network.routing.RoutingHeader)8 ArrayList (java.util.ArrayList)5 List (java.util.List)4 BBoxDBInstance (org.bboxdb.distribution.membership.BBoxDBInstance)4 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)4 RoutingHop (org.bboxdb.network.routing.RoutingHop)4 BBoxDBException (org.bboxdb.misc.BBoxDBException)3 Tuple (org.bboxdb.storage.entity.Tuple)2 Test (org.junit.Test)2 TupleStoreAdapter (org.bboxdb.distribution.zookeeper.TupleStoreAdapter)1 ZookeeperException (org.bboxdb.distribution.zookeeper.ZookeeperException)1 BBoxDBConnection (org.bboxdb.network.client.BBoxDBConnection)1 TupleListFutureStore (org.bboxdb.network.client.tools.TupleListFutureStore)1 NetworkRequestPackage (org.bboxdb.network.packages.NetworkRequestPackage)1 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)1 JoinedTuple (org.bboxdb.storage.entity.JoinedTuple)1