コード例 #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);
 }
コード例 #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);
   }
 }
コード例 #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);
 }