@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_name = true && (isSetName()); list.add(present_name); if (present_name) list.add(name); boolean present_status = true && (isSetStatus()); list.add(present_status); if (present_status) list.add(status.getValue()); boolean present_queryParallelism = true && (isSetQueryParallelism()); list.add(present_queryParallelism); if (present_queryParallelism) list.add(queryParallelism); boolean present_defaultPoolPath = true && (isSetDefaultPoolPath()); list.add(present_defaultPoolPath); if (present_defaultPoolPath) list.add(defaultPoolPath); boolean present_ns = true && (isSetNs()); list.add(present_ns); if (present_ns) list.add(ns); return list.hashCode(); }
if (isSetQueryParallelism()) { if (!first) sb.append(", "); sb.append("queryParallelism:");
if (struct.isSetQueryParallelism()) { oprot.writeFieldBegin(QUERY_PARALLELISM_FIELD_DESC); oprot.writeI32(struct.queryParallelism);
public void showResourcePlans(DataOutputStream out, List<WMResourcePlan> resourcePlans) throws HiveException { try { for (WMResourcePlan plan : resourcePlans) { out.write(plan.getName().getBytes(UTF_8)); out.write(separator); out.write(plan.getStatus().name().getBytes(UTF_8)); out.write(separator); if (plan.isSetQueryParallelism()) { out.write(Integer.toString(plan.getQueryParallelism()).getBytes(UTF_8)); } else { write(out, "null"); } out.write(separator); if (plan.isSetDefaultPoolPath()) { out.write(plan.getDefaultPoolPath().getBytes(UTF_8)); } else { write(out, "null"); } out.write(terminator); } } catch (IOException e) { throw new HiveException(e); } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NAME: return isSetName(); case STATUS: return isSetStatus(); case QUERY_PARALLELISM: return isSetQueryParallelism(); case DEFAULT_POOL_PATH: return isSetDefaultPoolPath(); case NS: return isSetNs(); } throw new IllegalStateException(); }
lastComparison = Boolean.valueOf(isSetQueryParallelism()).compareTo(other.isSetQueryParallelism()); if (lastComparison != 0) { return lastComparison; if (isSetQueryParallelism()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryParallelism, other.queryParallelism); if (lastComparison != 0) {
boolean this_present_queryParallelism = true && this.isSetQueryParallelism(); boolean that_present_queryParallelism = true && that.isSetQueryParallelism(); if (this_present_queryParallelism || that_present_queryParallelism) { if (!(this_present_queryParallelism && that_present_queryParallelism))
optionals.set(0); if (struct.isSetQueryParallelism()) { optionals.set(1); oprot.writeI32(struct.status.getValue()); if (struct.isSetQueryParallelism()) { oprot.writeI32(struct.queryParallelism);
@Override public WMCreateResourcePlanResponse create_resource_plan(WMCreateResourcePlanRequest request) throws AlreadyExistsException, InvalidObjectException, MetaException, TException { int defaultPoolSize = MetastoreConf.getIntVar( conf, MetastoreConf.ConfVars.WM_DEFAULT_POOL_SIZE); WMResourcePlan plan = request.getResourcePlan(); if (defaultPoolSize > 0 && plan.isSetQueryParallelism()) { // If the default pool is not disabled, override the size with the specified parallelism. defaultPoolSize = plan.getQueryParallelism(); } try { getMS().createResourcePlan(plan, request.getCopyFrom(), defaultPoolSize); return new WMCreateResourcePlanResponse(); } catch (MetaException e) { LOG.error("Exception while trying to persist resource plan", e); throw e; } }
@Override public void showResourcePlans(DataOutputStream out, List<WMResourcePlan> resourcePlans) throws HiveException { JsonGenerator generator = null; try { generator = new ObjectMapper().getJsonFactory().createJsonGenerator(out); generator.writeStartArray(); for (WMResourcePlan plan : resourcePlans) { generator.writeStartObject(); generator.writeStringField("name", plan.getName()); generator.writeStringField("status", plan.getStatus().name()); if (plan.isSetQueryParallelism()) { generator.writeNumberField("queryParallelism", plan.getQueryParallelism()); } if (plan.isSetDefaultPoolPath()) { generator.writeStringField("defaultPoolPath", plan.getDefaultPoolPath()); } generator.writeEndObject(); } generator.writeEndArray(); generator.close(); } catch (IOException e) { throw new HiveException(e); } finally { if (generator != null) { IOUtils.closeQuietly(generator); } } }
public static void formatFullRP(RPFormatter rpFormatter, WMFullResourcePlan fullRp) throws HiveException { try { WMResourcePlan plan = fullRp.getPlan(); Integer parallelism = plan.isSetQueryParallelism() ? plan.getQueryParallelism() : null; String defaultPool = plan.isSetDefaultPoolPath() ? plan.getDefaultPoolPath() : null; rpFormatter.startRP(plan.getName(), "status", plan.getStatus().toString(), "parallelism", parallelism, "defaultPool", defaultPool); rpFormatter.startPools(); PoolTreeNode root = PoolTreeNode.makePoolTree(fullRp); root.sortChildren(); for (PoolTreeNode pool : root.children) { pool.writePoolTreeNode(rpFormatter); } rpFormatter.endPools(); rpFormatter.endRP(); } catch (IOException e) { throw new HiveException(e); } } }
if (copyFromName == null) { Integer queryParallelism = null; if (resourcePlan.isSetQueryParallelism()) { queryParallelism = resourcePlan.getQueryParallelism(); if (queryParallelism <= 0) {
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_name = true && (isSetName()); list.add(present_name); if (present_name) list.add(name); boolean present_status = true && (isSetStatus()); list.add(present_status); if (present_status) list.add(status.getValue()); boolean present_queryParallelism = true && (isSetQueryParallelism()); list.add(present_queryParallelism); if (present_queryParallelism) list.add(queryParallelism); boolean present_defaultPoolPath = true && (isSetDefaultPoolPath()); list.add(present_defaultPoolPath); if (present_defaultPoolPath) list.add(defaultPoolPath); return list.hashCode(); }
if (isSetQueryParallelism()) { if (!first) sb.append(", "); sb.append("queryParallelism:");
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NAME: return isSetName(); case STATUS: return isSetStatus(); case QUERY_PARALLELISM: return isSetQueryParallelism(); case DEFAULT_POOL_PATH: return isSetDefaultPoolPath(); } throw new IllegalStateException(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, WMResourcePlan struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(struct.name); oprot.writeFieldEnd(); } if (struct.status != null) { if (struct.isSetStatus()) { oprot.writeFieldBegin(STATUS_FIELD_DESC); oprot.writeI32(struct.status.getValue()); oprot.writeFieldEnd(); } } if (struct.isSetQueryParallelism()) { oprot.writeFieldBegin(QUERY_PARALLELISM_FIELD_DESC); oprot.writeI32(struct.queryParallelism); oprot.writeFieldEnd(); } if (struct.defaultPoolPath != null) { if (struct.isSetDefaultPoolPath()) { oprot.writeFieldBegin(DEFAULT_POOL_PATH_FIELD_DESC); oprot.writeString(struct.defaultPoolPath); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
lastComparison = Boolean.valueOf(isSetQueryParallelism()).compareTo(other.isSetQueryParallelism()); if (lastComparison != 0) { return lastComparison; if (isSetQueryParallelism()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryParallelism, other.queryParallelism); if (lastComparison != 0) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, WMResourcePlan struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.name); BitSet optionals = new BitSet(); if (struct.isSetStatus()) { optionals.set(0); } if (struct.isSetQueryParallelism()) { optionals.set(1); } if (struct.isSetDefaultPoolPath()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetStatus()) { oprot.writeI32(struct.status.getValue()); } if (struct.isSetQueryParallelism()) { oprot.writeI32(struct.queryParallelism); } if (struct.isSetDefaultPoolPath()) { oprot.writeString(struct.defaultPoolPath); } }
boolean this_present_queryParallelism = true && this.isSetQueryParallelism(); boolean that_present_queryParallelism = true && that.isSetQueryParallelism(); if (this_present_queryParallelism || that_present_queryParallelism) { if (!(this_present_queryParallelism && that_present_queryParallelism))
@Override public WMCreateResourcePlanResponse create_resource_plan(WMCreateResourcePlanRequest request) throws AlreadyExistsException, InvalidObjectException, MetaException, TException { int defaultPoolSize = MetastoreConf.getIntVar( conf, MetastoreConf.ConfVars.WM_DEFAULT_POOL_SIZE); WMResourcePlan plan = request.getResourcePlan(); if (defaultPoolSize > 0 && plan.isSetQueryParallelism()) { // If the default pool is not disabled, override the size with the specified parallelism. defaultPoolSize = plan.getQueryParallelism(); } try { getMS().createResourcePlan(plan, request.getCopyFrom(), defaultPoolSize); return new WMCreateResourcePlanResponse(); } catch (MetaException e) { LOG.error("Exception while trying to persist resource plan", e); throw e; } }