@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasId()) { hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); } if (hasDataFormat()) { hash = (37 * hash) + DATAFORMAT_FIELD_NUMBER; hash = (53 * hash) + getDataFormat().hashCode(); } if (hasContents()) { hash = (37 * hash) + CONTENTS_FIELD_NUMBER; hash = (53 * hash) + getContents().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
/** * <code>repeated .FragmentProto fragments = 3;</code> */ public org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto.Builder addFragmentsBuilder() { return getFragmentsFieldBuilder().addBuilder( org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto.getDefaultInstance()); } /**
if (!getFragments(i).isInitialized()) { memoizedIsInitialized = 0; return false;
} catch (Exception e) { LOG.error(e.getMessage(), e); fragmentList.add("ERROR: " + eachFragment.getDataFormat() + "," + eachFragment.getId() + ": " + e.getMessage());
if (!getFragments(i).isInitialized()) {
if (!getFragments(i).isInitialized()) { memoizedIsInitialized = 0; return false;
if (!getFragments(i).isInitialized()) {
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto)) { return super.equals(obj); } org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto other = (org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto) obj; boolean result = true; result = result && (hasId() == other.hasId()); if (hasId()) { result = result && getId() .equals(other.getId()); } result = result && (hasDataFormat() == other.hasDataFormat()); if (hasDataFormat()) { result = result && getDataFormat() .equals(other.getDataFormat()); } result = result && (hasContents() == other.hasContents()); if (hasContents()) { result = result && getContents() .equals(other.getContents()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
public TaskAttemptContext(QueryContext queryContext, final ExecutionBlockContext executionBlockContext, final TaskAttemptId taskId, final FragmentProto[] fragments, final Path workDir) { this.queryContext = queryContext; if (executionBlockContext != null) { // For unit tests this.workerContext = executionBlockContext.getWorkerContext(); this.sharedResource = executionBlockContext.getSharedResource(); } this.taskId = taskId; if (fragments != null) { for (FragmentProto t : fragments) { if (fragmentMap.containsKey(t.getId())) { fragmentMap.get(t.getId()).add(t); } else { List<FragmentProto> frags = new ArrayList<>(); frags.add(t); fragmentMap.put(t.getId(), frags); } } } this.workDir = workDir; this.shuffleFileOutputs = Maps.newHashMap(); this.state = TaskAttemptState.TA_PENDING; this.partitionOutputVolume = Maps.newHashMap(); this.partitions = new ArrayList<>(); // set to system timezone for forwarded query this.evalContext.setTimeZone(queryContext.getConf().getSystemTimezone()); }
public TaskAttemptContext(QueryContext queryContext, final ExecutionBlockContext executionBlockContext, final TaskAttemptId taskId, final FragmentProto[] fragments, final Path workDir) { this.queryContext = queryContext; if (executionBlockContext != null) { // For unit tests this.workerContext = executionBlockContext.getWorkerContext(); this.sharedResource = executionBlockContext.getSharedResource(); } this.taskId = taskId; if (fragments != null) { for (FragmentProto t : fragments) { if (fragmentMap.containsKey(t.getId())) { fragmentMap.get(t.getId()).add(t); } else { List<FragmentProto> frags = new ArrayList<FragmentProto>(); frags.add(t); fragmentMap.put(t.getId(), frags); } } } this.workDir = workDir; this.shuffleFileOutputs = Maps.newHashMap(); this.state = TaskAttemptState.TA_PENDING; this.partitionOutputVolume = Maps.newHashMap(); this.partitions = TUtil.newList(); // set to system timezone for forwarded query this.evalContext.setTimeZone(queryContext.getConf().getSystemTimezone()); }
public FragmentProto getProto() { FileFragmentProto.Builder builder = FileFragmentProto.newBuilder(); builder.setId(this.tableName); builder.setStartOffset(this.startOffset); builder.setLength(this.length); builder.setPath(this.uri.toString()); if(diskIds != null) { List<Integer> idList = new ArrayList<Integer>(); for(int eachId: diskIds) { idList.add(eachId); } builder.addAllDiskIds(idList); } if(hosts != null) { builder.addAllHosts(TUtil.newList(hosts)); } FragmentProto.Builder fragmentBuilder = FragmentProto.newBuilder(); fragmentBuilder.setId(this.tableName); fragmentBuilder.setDataFormat(BuiltinStorages.TEXT); fragmentBuilder.setContents(builder.buildPartial().toByteString()); return fragmentBuilder.build(); } }
public FragmentProto getProto() { FileFragmentProto.Builder builder = FileFragmentProto.newBuilder(); builder.setId(this.tableName); builder.setStartOffset(this.startOffset); builder.setLength(this.length); builder.setPath(this.uri.toString()); if(diskIds != null) { List<Integer> idList = new ArrayList<Integer>(); for(int eachId: diskIds) { idList.add(eachId); } builder.addAllDiskIds(idList); } if(hosts != null) { builder.addAllHosts(TUtil.newList(hosts)); } FragmentProto.Builder fragmentBuilder = FragmentProto.newBuilder(); fragmentBuilder.setId(this.tableName); fragmentBuilder.setContents(builder.buildPartial().toByteString()); return fragmentBuilder.build(); } }
public Builder mergeFrom(org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto other) { if (other == org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto.getDefaultInstance()) return this; if (other.hasId()) { bitField0_ |= 0x00000001; id_ = other.id_; onChanged(); } if (other.hasDataFormat()) { bitField0_ |= 0x00000002; dataFormat_ = other.dataFormat_; onChanged(); } if (other.hasContents()) { setContents(other.getContents()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
@Override public FragmentProto getProto() { HBaseFragmentProto.Builder builder = HBaseFragmentProto.newBuilder(); builder .setUri(uri.toString()) .setTableName(tableName) .setHbaseTableName(hbaseTableName) .setStartRow(ByteString.copyFrom(startRow)) .setStopRow(ByteString.copyFrom(stopRow)) .setLast(last) .setLength(length) .setRegionLocation(regionLocation); FragmentProto.Builder fragmentBuilder = FragmentProto.newBuilder(); fragmentBuilder.setId(this.tableName); fragmentBuilder.setContents(builder.buildPartial().toByteString()); fragmentBuilder.setDataFormat(BuiltinStorages.HBASE); return fragmentBuilder.build(); }
public Builder toBuilder() { return newBuilder(this); }
public static <T extends Fragment> T convert(Class<T> clazz, FragmentProto fragment) { T result; try { Constructor<T> constructor = (Constructor<T>) CONSTRUCTOR_CACHE.get(clazz); if (constructor == null) { constructor = clazz.getDeclaredConstructor(DEFAULT_FRAGMENT_PARAMS); constructor.setAccessible(true); CONSTRUCTOR_CACHE.put(clazz, constructor); } result = constructor.newInstance(new Object[]{fragment.getContents()}); } catch (Throwable e) { throw new TajoInternalError(e); } return result; }
public static <T extends Fragment> T convert(Class<T> clazz, FragmentProto fragment) { T result; try { Constructor<T> constructor = (Constructor<T>) CONSTRUCTOR_CACHE.get(clazz); if (constructor == null) { constructor = clazz.getDeclaredConstructor(DEFAULT_FRAGMENT_PARAMS); constructor.setAccessible(true); CONSTRUCTOR_CACHE.put(clazz, constructor); } result = constructor.newInstance(new Object[]{fragment.getContents()}); } catch (Exception e) { throw new RuntimeException(e); } return result; }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto prototype) {
public static <T extends Fragment> T convert(Configuration conf, FragmentProto fragment) { return convert(conf, fragment.getKind(), fragment); }