/** * Create copy of BlockletDetailInfo */ public BlockletDetailInfo copy() { BlockletDetailInfo detailInfo = new BlockletDetailInfo(); detailInfo.rowCount = rowCount; detailInfo.pagesCount = pagesCount; detailInfo.versionNumber = versionNumber; detailInfo.blockletId = blockletId; detailInfo.dimLens = dimLens; detailInfo.schemaUpdatedTimeStamp = schemaUpdatedTimeStamp; detailInfo.blockletInfo = blockletInfo; detailInfo.blockletInfoBinary = blockletInfoBinary; detailInfo.blockFooterOffset = blockFooterOffset; detailInfo.columnSchemas = columnSchemas; detailInfo.columnSchemaBinary = columnSchemaBinary; detailInfo.blockSize = blockSize; detailInfo.isLegacyStore = isLegacyStore; detailInfo.useMinMaxForPruning = useMinMaxForPruning; return detailInfo; }
@Override public void readFields(DataInput in) throws IOException { super.readFields(in); this.segment = Segment.toSegment(in.readUTF()); this.version = ColumnarFormatVersion.valueOf(in.readShort()); this.bucketId = in.readUTF(); this.blockletId = in.readUTF(); int numInvalidSegment = in.readInt(); invalidSegments = new ArrayList<>(numInvalidSegment); for (int i = 0; i < numInvalidSegment; i++) { invalidSegments.add(in.readUTF()); } int numberOfDeleteDeltaFiles = in.readInt(); deleteDeltaFiles = new String[numberOfDeleteDeltaFiles]; for (int i = 0; i < numberOfDeleteDeltaFiles; i++) { deleteDeltaFiles[i] = in.readUTF(); } boolean detailInfoExists = in.readBoolean(); if (detailInfoExists) { detailInfo = new BlockletDetailInfo(); detailInfo.readFields(in); } boolean dataMapWriterPathExists = in.readBoolean(); if (dataMapWriterPathExists) { dataMapWritePath = in.readUTF(); } }
protected BlockletDetailInfo getBlockletDetailInfo(DataMapRow row, short blockletId, ExtendedBlocklet blocklet) { BlockletDetailInfo detailInfo = new BlockletDetailInfo(); detailInfo.setRowCount(row.getInt(ROW_COUNT_INDEX)); detailInfo.setVersionNumber(row.getShort(VERSION_INDEX)); detailInfo.setBlockletId(blockletId); detailInfo.setDimLens(getColumnCardinality()); detailInfo.setSchemaUpdatedTimeStamp(row.getLong(SCHEMA_UPADATED_TIME_INDEX)); try { blocklet.setLocation( new String(row.getByteArray(LOCATIONS), CarbonCommonConstants.DEFAULT_CHARSET) .split(",")); } catch (IOException e) { throw new RuntimeException(e); } detailInfo.setBlockFooterOffset(row.getLong(BLOCK_FOOTER_OFFSET)); detailInfo.setBlockSize(row.getLong(BLOCK_LENGTH)); detailInfo.setLegacyStore(isLegacyStore); return detailInfo; }
carbonFile.getLength(), carbonFile.getLocations(), FileFormat.COLUMNAR_V3); split.setVersion(ColumnarFormatVersion.V3); BlockletDetailInfo info = new BlockletDetailInfo(); split.setDetailInfo(info); info.setBlockSize(carbonFile.getLength());