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(); }
/** * 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; }
tableBlockInfo.setBlockOffset(readBlockIndexInfo.getOffset()); tableBlockInfo.setVersion( ColumnarFormatVersion.valueOf((short) readIndexHeader.getVersion())); int blockletSize = getBlockletSize(readBlockIndexInfo); tableBlockInfo.getBlockletInfos().setNoOfBlockLets(blockletSize);
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 {