示例#1
0
 // Start an RPC to fetch a Value, handling short-cutting dup-fetches
 static RPC<TaskGetKey> start(H2ONode target, Key key) {
   // Do we have an old TaskGetKey in-progress?
   RPC<TaskGetKey> old = TGKS.get(key);
   if (old != null) return old;
   // Make a new TGK.
   RPC<TaskGetKey> rpc = new RPC(target, new TaskGetKey(key), 1.0f);
   if ((old = TGKS.putIfMatchUnlocked(key, rpc, null)) != null)
     return old; // Failed because an old exists
   rpc.setTaskNum().call(); // Start the op
   return rpc; // Successful install of a fresh RPC
 }
示例#2
0
文件: RPC.java 项目: liaochy/h2o-3
 // Make a remotely executed FutureTask.  Must name the remote target as well
 // as the remote function.  This function is expected to be subclassed.
 public RPC(H2ONode target, V dtask) {
   this(target, dtask, 1.0f);
   setTaskNum();
 }