public void statusUpdate(final FragmentStatus status) { final FragmentStatusListener listener = listeners.get(status.getHandle().getQueryId()); if (listener == null) { logger.warn("A fragment message arrived but there was no registered listener for that message: {}.", status); } else { listener.statusUpdate(status); } }
private boolean updateFragmentStatus(final FragmentStatus fragmentStatus) { final FragmentHandle fragmentHandle = fragmentStatus.getHandle(); final int majorFragmentId = fragmentHandle.getMajorFragmentId(); final int minorFragmentId = fragmentHandle.getMinorFragmentId(); final FragmentData data = fragmentDataMap.get(majorFragmentId).get(minorFragmentId); final FragmentState oldState = data.getState(); final boolean inTerminalState = isTerminal(oldState); final FragmentState currentState = fragmentStatus.getProfile().getState(); if (inTerminalState || (oldState == FragmentState.CANCELLATION_REQUESTED && !isTerminal(currentState))) { // Already in a terminal state, or invalid state transition from CANCELLATION_REQUESTED. This shouldn't happen. logger.warn(String.format("Received status message for fragment %s after fragment was in state %s. New state was %s", QueryIdHelper.getQueryIdentifier(fragmentHandle), oldState, currentState)); return false; } data.setStatus(fragmentStatus); return oldState != currentState; }
public FragmentHandle getHandle() { return status.getHandle(); }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.BitControl.FragmentStatus message) throws java.io.IOException { if(message.hasProfile()) output.writeObject(1, message.getProfile(), org.apache.drill.exec.proto.SchemaUserBitShared.MinorFragmentProfile.WRITE, false); if(message.hasHandle()) output.writeObject(2, message.getHandle(), org.apache.drill.exec.proto.SchemaExecProtos.FragmentHandle.WRITE, false); } public boolean isInitialized(org.apache.drill.exec.proto.BitControl.FragmentStatus message)
public Builder mergeFrom(org.apache.drill.exec.proto.BitControl.FragmentStatus other) { if (other == org.apache.drill.exec.proto.BitControl.FragmentStatus.getDefaultInstance()) return this; if (other.hasProfile()) { mergeProfile(other.getProfile()); } if (other.hasHandle()) { mergeHandle(other.getHandle()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.BitControl.FragmentStatus message) throws java.io.IOException { if(message.hasProfile()) output.writeObject(1, message.getProfile(), org.apache.drill.exec.proto.SchemaUserBitShared.MinorFragmentProfile.WRITE, false); if(message.hasHandle()) output.writeObject(2, message.getHandle(), org.apache.drill.exec.proto.SchemaExecProtos.FragmentHandle.WRITE, false); } public boolean isInitialized(org.apache.drill.exec.proto.BitControl.FragmentStatus message)
public Builder mergeFrom(org.apache.drill.exec.proto.BitControl.FragmentStatus other) { if (other == org.apache.drill.exec.proto.BitControl.FragmentStatus.getDefaultInstance()) return this; if (other.hasProfile()) { mergeProfile(other.getProfile()); } if (other.hasHandle()) { mergeHandle(other.getHandle()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }