@Override public void onMessage(final ControlMessage.Message message) { switch (message.getType()) { case PipeInit: final ControlMessage.PipeInitMessage pipeInitMessage = message.getPipeInitMsg(); final Pair<String, Long> keyPair = Pair.of(pipeInitMessage.getRuntimeEdgeId(), pipeInitMessage.getSrcTaskIndex()); // Allow to put at most once final Lock lock = runtimeEdgeSrcIndexToLock.get(keyPair); lock.lock(); try { if (null != runtimeEdgeSrcIndexToExecutor.put(keyPair, pipeInitMessage.getExecutorId())) { throw new RuntimeException(keyPair.toString()); } runtimeEdgeSrcIndexToCondition.get(keyPair).signalAll(); } finally { lock.unlock(); } break; default: throw new IllegalMessageException(new Exception(message.toString())); } }
@Override public void onMessage(final ControlMessage.Message message) { switch (message.getType()) { case PipeInit: final ControlMessage.PipeInitMessage pipeInitMessage = message.getPipeInitMsg(); final Pair<String, Long> keyPair = Pair.of(pipeInitMessage.getRuntimeEdgeId(), pipeInitMessage.getSrcTaskIndex()); // Allow to put at most once final Lock lock = runtimeEdgeSrcIndexToLock.get(keyPair); lock.lock(); try { if (null != runtimeEdgeSrcIndexToExecutor.put(keyPair, pipeInitMessage.getExecutorId())) { throw new RuntimeException(keyPair.toString()); } runtimeEdgeSrcIndexToCondition.get(keyPair).signalAll(); } finally { lock.unlock(); } break; default: throw new IllegalMessageException(new Exception(message.toString())); } }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.PipeInitMessage other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.PipeInitMessage.getDefaultInstance()) return this; if (other.hasSrcTaskIndex()) { setSrcTaskIndex(other.getSrcTaskIndex()); } if (other.hasRuntimeEdgeId()) { bitField0_ |= 0x00000002; runtimeEdgeId_ = other.runtimeEdgeId_; onChanged(); } if (other.hasExecutorId()) { bitField0_ |= 0x00000004; executorId_ = other.executorId_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.PipeInitMessage other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.PipeInitMessage.getDefaultInstance()) return this; if (other.hasSrcTaskIndex()) { setSrcTaskIndex(other.getSrcTaskIndex()); } if (other.hasRuntimeEdgeId()) { bitField0_ |= 0x00000002; runtimeEdgeId_ = other.runtimeEdgeId_; onChanged(); } if (other.hasExecutorId()) { bitField0_ |= 0x00000004; executorId_ = other.executorId_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }