/** * <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; } /**
/** * 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(); }
.setQueryMaxAllocation(wrapper.getMaxAllocation()).build();
final long queryMaxAllocation = queryContext.getQueryContextInfo().getQueryMaxAllocation(); queryContextInformation = CoordExecRPC.QueryContextInformation.newBuilder(queryContextInformation) .setQueryMaxAllocation(Math.min(memoryLimit, queryMaxAllocation)).build();
@Override public CoordExecRPC.QueryContextInformation getQueryContextInfo() { return CoordExecRPC.QueryContextInformation.newBuilder() .setQueryMaxAllocation(Long.MAX_VALUE) .setPriority ( CoordExecRPC.FragmentPriority.newBuilder().setWorkloadClass(UserBitShared.WorkloadClass.GENERAL).build() ) .build(); }