/** * 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(); }
/** * <code>optional .exec.bit.control.FragmentPriority priority = 18;</code> */ public Builder setPriority( com.dremio.exec.proto.CoordExecRPC.FragmentPriority.Builder builderForValue) { if (priorityBuilder_ == null) { priority_ = builderForValue.build(); onChanged(); } else { priorityBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00008000; return this; } /**
subBuilder.mergeFrom(priority_); priority_ = subBuilder.buildPartial();
subBuilder.mergeFrom(priority_); priority_ = subBuilder.buildPartial();
/** * <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; } /**
/** * <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; } /**
public void mergeFrom(io.protostuff.Input input, com.dremio.exec.proto.CoordExecRPC.FragmentPriority.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.setWorkloadClass(com.dremio.exec.proto.UserBitShared.WorkloadClass.valueOf(input.readEnum())); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(com.dremio.exec.proto.CoordExecRPC.FragmentPriority.Builder builder)
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(); }
/** * <code>optional .exec.bit.control.FragmentPriority priority = 4;</code> */ public Builder setPriority( com.dremio.exec.proto.CoordExecRPC.FragmentPriority.Builder builderForValue) { if (priorityBuilder_ == null) { priority_ = builderForValue.build(); onChanged(); } else { priorityBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; return this; } /**
private static Builder create() { return new Builder(); }
public Builder clone() { return create().mergeFrom(buildPartial()); }
private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
public boolean isInitialized(com.dremio.exec.proto.CoordExecRPC.FragmentPriority.Builder builder) { return builder.isInitialized(); } public com.dremio.exec.proto.CoordExecRPC.FragmentPriority.Builder newMessage()
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; }
public com.dremio.exec.proto.CoordExecRPC.FragmentPriority build() { com.dremio.exec.proto.CoordExecRPC.FragmentPriority result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@Override public CoordExecRPC.QueryContextInformation getQueryContextInfo() { return CoordExecRPC.QueryContextInformation.newBuilder() .setQueryMaxAllocation(Long.MAX_VALUE) .setPriority ( CoordExecRPC.FragmentPriority.newBuilder().setWorkloadClass(UserBitShared.WorkloadClass.GENERAL).build() ) .build(); }