@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; }
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; }
@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; }
resourceSchedulingDecisionInfo.setQueueName(queueType.name()); resourceSchedulingDecisionInfo.setQueueId(queueType.name()); resourceSchedulingDecisionInfo.setWorkloadClass(queryContext.getQueryContextInfo().getPriority().getWorkloadClass());
public Builder mergeFrom(com.dremio.exec.proto.CoordExecRPC.FragmentPriority other) { if (other == com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance()) return this; if (other.hasWorkloadClass()) { setWorkloadClass(other.getWorkloadClass()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
protected void setQueueTypeFromPlan(PhysicalPlan plan) { final long queueThreshold = context.getOptions().getOption(BasicResourceConstants.QUEUE_THRESHOLD_SIZE); if (context.getQueryContextInfo().getPriority().getWorkloadClass().equals(WorkloadClass.BACKGROUND)) { setQueueType((plan.getCost() > queueThreshold) ? QueueType.REFLECTION_LARGE : QueueType.REFLECTION_SMALL); } else { setQueueType((plan.getCost() > queueThreshold) ? QueueType.LARGE : QueueType.SMALL); } }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.CoordExecRPC.FragmentPriority message) throws java.io.IOException { if(message.hasWorkloadClass()) output.writeEnum(1, message.getWorkloadClass().getNumber(), false); } public boolean isInitialized(com.dremio.exec.proto.CoordExecRPC.FragmentPriority message)