@Override
 public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
     throws Throwable {
   Object key = command.getKey();
   if (isStoreAsBinary() || getMightGoRemote(ctx, key)) checkMarshallable(key);
   return super.visitGetKeyValueCommand(ctx, command);
 }
 @Override
 public BasicInvocationStage visitGetKeyValueCommand(
     InvocationContext ctx, GetKeyValueCommand command) throws Throwable {
   if (streamSummaryContainer.isEnabled() && ctx.isOriginLocal()) {
     streamSummaryContainer.addGet(command.getKey(), command.getRemotelyFetchedValue() != null);
   }
   return invokeNext(ctx, command);
 }
Пример #3
0
 @Override
 public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
     throws Throwable {
   if (trace) log.trace("Executing command: " + command + ".");
   Object ret = command.perform(ctx);
   if (ret != null) {
     notifyCacheEntryVisit(ctx, command, command.getKey(), ret);
   }
   return ret;
 }
  @Override
  public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
      throws Throwable {
    try {
      Object returnValue = invokeNextInterceptor(ctx, command);
      // If L1 caching is enabled, this is a remote command, and we found a value in our cache
      // we store it so that we can later invalidate it
      if (returnValue != null && isL1CacheEnabled && !ctx.isOriginLocal())
        l1Manager.addRequestor(command.getKey(), ctx.getOrigin());

      // need to check in the context as well since a null retval is not necessarily an indication
      // of the entry not being
      // available.  It could just have been removed in the same tx beforehand.  Also don't bother
      // with a remote get if
      // the entry is mapped to the local node.
      if (needsRemoteGet(ctx, command.getKey(), returnValue == null))
        returnValue = remoteGetAndStoreInL1(ctx, command.getKey(), false);
      return returnValue;
    } catch (SuspectException e) {
      // retry
      return visitGetKeyValueCommand(ctx, command);
    }
  }
 @Override
 public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
     throws Throwable {
   try {
     Object returnValue = invokeNextInterceptor(ctx, command);
     if (needsRemoteGet(ctx, command, returnValue == null)) {
       Object key = command.getKey();
       returnValue = shouldFetchFromRemote(ctx, key) ? remoteGet(ctx, key, command) : null;
     }
     return returnValue;
   } catch (SuspectException e) {
     // retry
     return visitGetKeyValueCommand(ctx, command);
   }
 }