public Object getFieldValue(_Fields field) { switch (field) { case VERSION: return getVersion(); case TABLE_COLUMNS: return getTable_columns(); case SEGMENT_INFO: return getSegment_info(); case BUCKET_ID: return getBucket_id(); case SCHEMA_TIME_STAMP: return getSchema_time_stamp(); } throw new IllegalStateException(); }
@Override public TBase create() { return new IndexHeader(); } });
/** 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 VERSION: return isSetVersion(); case TABLE_COLUMNS: return isSetTable_columns(); case SEGMENT_INFO: return isSetSegment_info(); case BUCKET_ID: return isSetBucket_id(); case SCHEMA_TIME_STAMP: return isSetSchema_time_stamp(); } throw new IllegalStateException(); }
case VERSION: if (value == null) { unsetVersion(); } else { setVersion((Integer)value); unsetTable_columns(); } else { setTable_columns((List<org.apache.carbondata.format.ColumnSchema>)value); unsetSegment_info(); } else { setSegment_info((org.apache.carbondata.format.SegmentInfo)value); unsetBucket_id(); } else { setBucket_id((Integer)value); unsetSchema_time_stamp(); } else { setSchema_time_stamp((Long)value);
IndexHeader indexHeader = new IndexHeader(); ColumnarFormatVersion version = CarbonProperties.getInstance().getFormatVersion(); indexHeader.setVersion(version.number()); indexHeader.setSegment_info(segmentInfo); indexHeader.setTable_columns(columnSchemaList); indexHeader.setBucket_id(bucketNumber); indexHeader.setSchema_time_stamp(schemaTimeStamp); return indexHeader;
List<ColumnSchema> columnSchemaList = new ArrayList<ColumnSchema>(); List<org.apache.carbondata.format.ColumnSchema> table_columns = readIndexHeader.getTable_columns(); for (int i = 0; i < table_columns.size(); i++) { columnSchemaList.add(thriftColumnSchemaToWrapperColumnSchema(table_columns.get(i))); SegmentInfo segmentInfo = getSegmentInfo(readIndexHeader.getSegment_info()); BlockletIndex blockletIndex = null; DataFileFooter dataFileFooter = null; dataFileFooter.setVersionId(tableBlockInfo.getVersion()); if (readIndexHeader.isSetSchema_time_stamp()) { dataFileFooter.setSchemaUpdatedTimeStamp(readIndexHeader.getSchema_time_stamp());
List<ColumnSchema> columnSchemaList = new ArrayList<ColumnSchema>(); List<org.apache.carbondata.format.ColumnSchema> table_columns = readIndexHeader.getTable_columns(); for (int i = 0; i < table_columns.size(); i++) { columnSchemaList.add(thriftColumnSchemaToWrapperColumnSchema(table_columns.get(i))); SegmentInfo segmentInfo = getSegmentInfo(readIndexHeader.getSegment_info()); BlockletIndex blockletIndex = null; int counter = 0; tableBlockInfo.setBlockOffset(readBlockIndexInfo.getOffset()); tableBlockInfo.setVersion( ColumnarFormatVersion.valueOf((short) readIndexHeader.getVersion())); int blockletSize = getBlockletSize(readBlockIndexInfo); tableBlockInfo.getBlockletInfos().setNoOfBlockLets(blockletSize);
public void write(org.apache.thrift.protocol.TProtocol oprot, IndexHeader struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeFieldEnd(); if (struct.isSetBucket_id()) { oprot.writeFieldBegin(BUCKET_ID_FIELD_DESC); oprot.writeI32(struct.bucket_id); oprot.writeFieldEnd(); if (struct.isSetSchema_time_stamp()) { oprot.writeFieldBegin(SCHEMA_TIME_STAMP_FIELD_DESC); oprot.writeI64(struct.schema_time_stamp);
if (isSetBucket_id()) { if (!first) sb.append(", "); sb.append("bucket_id:"); first = false; if (isSetSchema_time_stamp()) { if (!first) sb.append(", "); sb.append("schema_time_stamp:");
List<ColumnSchema> columnSchemaList = new ArrayList<ColumnSchema>(); List<org.apache.carbondata.format.ColumnSchema> table_columns = readIndexHeader.getTable_columns(); for (int i = 0; i < table_columns.size(); i++) { columnSchemaList.add(thriftColumnSchemaToWrapperColumnSchema(table_columns.get(i)));
/** * This method will create a table block info object from index file info * * @param readBlockIndexInfo * @param readIndexHeader * @param parentPath * @return */ public TableBlockInfo getTableBlockInfo(BlockIndex readBlockIndexInfo, org.apache.carbondata.format.IndexHeader readIndexHeader, String parentPath) { TableBlockInfo tableBlockInfo = new TableBlockInfo(); tableBlockInfo.setBlockOffset(readBlockIndexInfo.getOffset()); ColumnarFormatVersion version = ColumnarFormatVersion.valueOf((short) readIndexHeader.getVersion()); tableBlockInfo.setVersion(version); int blockletSize = getBlockletSize(readBlockIndexInfo); tableBlockInfo.getBlockletInfos().setNoOfBlockLets(blockletSize); String fileName = readBlockIndexInfo.file_name; // Take only name of file. if (fileName.lastIndexOf("/") > 0) { fileName = fileName.substring(fileName.lastIndexOf("/")); } fileName = (CarbonCommonConstants.FILE_SEPARATOR + fileName).replaceAll("//", "/"); tableBlockInfo.setFilePath(parentPath + fileName); return tableBlockInfo; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, IndexHeader struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.version); { oprot.writeI32(struct.table_columns.size()); for (org.apache.carbondata.format.ColumnSchema _iter4 : struct.table_columns) { _iter4.write(oprot); } } struct.segment_info.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetBucket_id()) { optionals.set(0); } if (struct.isSetSchema_time_stamp()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetBucket_id()) { oprot.writeI32(struct.bucket_id); } if (struct.isSetSchema_time_stamp()) { oprot.writeI64(struct.schema_time_stamp); } }
List<ColumnSchema> columnSchemaList = new ArrayList<ColumnSchema>(); List<org.apache.carbondata.format.ColumnSchema> table_columns = readIndexHeader.getTable_columns(); for (org.apache.carbondata.format.ColumnSchema columnSchema : table_columns) { if (!(columnSchema.column_name.contains("."))) {
indexReader.openThriftReader(fileData); IndexHeader indexHeader = indexReader.readIndexHeader(); version = ColumnarFormatVersion.valueOf((short)indexHeader.getVersion()); break; } finally { indexReader.openThriftReader(fileData); IndexHeader indexHeader = indexReader.readIndexHeader(); version = ColumnarFormatVersion.valueOf((short)indexHeader.getVersion()); break; } finally {
boolean this_present_table_columns = true && this.isSetTable_columns(); boolean that_present_table_columns = true && that.isSetTable_columns(); if (this_present_table_columns || that_present_table_columns) { if (!(this_present_table_columns && that_present_table_columns)) boolean this_present_segment_info = true && this.isSetSegment_info(); boolean that_present_segment_info = true && that.isSetSegment_info(); if (this_present_segment_info || that_present_segment_info) { if (!(this_present_segment_info && that_present_segment_info)) boolean this_present_bucket_id = true && this.isSetBucket_id(); boolean that_present_bucket_id = true && that.isSetBucket_id(); if (this_present_bucket_id || that_present_bucket_id) { if (!(this_present_bucket_id && that_present_bucket_id)) boolean this_present_schema_time_stamp = true && this.isSetSchema_time_stamp(); boolean that_present_schema_time_stamp = true && that.isSetSchema_time_stamp(); if (this_present_schema_time_stamp || that_present_schema_time_stamp) { if (!(this_present_schema_time_stamp && that_present_schema_time_stamp))
public IndexHeader deepCopy() { return new IndexHeader(this); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_version = true; list.add(present_version); if (present_version) list.add(version); boolean present_table_columns = true && (isSetTable_columns()); list.add(present_table_columns); if (present_table_columns) list.add(table_columns); boolean present_segment_info = true && (isSetSegment_info()); list.add(present_segment_info); if (present_segment_info) list.add(segment_info); boolean present_bucket_id = true && (isSetBucket_id()); list.add(present_bucket_id); if (present_bucket_id) list.add(bucket_id); boolean present_schema_time_stamp = true && (isSetSchema_time_stamp()); list.add(present_schema_time_stamp); if (present_schema_time_stamp) list.add(schema_time_stamp); return list.hashCode(); }
lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); if (lastComparison != 0) { return lastComparison; if (isSetVersion()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetTable_columns()).compareTo(other.isSetTable_columns()); if (lastComparison != 0) { return lastComparison; if (isSetTable_columns()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_columns, other.table_columns); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetSegment_info()).compareTo(other.isSetSegment_info()); if (lastComparison != 0) { return lastComparison; if (isSetSegment_info()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.segment_info, other.segment_info); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetBucket_id()).compareTo(other.isSetBucket_id()); if (lastComparison != 0) { return lastComparison; if (isSetBucket_id()) {