Exemplo n.º 1
0
 public Response<IdAllocation> allocateIds(IdType idType) {
   IdGenerator generator = graphDb.getIdGeneratorFactory().get(idType);
   IdAllocation result =
       new IdAllocation(
           generator.nextIdBatch(ID_GRAB_SIZE), generator.getHighId(), generator.getDefragCount());
   return ServerUtil.packResponseWithoutTransactionStream(graphDb.getStoreId(), result);
 }
Exemplo n.º 2
0
 public Response<Pair<Integer, Long>> getMasterIdForCommittedTx(long txId, StoreId storeId) {
   XaDataSource nioneoDataSource = graphDb.getXaDataSourceManager().getNeoStoreDataSource();
   try {
     Pair<Integer, Long> masterId = nioneoDataSource.getMasterForCommittedTx(txId);
     return ServerUtil.packResponseWithoutTransactionStream(graphDb.getStoreId(), masterId);
   } catch (IOException e) {
     throw new RuntimeException("Couldn't get master ID for " + txId, e);
   }
 }
Exemplo n.º 3
0
 @Override
 public Response<Void> pushTransaction(RequestContext context, String resourceName, long tx) {
   graphDb
       .getTxIdGenerator()
       .committed(
           graphDb.getXaDataSourceManager().getXaDataSource(resourceName),
           context.getEventIdentifier(),
           tx,
           context.machineId());
   return new Response<Void>(
       null, graphDb.getStoreId(), TransactionStream.EMPTY, ResourceReleaser.NO_OP);
 }