public MetadataPpdResult deepCopy() { return new MetadataPpdResult(this); }
/** 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 METADATA: return isSetMetadata(); case INCLUDE_BITSET: return isSetIncludeBitset(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case METADATA: if (value == null) { unsetMetadata(); } else { setMetadata((ByteBuffer)value); } break; case INCLUDE_BITSET: if (value == null) { unsetIncludeBitset(); } else { setIncludeBitset((ByteBuffer)value); } break; } }
public Object getFieldValue(_Fields field) { switch (field) { case METADATA: return getMetadata(); case INCLUDE_BITSET: return getIncludeBitset(); } throw new IllegalStateException(); }
@Override public Iterator<Entry<Long, MetadataPpdResult>> getFileMetadataByExpr( List<Long> fileIds, ByteBuffer sarg, boolean doGetFooters) throws HiveException { getByExprCount.incrementAndGet(); ByteBuffer[] metadatas = new ByteBuffer[fileIds.size()]; ByteBuffer[] ppdResults = new ByteBuffer[fileIds.size()]; boolean[] eliminated = new boolean[fileIds.size()]; try { byte[] bb = new byte[sarg.remaining()]; System.arraycopy(sarg.array(), sarg.arrayOffset(), bb, 0, sarg.remaining()); handler.getFileMetadataByExpr(fileIds, bb, metadatas, ppdResults, eliminated); } catch (IOException e) { throw new HiveException(e); } Map<Long, MetadataPpdResult> result = new HashMap<>(); for (int i = 0; i < metadatas.length; ++i) { long fileId = fileIds.get(i); ByteBuffer metadata = metadatas[i]; if (metadata == null) continue; getHitByExprCount.incrementAndGet(); metadata = eliminated[i] ? null : metadata; MetadataPpdResult mpr = new MetadataPpdResult(); ByteBuffer bitset = eliminated[i] ? null : ppdResults[i]; mpr.setMetadata(doGetFooters ? metadata : null); mpr.setIncludeBitset(bitset); result.put(fileId, mpr); } return result.entrySet().iterator(); }
private void processPpdResult(MetadataPpdResult mpr, HdfsFileStatusWithId file, int ix, OrcTail[] result, ByteBuffer[] ppdResult) throws IOException { if (mpr == null) { return; // This file is unknown to metastore. } ppdResult[ix] = mpr.isSetIncludeBitset() ? mpr.bufferForIncludeBitset() : NO_SPLIT_AFTER_PPD; if (mpr.isSetMetadata()) { result[ix] = createOrcTailFromMs(file, mpr.bufferForMetadata()); if (result[ix] != null) { localCache.put(file.getFileStatus().getPath(), result[ix]); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, MetadataPpdResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.metadata != null) { if (struct.isSetMetadata()) { oprot.writeFieldBegin(METADATA_FIELD_DESC); oprot.writeBinary(struct.metadata); oprot.writeFieldEnd(); } } if (struct.includeBitset != null) { if (struct.isSetIncludeBitset()) { oprot.writeFieldBegin(INCLUDE_BITSET_FIELD_DESC); oprot.writeBinary(struct.includeBitset); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, GetFileMetadataByExprResult struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map818 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.metadata = new HashMap<Long,MetadataPpdResult>(2*_map818.size); long _key819; MetadataPpdResult _val820; for (int _i821 = 0; _i821 < _map818.size; ++_i821) { _key819 = iprot.readI64(); _val820 = new MetadataPpdResult(); _val820.read(iprot); struct.metadata.put(_key819, _val820); } } struct.setMetadataIsSet(true); struct.isSupported = iprot.readBool(); struct.setIsSupportedIsSet(true); } }
public byte[] getMetadata() { setMetadata(org.apache.thrift.TBaseHelper.rightSize(metadata)); return metadata == null ? null : metadata.array(); }
public byte[] getIncludeBitset() { setIncludeBitset(org.apache.thrift.TBaseHelper.rightSize(includeBitset)); return includeBitset == null ? null : includeBitset.array(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof MetadataPpdResult) return this.equals((MetadataPpdResult)that); return false; }
MetadataPpdResult mpr = new MetadataPpdResult(); ByteBuffer ppdResult = eliminated[i] ? null : handleReadOnlyBufferForThrift(ppdResults[i]); mpr.setIncludeBitset(ppdResult); if (needMetadata) { ByteBuffer metadata = eliminated[i] ? null : handleReadOnlyBufferForThrift(metadatas[i]); mpr.setMetadata(metadata);
private void processPpdResult(MetadataPpdResult mpr, HdfsFileStatusWithId file, int ix, OrcTail[] result, ByteBuffer[] ppdResult) throws IOException { if (mpr == null) return; // This file is unknown to metastore. ppdResult[ix] = mpr.isSetIncludeBitset() ? mpr.bufferForIncludeBitset() : NO_SPLIT_AFTER_PPD; if (mpr.isSetMetadata()) { result[ix] = createOrcTailFromMs(file, mpr.bufferForMetadata()); if (result[ix] != null) { localCache.put(file.getFileStatus().getPath(), result[ix]); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, MetadataPpdResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.metadata != null) { if (struct.isSetMetadata()) { oprot.writeFieldBegin(METADATA_FIELD_DESC); oprot.writeBinary(struct.metadata); oprot.writeFieldEnd(); } } if (struct.includeBitset != null) { if (struct.isSetIncludeBitset()) { oprot.writeFieldBegin(INCLUDE_BITSET_FIELD_DESC); oprot.writeBinary(struct.includeBitset); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
_val814 = new MetadataPpdResult(); _val814.read(iprot); struct.metadata.put(_key813, _val814);
public Object getFieldValue(_Fields field) { switch (field) { case METADATA: return getMetadata(); case INCLUDE_BITSET: return getIncludeBitset(); } throw new IllegalStateException(); }
public byte[] getMetadata() { setMetadata(org.apache.thrift.TBaseHelper.rightSize(metadata)); return metadata == null ? null : metadata.array(); }
public byte[] getIncludeBitset() { setIncludeBitset(org.apache.thrift.TBaseHelper.rightSize(includeBitset)); return includeBitset == null ? null : includeBitset.array(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof MetadataPpdResult) return this.equals((MetadataPpdResult)that); return false; }
public boolean equals(MetadataPpdResult that) { if (that == null) return false; boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { if (!(this_present_metadata && that_present_metadata)) return false; if (!this.metadata.equals(that.metadata)) return false; } boolean this_present_includeBitset = true && this.isSetIncludeBitset(); boolean that_present_includeBitset = true && that.isSetIncludeBitset(); if (this_present_includeBitset || that_present_includeBitset) { if (!(this_present_includeBitset && that_present_includeBitset)) return false; if (!this.includeBitset.equals(that.includeBitset)) return false; } return true; }