Search in sources :

Example 16 with RoutingHop

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

the class InsertTupleHandler method processPackageLocally.

/**
 * @param packageSequence
 * @param clientConnectionHandler
 * @param insertTupleRequest
 * @param routingHeader
 * @throws BBoxDBException
 * @throws RejectedException
 * @throws PackageEncodeException
 */
private void processPackageLocally(final short packageSequence, final ClientConnectionHandler clientConnectionHandler, final InsertTupleRequest insertTupleRequest) throws BBoxDBException, RejectedException, PackageEncodeException {
    final Tuple tuple = insertTupleRequest.getTuple();
    final TupleStoreName requestTable = insertTupleRequest.getTable();
    final TupleStoreManagerRegistry storageRegistry = clientConnectionHandler.getStorageRegistry();
    final RoutingHeader routingHeader = insertTupleRequest.getRoutingHeader();
    final RoutingHop localHop = routingHeader.getRoutingHop();
    PackageRouter.checkLocalSystemNameMatchesAndThrowException(localHop);
    final List<Long> distributionRegions = localHop.getDistributionRegions();
    processInsertPackage(tuple, requestTable, storageRegistry, distributionRegions);
    forwardRoutedPackage(packageSequence, clientConnectionHandler, insertTupleRequest);
}
Also used : TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) RoutingHeader(org.bboxdb.network.routing.RoutingHeader) TupleStoreName(org.bboxdb.storage.entity.TupleStoreName) RoutingHop(org.bboxdb.network.routing.RoutingHop) Tuple(org.bboxdb.storage.entity.Tuple)

Aggregations

RoutingHop (org.bboxdb.network.routing.RoutingHop)16 RoutingHeader (org.bboxdb.network.routing.RoutingHeader)15 BBoxDBInstance (org.bboxdb.distribution.membership.BBoxDBInstance)12 ArrayList (java.util.ArrayList)11 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)10 List (java.util.List)9 NetworkOperationFuture (org.bboxdb.network.client.future.NetworkOperationFuture)8 BBoxDBException (org.bboxdb.misc.BBoxDBException)6 JoinedTupleListFuture (org.bboxdb.network.client.future.JoinedTupleListFuture)6 TupleListFuture (org.bboxdb.network.client.future.TupleListFuture)5 DoNothingDuplicateResolver (org.bboxdb.storage.sstable.duplicateresolver.DoNothingDuplicateResolver)4 Test (org.junit.Test)3 InetSocketAddress (java.net.InetSocketAddress)2 EmptyResultFuture (org.bboxdb.network.client.future.EmptyResultFuture)2 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)2 Tuple (org.bboxdb.storage.entity.Tuple)2 TupleStoreName (org.bboxdb.storage.entity.TupleStoreName)2 HashMap (java.util.HashMap)1 Collectors (java.util.stream.Collectors)1 RejectedException (org.bboxdb.commons.RejectedException)1