private static String getRangeParam(FetchProto proto) { StringBuilder sb = new StringBuilder(); String firstKeyBase64 = new String(org.apache.commons.codec.binary.Base64.encodeBase64(proto.getRangeStart().toByteArray())); String lastKeyBase64 = new String(org.apache.commons.codec.binary.Base64.encodeBase64(proto.getRangeEnd().toByteArray())); try { sb.append("start=") .append(URLEncoder.encode(firstKeyBase64, "utf-8")) .append("&") .append("end=") .append(URLEncoder.encode(lastKeyBase64, "utf-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } if (proto.getRangeLastInclusive()) { sb.append("&final=true"); } return sb.toString(); }
private static String getRangeParam(FetchProto proto) { StringBuilder sb = new StringBuilder(); String firstKeyBase64 = new String(org.apache.commons.codec.binary.Base64.encodeBase64(proto.getRangeStart().toByteArray())); String lastKeyBase64 = new String(org.apache.commons.codec.binary.Base64.encodeBase64(proto.getRangeEnd().toByteArray())); try { sb.append("start=") .append(URLEncoder.encode(firstKeyBase64, "utf-8")) .append("&") .append("end=") .append(URLEncoder.encode(lastKeyBase64, "utf-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } if (proto.getRangeLastInclusive()) { sb.append("&final=true"); } return sb.toString(); }
public static List<URI> createFetchURL(int maxUrlLength, FetchProto fetch, boolean includeParts) { PullServerRequestURIBuilder builder = new PullServerRequestURIBuilder(fetch.getHost(), fetch.getPort(), maxUrlLength); ExecutionBlockId ebId = new ExecutionBlockId(fetch.getExecutionBlockId()); builder.setRequestType(PullServerConstants.CHUNK_REQUEST_PARAM_STRING) .setQueryId(ebId.getQueryId().toString()) .setEbId(ebId.getId()) .setPartId(fetch.getPartitionId()); if (fetch.getType() == HASH_SHUFFLE) { builder.setShuffleType(PullServerConstants.HASH_SHUFFLE_PARAM_STRING); } else if (fetch.getType() == RANGE_SHUFFLE) { builder.setShuffleType(PullServerConstants.RANGE_SHUFFLE_PARAM_STRING); builder.setStartKeyBase64(new String(org.apache.commons.codec.binary.Base64.encodeBase64(fetch.getRangeStart().toByteArray()))); builder.setEndKeyBase64(new String(org.apache.commons.codec.binary.Base64.encodeBase64(fetch.getRangeEnd().toByteArray()))); builder.setLastInclude(fetch.getRangeLastInclusive()); } else if (fetch.getType() == SCATTERED_HASH_SHUFFLE) { builder.setShuffleType(PullServerConstants.SCATTERED_HASH_SHUFFLE_PARAM_STRING); } if (fetch.getLength() >= 0) { builder.setOffset(fetch.getOffset()).setLength(fetch.getLength()); } if (includeParts) { builder.setTaskIds(fetch.getTaskIdList()); builder.setAttemptIds(fetch.getAttemptIdList()); } return builder.build(includeParts); }
result = result && getRangeEnd() .equals(other.getRangeEnd());
result = result && getRangeEnd() .equals(other.getRangeEnd());
hash = (53 * hash) + getRangeEnd().hashCode();
setRangeEnd(other.getRangeEnd());
hash = (53 * hash) + getRangeEnd().hashCode();
setRangeEnd(other.getRangeEnd());
public FetchImpl(FetchProto proto) { this(proto.getName(), new Task.PullHost(proto.getHost(), proto.getPort()), proto.getType(), new ExecutionBlockId(proto.getExecutionBlockId()), proto.getPartitionId(), proto.getHasNext(), proto.getTaskIdList(), proto.getAttemptIdList()); if (proto.hasOffset()) { this.offset = proto.getOffset(); } if (proto.hasLength()) { this.length = proto.getLength(); } if (proto.hasRangeStart()) { this.rangeParam = new RangeParam(proto.getRangeStart().toByteArray(), proto.getRangeEnd().toByteArray(), proto.getRangeLastInclusive()); } }
public FetchImpl(FetchProto proto) { this(proto.getName(), new Task.PullHost(proto.getHost(), proto.getPort()), proto.getType(), new ExecutionBlockId(proto.getExecutionBlockId()), proto.getPartitionId(), proto.getHasNext(), proto.getTaskIdList(), proto.getAttemptIdList()); if (proto.hasOffset()) { this.offset = proto.getOffset(); } if (proto.hasLength()) { this.length = proto.getLength(); } if (proto.hasRangeStart()) { this.rangeParam = new RangeParam(proto.getRangeStart().toByteArray(), proto.getRangeEnd().toByteArray(), proto.getRangeLastInclusive()); } }
/** * <code>optional bytes range_end = 8;</code> */ public Builder clearRangeEnd() { bitField0_ = (bitField0_ & ~0x00000080); rangeEnd_ = getDefaultInstance().getRangeEnd(); onChanged(); return this; }
/** * <code>optional bytes range_end = 8;</code> */ public Builder clearRangeEnd() { bitField0_ = (bitField0_ & ~0x00000080); rangeEnd_ = getDefaultInstance().getRangeEnd(); onChanged(); return this; }