/** * <code>repeated .exec.bit.control.FragmentStatus fragment_status = 1;</code> */ public org.apache.drill.exec.proto.BitControl.FragmentStatus.Builder addFragmentStatusBuilder( int index) { return getFragmentStatusFieldBuilder().addBuilder( index, org.apache.drill.exec.proto.BitControl.FragmentStatus.getDefaultInstance()); } /**
public org.apache.drill.exec.proto.BitControl.FragmentStatus buildPartial() { org.apache.drill.exec.proto.BitControl.FragmentStatus result = new org.apache.drill.exec.proto.BitControl.FragmentStatus(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (profileBuilder_ == null) { result.profile_ = profile_; } else { result.profile_ = profileBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } if (handleBuilder_ == null) { result.handle_ = handle_; } else { result.handle_ = handleBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, profile_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(2, handle_); } getUnknownFields().writeTo(output); }
com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
public org.apache.drill.exec.proto.BitControl.FragmentStatus buildPartial() { org.apache.drill.exec.proto.BitControl.FragmentStatus result = new org.apache.drill.exec.proto.BitControl.FragmentStatus(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (profileBuilder_ == null) { result.profile_ = profile_; } else { result.profile_ = profileBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } if (handleBuilder_ == null) { result.handle_ = handle_; } else { result.handle_ = handleBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public static MessageLite getResponseDefaultInstance(int rpcType) throws RpcException { switch (rpcType) { case RpcType.ACK_VALUE: return Ack.getDefaultInstance(); case RpcType.HANDSHAKE_VALUE: return BitControlHandshake.getDefaultInstance(); case RpcType.RESP_FRAGMENT_HANDLE_VALUE: return FragmentHandle.getDefaultInstance(); case RpcType.RESP_FRAGMENT_STATUS_VALUE: return FragmentStatus.getDefaultInstance(); case RpcType.RESP_BIT_STATUS_VALUE: return BitStatus.getDefaultInstance(); case RpcType.RESP_QUERY_STATUS_VALUE: return QueryProfile.getDefaultInstance(); case RpcType.RESP_CUSTOM_VALUE: return CustomMessage.getDefaultInstance(); case RpcType.SASL_MESSAGE_VALUE: return SaslMessage.getDefaultInstance(); default: throw new UnsupportedOperationException(); } } }
@Override public void statusUpdate(final FragmentStatus status) { logger.debug("New fragment status was provided to QueryManager of {}", status); switch(status.getProfile().getState()) { case AWAITING_ALLOCATION: case RUNNING: case CANCELLATION_REQUESTED: updateFragmentStatus(status); break; case FAILED: foreman.addToEventQueue(QueryState.FAILED, new UserRemoteException(status.getProfile().getError())); // fall-through. case FINISHED: case CANCELLED: fragmentDone(status); break; default: throw new UnsupportedOperationException(String.format("Received status of %s", status)); } } };
/** * Sends status to remote Foreman node using Control Tunnel or to Local Foreman bypassing * Control Tunnel and using WorkEventBus. * * @param status */ void sendStatus(final FragmentStatus status) { DrillbitEndpoint foremanNode = foremanDrillbit.get(); if (foremanNode == null) { logger.warn("{}: State {} is not reported as {} is closed", QueryIdHelper.getQueryIdentifier(context.getHandle()), status.getProfile().getState(), this); return; } // Send status for both local and remote foreman node via Tunnel. For local there won't be any network connection // created and it will be submitted locally using LocalControlConnectionManager final ControlTunnel tunnel = context.getController().getTunnel(foremanNode); tunnel.sendFragmentStatus(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 int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, profile_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, handle_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.BitControl.BitStatus.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.addFragmentStatus(input.mergeObject(org.apache.drill.exec.proto.BitControl.FragmentStatus.newBuilder(), org.apache.drill.exec.proto.SchemaBitControl.FragmentStatus.MERGE)); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(org.apache.drill.exec.proto.BitControl.BitStatus.Builder builder)
public Builder toBuilder() { return newBuilder(this); }
private FragmentStatus getStatus(final FragmentState state, final UserException ex) { final FragmentStatus.Builder status = FragmentStatus.newBuilder(); final MinorFragmentProfile.Builder b = MinorFragmentProfile.newBuilder(); context.getStats().addMetricsToStatus(b); b.setState(state); if (ex != null) { final boolean verbose = context.getOptions().getOption(ExecConstants.ENABLE_VERBOSE_ERRORS_KEY).bool_val; b.setError(ex.getOrCreatePBError(verbose)); } status.setHandle(context.getHandle()); b.setMemoryUsed(context.getAllocator().getAllocatedMemory()); b.setMinorFragmentId(context.getHandle().getMinorFragmentId()); status.setProfile(b); return status.build(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.BitControl.FragmentStatus prototype) {
private boolean madeProgress(final FragmentStatus prev, final FragmentStatus cur) { final MinorFragmentProfile previous = prev.getProfile(); final MinorFragmentProfile current = cur.getProfile(); if (previous.getState() != current.getState()) { return true; } if (previous.getOperatorProfileCount() != current.getOperatorProfileCount()) { return true; } for(int i =0; i < current.getOperatorProfileCount(); i++){ if (madeProgress(previous.getOperatorProfile(i), current.getOperatorProfile(i))) { return true; } } return false; }
public FragmentState getState() { return status.getProfile().getState(); }
public static Builder newBuilder(org.apache.drill.exec.proto.BitControl.FragmentStatus prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public org.apache.drill.exec.proto.BitControl.FragmentStatus getDefaultInstanceForType() { return org.apache.drill.exec.proto.BitControl.FragmentStatus.getDefaultInstance(); }
public FragmentHandle getHandle() { return status.getHandle(); }
/** * <code>repeated .exec.bit.control.FragmentStatus fragment_status = 1;</code> */ public org.apache.drill.exec.proto.BitControl.FragmentStatus.Builder addFragmentStatusBuilder( int index) { return getFragmentStatusFieldBuilder().addBuilder( index, org.apache.drill.exec.proto.BitControl.FragmentStatus.getDefaultInstance()); } /**