protected String getFileNameWithFilePath(DataMapRow dataMapRow, String filePath) { String fileName = filePath + CarbonCommonConstants.FILE_SEPARATOR + new String( dataMapRow.getByteArray(FILE_PATH_INDEX), CarbonCommonConstants.DEFAULT_CHARSET_CLASS) + CarbonTablePath.getCarbonDataExtension(); return fileName; }
private String[] getFileDetails() { try { String[] fileDetails = new String[3]; DataMapRow unsafeRow = taskSummaryDMStore.getDataMapRow(getTaskSummarySchema(), 0); fileDetails[0] = new String(unsafeRow.getByteArray(SUMMARY_INDEX_PATH), CarbonCommonConstants.DEFAULT_CHARSET); fileDetails[1] = new String(unsafeRow.getByteArray(SUMMARY_INDEX_FILE_NAME), CarbonCommonConstants.DEFAULT_CHARSET); fileDetails[2] = new String(unsafeRow.getByteArray(SUMMARY_SEGMENTID), CarbonCommonConstants.DEFAULT_CHARSET); return fileDetails; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Get the index file name of the blocklet data map * * @return */ public String getTableTaskInfo(int index) { DataMapRow unsafeRow = taskSummaryDMStore.getDataMapRow(getTaskSummarySchema(), 0); try { return new String(unsafeRow.getByteArray(index), CarbonCommonConstants.DEFAULT_CHARSET); } catch (UnsupportedEncodingException e) { // should never happen! throw new IllegalArgumentException("UTF8 encoding is not supported", e); } }
private byte[][] getMinMaxValue(DataMapRow row, int index) { DataMapRow minMaxRow = row.getRow(index); byte[][] minMax = new byte[minMaxRow.getColumnCount()][]; for (int i = 0; i < minMax.length; i++) { minMax[i] = minMaxRow.getByteArray(i); } return minMax; }
private byte[] getBlockletRowCountForEachBlock() { // taskSummary DM store will have only one row CarbonRowSchema[] taskSummarySchema = getTaskSummarySchema(); return taskSummaryDMStore .getDataMapRow(taskSummarySchema, taskSummaryDMStore.getRowCount() - 1) .getByteArray(taskSummarySchema.length - 1); }
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; }
@Override protected ExtendedBlocklet createBlocklet(DataMapRow row, String fileName, short blockletId, boolean useMinMaxForPruning) { if (isLegacyStore) { return super.createBlocklet(row, fileName, blockletId, useMinMaxForPruning); } ExtendedBlocklet blocklet = new ExtendedBlocklet(fileName, blockletId + ""); BlockletDetailInfo detailInfo = getBlockletDetailInfo(row, blockletId, blocklet); detailInfo.setColumnSchemas(getColumnSchema()); detailInfo.setBlockletInfoBinary(row.getByteArray(BLOCKLET_INFO_INDEX)); detailInfo.setPagesCount(row.getShort(BLOCKLET_PAGE_COUNT_INDEX)); detailInfo.setUseMinMaxForPruning(useMinMaxForPruning); blocklet.setDetailInfo(detailInfo); return blocklet; }
runningLength += row.getSizeInBytes(index); } else if (dataType == DataTypes.BYTE_ARRAY) { byte[] data = row.getByteArray(index); getUnsafe().copyMemory(data, BYTE_ARRAY_OFFSET, memoryBlock.getBaseObject(), memoryBlock.getBaseOffset() + runningLength, data.length); byte[] data = row.getByteArray(index); getUnsafe().putShort(memoryBlock.getBaseObject(), memoryBlock.getBaseOffset() + runningLength, (short) data.length); break; case VARIABLE_INT: byte[] data2 = row.getByteArray(index); getUnsafe().putInt(memoryBlock.getBaseObject(), memoryBlock.getBaseOffset() + runningLength, data2.length);