Esempio n. 1
0
 protected Object getInternal(Data key) {
   // todo action for read-backup true is not well tested.
   if (getMapConfig().isReadBackupData()) {
     Object fromBackup = readBackupDataOrNull(key);
     if (fromBackup != null) {
       return fromBackup;
     }
   }
   MapOperation operation = operationProvider.createGetOperation(name, key);
   operation.setThreadId(ThreadUtil.getThreadId());
   return invokeOperation(key, operation);
 }
Esempio n. 2
0
  protected ICompletableFuture<Data> getAsyncInternal(Data key) {
    int partitionId = partitionService.getPartitionId(key);

    MapOperation operation = operationProvider.createGetOperation(name, key);
    try {
      long startTime = System.currentTimeMillis();
      InternalCompletableFuture<Data> future =
          operationService
              .createInvocationBuilder(SERVICE_NAME, operation, partitionId)
              .setResultDeserialized(false)
              .invoke();

      if (statisticsEnabled) {
        future.andThen(new IncrementStatsExecutionCallback<Data>(operation, startTime));
      }

      return future;
    } catch (Throwable t) {
      throw rethrow(t);
    }
  }