public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.QueryProfile other) { if (other == org.apache.drill.exec.proto.UserBitShared.QueryProfile.getDefaultInstance()) return this; if (other.hasId()) { mergeId(other.getId()); if (other.hasType()) { setType(other.getType()); if (other.hasStart()) { setStart(other.getStart()); if (other.hasEnd()) { setEnd(other.getEnd()); if (other.hasQuery()) { bitField0_ |= 0x00000010; query_ = other.query_; onChanged(); if (other.hasPlan()) { bitField0_ |= 0x00000020; plan_ = other.plan_; onChanged(); if (other.hasForeman()) { mergeForeman(other.getForeman()); if (other.hasState()) { setState(other.getState());
public ProfileWrapper(final QueryProfile profile, DrillConfig drillConfig) { this.profile = profile; this.id = profile.hasQueryId() ? profile.getQueryId() : QueryIdHelper.getQueryId(profile.getId()); String profileTextPlan = profile.hasPlan()? profile.getPlan(): ""; generateOpMap(profileTextPlan); final List<MajorFragmentProfile> majors = new ArrayList<>(profile.getFragmentProfileList()); Collections.sort(majors, Comparators.majorId); fragmentProfiles.add(new FragmentWrapper(major, profile.getStart())); options = mapper.readValue(profile.getOptionsJson(), OptionList.class); } catch (Exception e) { logger.error("Unable to deserialize query options", e);
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.QueryProfile other) { if (other == org.apache.drill.exec.proto.UserBitShared.QueryProfile.getDefaultInstance()) return this; if (other.hasId()) { mergeId(other.getId()); if (other.hasType()) { setType(other.getType()); if (other.hasStart()) { setStart(other.getStart()); if (other.hasEnd()) { setEnd(other.getEnd()); if (other.hasQuery()) { bitField0_ |= 0x00000010; query_ = other.query_; onChanged(); if (other.hasPlan()) { bitField0_ |= 0x00000020; plan_ = other.plan_; onChanged(); if (other.hasForeman()) { mergeForeman(other.getForeman()); if (other.hasState()) { setState(other.getState());
final Map.Entry<String, QueryProfile> profileEntry = range.next(); final QueryProfile profile = profileEntry.getValue(); if (principal.canManageProfileOf(profile.getUser())) { finishedQueries.add( new ProfileInfo(work.getContext().getConfig(), profileEntry.getKey(), profile.getStart(), profile.getEnd(), profile.getForeman().getAddress(), profile.getQuery(), ProfileUtil.getQueryStateDisplayName(profile.getState()), profile.getUser(), profile.getTotalCost(), profile.getQueueName()));
public String getExecutionDuration() { if (profile.getState() == QueryState.PREPARING || profile.getState() == QueryState.PLANNING || profile.getState() == QueryState.STARTING || profile.getState() == QueryState.ENQUEUED) { return NOT_AVAILABLE_LABEL; if (profile.getState() == QueryState.RUNNING) { queryEndTime = System.currentTimeMillis(); } else { queryEndTime = profile.getEnd(); if (profile.getQueueWaitEnd() > 0L) { return (new SimpleDurationFormat(profile.getQueueWaitEnd(), queryEndTime)).verbose(); if (profile.getPlanEnd() > 0L) { return (new SimpleDurationFormat(profile.getPlanEnd(), queryEndTime)).verbose(); if (profile.getFragmentProfileCount() > 0) { MajorFragmentProfile majorFrag0 = profile.getFragmentProfile(0);
if(message.hasId()) output.writeObject(1, message.getId(), org.apache.drill.exec.proto.SchemaUserBitShared.QueryId.WRITE, false); if(message.hasType()) output.writeEnum(2, message.getType().getNumber(), false); if(message.hasStart()) output.writeInt64(3, message.getStart(), false); if(message.hasEnd()) output.writeInt64(4, message.getEnd(), false); if(message.hasQuery()) output.writeString(5, message.getQuery(), false); if(message.hasPlan()) output.writeString(6, message.getPlan(), false); if(message.hasForeman()) output.writeObject(7, message.getForeman(), org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.WRITE, false); if(message.hasState()) output.writeEnum(8, message.getState().getNumber(), false); if(message.hasTotalFragments()) output.writeInt32(9, message.getTotalFragments(), false); if(message.hasFinishedFragments()) output.writeInt32(10, message.getFinishedFragments(), false); for(org.apache.drill.exec.proto.UserBitShared.MajorFragmentProfile fragmentProfile : message.getFragmentProfileList()) output.writeObject(11, fragmentProfile, org.apache.drill.exec.proto.SchemaUserBitShared.MajorFragmentProfile.WRITE, true); if(message.hasUser()) output.writeString(12, message.getUser(), false); if(message.hasError()) output.writeString(13, message.getError(), false);
@Nullable @Override public ProfileInfo apply(@Nullable Entry<String, UserBitShared.QueryProfile> input) { if (input == null || input.getValue() == null) { return ProfileInfo.getDefault(); } //Constructing ProfileInfo final String queryID = input.getKey(); final QueryProfile profile = input.getValue(); //For cases where query was never queued final long assumedQueueEndTime = profile.getQueueWaitEnd()> 0 ? profile.getQueueWaitEnd() : profile.getPlanEnd(); return new ProfileInfo( queryID, new Timestamp(profile.getStart()), profile.getForeman().getAddress(), profile.getTotalFragments(), profile.getUser(), profile.getQueueName(), computeDuration(profile.getStart(), profile.getPlanEnd()), computeDuration(profile.getPlanEnd(), assumedQueueEndTime), computeDuration(assumedQueueEndTime, profile.getEnd()), profile.getState().name(), profile.getQuery() ); } });
public String getPlanningDuration() { //Check if Planning End is known if (profile.getPlanEnd() > 0L) { return (new SimpleDurationFormat(profile.getStart(), profile.getPlanEnd())).verbose(); } //Check if any fragments have started if (profile.getFragmentProfileCount() > 0) { //Init Planning End Time long estimatedPlanEnd = Long.MAX_VALUE; //Using Screen MajorFragment as reference MajorFragmentProfile majorFrag0 = profile.getFragmentProfile(0); //Searching for earliest starting fragment for (MinorFragmentProfile fragmentWrapper : majorFrag0.getMinorFragmentProfileList()) { long minorFragmentStart = fragmentWrapper.getStartTime(); if (minorFragmentStart > 0 && minorFragmentStart < estimatedPlanEnd) { estimatedPlanEnd = minorFragmentStart; } } //Provide estimated plan time return (new SimpleDurationFormat(profile.getStart(), estimatedPlanEnd)).verbose() + ESTIMATED_LABEL; } //Unable to estimate/calculate Specific Time spent in Planning return NOT_AVAILABLE_LABEL; }
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(); } } }
public org.apache.drill.exec.proto.UserBitShared.QueryProfile getDefaultInstanceForType() { return org.apache.drill.exec.proto.UserBitShared.QueryProfile.getDefaultInstance(); }
/** * <code>optional string verboseError = 14;</code> */ public Builder clearVerboseError() { bitField0_ = (bitField0_ & ~0x00002000); verboseError_ = getDefaultInstance().getVerboseError(); onChanged(); return this; } /**
/** * <code>optional string query = 5;</code> */ public Builder clearQuery() { bitField0_ = (bitField0_ & ~0x00000010); query_ = getDefaultInstance().getQuery(); onChanged(); return this; } /**
public String getQueuedDuration() { //Check if State is ENQUEUED if (profile.getState() == QueryState.ENQUEUED) { return (new SimpleDurationFormat(profile.getPlanEnd(), System.currentTimeMillis())).verbose(); } //Check if Queue Wait End is known if (profile.getQueueWaitEnd() > 0L) { return (new SimpleDurationFormat(profile.getPlanEnd(), profile.getQueueWaitEnd())).verbose(); } //Unable to estimate/calculate Specific Time spent in Queue return NOT_AVAILABLE_LABEL; }
/** * <code>optional string plan = 6;</code> */ public Builder clearPlan() { bitField0_ = (bitField0_ & ~0x00000020); plan_ = getDefaultInstance().getPlan(); onChanged(); return this; } /**
/** * <code>optional string queryId = 22;</code> */ public Builder clearQueryId() { bitField0_ = (bitField0_ & ~0x00200000); queryId_ = getDefaultInstance().getQueryId(); onChanged(); return this; } /**
/** * <code>optional string user = 12 [default = "-"];</code> */ public Builder clearUser() { bitField0_ = (bitField0_ & ~0x00000800); user_ = getDefaultInstance().getUser(); onChanged(); return this; } /**
/** * <code>optional string options_json = 17;</code> */ public Builder clearOptionsJson() { bitField0_ = (bitField0_ & ~0x00010000); optionsJson_ = getDefaultInstance().getOptionsJson(); onChanged(); return this; } /**