/** * <code>optional .exec.bit.control.FragmentPriority priority = 18;</code> */ public Builder mergePriority(com.dremio.exec.proto.CoordExecRPC.FragmentPriority value) { if (priorityBuilder_ == null) { if (((bitField0_ & 0x00008000) == 0x00008000) && priority_ != com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance()) { priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.newBuilder(priority_).mergeFrom(value).buildPartial(); } else { priority_ = value; } onChanged(); } else { priorityBuilder_.mergeFrom(value); } bitField0_ |= 0x00008000; return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasWorkloadClass()) { hash = (37 * hash) + WORKLOAD_CLASS_FIELD_NUMBER; hash = (53 * hash) + hashEnum(getWorkloadClass()); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, workloadClass_.getNumber()); } getUnknownFields().writeTo(output); }
if (hasPriority()) { result = result && getPriority() .equals(other.getPriority());
builder.setPriority(input.mergeObject(com.dremio.exec.proto.CoordExecRPC.FragmentPriority.newBuilder(), com.dremio.exec.proto.SchemaCoordExecRPC.FragmentPriority.MERGE));
priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance(); } else { priorityBuilder_.clear();
resourceSchedulingDecisionInfo.setQueueName(queueType.name()); resourceSchedulingDecisionInfo.setQueueId(queueType.name()); resourceSchedulingDecisionInfo.setWorkloadClass(queryContext.getQueryContextInfo().getPriority().getWorkloadClass());
if (hasPriority()) { result = result && getPriority() .equals(other.getPriority());
break; case 4: builder.setPriority(input.mergeObject(com.dremio.exec.proto.CoordExecRPC.FragmentPriority.newBuilder(), com.dremio.exec.proto.SchemaCoordExecRPC.FragmentPriority.MERGE));
/** * Create QueryContextInformation with given <i>defaultSchemaName</i>. Rest of the members of the * QueryContextInformation is derived from the current state of the process. * * @param defaultSchemaName * @return */ public static QueryContextInformation createQueryContextInfo(final String defaultSchemaName, QueryPriority priority, long maxAllocation) { final long queryStartTime = System.currentTimeMillis(); final int timeZone = DateUtility.getIndex(System.getProperty("user.timezone")); FragmentPriority.Builder priorityBuilder = FragmentPriority.newBuilder(); if(priority != null){ priorityBuilder.setWorkloadClass(priority.getWorkloadClass()); } else { priorityBuilder.setWorkloadClass(WorkloadClass.GENERAL); } return QueryContextInformation.newBuilder() .setDefaultSchemaName(defaultSchemaName) .setQueryStartTime(queryStartTime) .setTimeZone(timeZone) .setPriority(priorityBuilder) .setQueryMaxAllocation(maxAllocation) .build(); }
private void initFields() { handle_ = com.dremio.exec.proto.ExecProtos.FragmentHandle.getDefaultInstance(); networkCost_ = 0F; cpuCost_ = 0F; diskCost_ = 0F; memoryCost_ = 0F; fragmentJson_ = com.google.protobuf.ByteString.EMPTY; leafFragment_ = false; assignment_ = com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.getDefaultInstance(); foreman_ = com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.getDefaultInstance(); memInitial_ = 20000000L; memMax_ = 2000000000L; credentials_ = com.dremio.exec.proto.UserBitShared.UserCredentials.getDefaultInstance(); optionsJson_ = com.google.protobuf.ByteString.EMPTY; context_ = com.dremio.exec.proto.CoordExecRPC.QueryContextInformation.getDefaultInstance(); collector_ = java.util.Collections.emptyList(); priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance(); fragmentCodec_ = com.dremio.exec.proto.CoordExecRPC.FragmentCodec.NONE; allAssignment_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1;
public Builder clear() { super.clear(); queryStartTime_ = 0L; bitField0_ = (bitField0_ & ~0x00000001); timeZone_ = 0; bitField0_ = (bitField0_ & ~0x00000002); defaultSchemaName_ = ""; bitField0_ = (bitField0_ & ~0x00000004); if (priorityBuilder_ == null) { priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance(); } else { priorityBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); queryMaxAllocation_ = 0L; bitField0_ = (bitField0_ & ~0x00000010); extra_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000020); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.dremio.exec.proto.CoordExecRPC.FragmentPriority)) { return super.equals(obj); } com.dremio.exec.proto.CoordExecRPC.FragmentPriority other = (com.dremio.exec.proto.CoordExecRPC.FragmentPriority) obj; boolean result = true; result = result && (hasWorkloadClass() == other.hasWorkloadClass()); if (hasWorkloadClass()) { result = result && (getWorkloadClass() == other.getWorkloadClass()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
/** * <code>optional .exec.bit.control.FragmentPriority priority = 4;</code> */ public Builder mergePriority(com.dremio.exec.proto.CoordExecRPC.FragmentPriority value) { if (priorityBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008) && priority_ != com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance()) { priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.newBuilder(priority_).mergeFrom(value).buildPartial(); } else { priority_ = value; } onChanged(); } else { priorityBuilder_.mergeFrom(value); } bitField0_ |= 0x00000008; return this; } /**
protected CoordExecRPC.PlanFragment getDummyPlan(UserBitShared.QueryId queryId, int majorFragmentId, int minorFragmentId){ ExecProtos.FragmentHandle handle = ExecProtos.FragmentHandle .newBuilder() .setQueryId(queryId) .setMajorFragmentId(majorFragmentId) .setMinorFragmentId(minorFragmentId) .build(); CoordExecRPC.FragmentPriority priority = CoordExecRPC.FragmentPriority .newBuilder() .setWorkloadClass(UserBitShared.WorkloadClass.GENERAL) .build(); return CoordExecRPC.PlanFragment .newBuilder() .setHandle(handle) .setPriority(priority) .build(); }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.dremio.exec.proto.CoordExecRPC.FragmentPriority prototype) {
public com.dremio.exec.proto.CoordExecRPC.FragmentPriority getDefaultInstanceForType() { return com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance(); }
/** * <code>optional .exec.bit.control.FragmentPriority priority = 18;</code> */ public Builder clearPriority() { if (priorityBuilder_ == null) { priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance(); onChanged(); } else { priorityBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00008000); return this; } /**
protected QueueType getQueueNameFromSchedulingProperties(final ResourceSchedulingContext queryContext, final ResourceSchedulingProperties resourceSchedulingProperties) { final Double cost = resourceSchedulingProperties.getQueryCost(); Preconditions.checkNotNull(cost, "Queue Cost is not provided, Unable to determine " + "queue."); final long queueThreshold = queryContext.getOptions().getOption(BasicResourceConstants.QUEUE_THRESHOLD_SIZE); final QueueType queueType; if (queryContext.getQueryContextInfo().getPriority().getWorkloadClass().equals(UserBitShared.WorkloadClass.BACKGROUND)) { queueType = (cost > queueThreshold) ? QueueType.REFLECTION_LARGE : QueueType.REFLECTION_SMALL; } else { queueType = (cost > queueThreshold) ? QueueType.LARGE : QueueType.SMALL; } return queueType; }