.setQueryMaxAllocation(wrapper.getMaxAllocation()).build();
/** * 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(); }
subBuilder.mergeFrom(context_); context_ = subBuilder.buildPartial();
final long queryMaxAllocation = queryContext.getQueryContextInfo().getQueryMaxAllocation(); queryContextInformation = CoordExecRPC.QueryContextInformation.newBuilder(queryContextInformation) .setQueryMaxAllocation(Math.min(memoryLimit, queryMaxAllocation)).build();
return; case 1: builder.setQueryStartTime(input.readInt64()); break; case 2: builder.setTimeZone(input.readInt32()); break; case 3: builder.setDefaultSchemaName(input.readString()); break; case 4: builder.setPriority(input.mergeObject(com.dremio.exec.proto.CoordExecRPC.FragmentPriority.newBuilder(), com.dremio.exec.proto.SchemaCoordExecRPC.FragmentPriority.MERGE)); builder.setQueryMaxAllocation(input.readInt64()); break; case 6: builder.setExtra(com.google.protobuf.ByteString.copyFrom(input.readByteArray())); break; default:
public Builder mergeFrom(com.dremio.exec.proto.CoordExecRPC.QueryContextInformation other) { if (other == com.dremio.exec.proto.CoordExecRPC.QueryContextInformation.getDefaultInstance()) return this; if (other.hasQueryStartTime()) { setQueryStartTime(other.getQueryStartTime()); } if (other.hasTimeZone()) { setTimeZone(other.getTimeZone()); } if (other.hasDefaultSchemaName()) { bitField0_ |= 0x00000004; defaultSchemaName_ = other.defaultSchemaName_; onChanged(); } if (other.hasPriority()) { mergePriority(other.getPriority()); } if (other.hasQueryMaxAllocation()) { setQueryMaxAllocation(other.getQueryMaxAllocation()); } if (other.hasExtra()) { setExtra(other.getExtra()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional .exec.bit.control.QueryContextInformation context = 16;</code> */ public Builder mergeContext(com.dremio.exec.proto.CoordExecRPC.QueryContextInformation value) { if (contextBuilder_ == null) { if (((bitField0_ & 0x00002000) == 0x00002000) && context_ != com.dremio.exec.proto.CoordExecRPC.QueryContextInformation.getDefaultInstance()) { context_ = com.dremio.exec.proto.CoordExecRPC.QueryContextInformation.newBuilder(context_).mergeFrom(value).buildPartial(); } else { context_ = value; } onChanged(); } else { contextBuilder_.mergeFrom(value); } bitField0_ |= 0x00002000; return this; } /**
/** * <code>optional .exec.bit.control.QueryContextInformation context = 16;</code> */ public Builder setContext( com.dremio.exec.proto.CoordExecRPC.QueryContextInformation.Builder builderForValue) { if (contextBuilder_ == null) { context_ = builderForValue.build(); onChanged(); } else { contextBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00002000; return this; } /**
private static Builder create() { return new Builder(); }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.dremio.exec.proto.CoordExecRPC.QueryContextInformation build() { com.dremio.exec.proto.CoordExecRPC.QueryContextInformation 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(); }