/** * 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();
builder.setQueryMaxAllocation(input.readInt64()); break; case 6:
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; }
@Override public CoordExecRPC.QueryContextInformation getQueryContextInfo() { return CoordExecRPC.QueryContextInformation.newBuilder() .setQueryMaxAllocation(Long.MAX_VALUE) .setPriority ( CoordExecRPC.FragmentPriority.newBuilder().setWorkloadClass(UserBitShared.WorkloadClass.GENERAL).build() ) .build(); }