Search in sources :

Example 1 with DoubleStreamCheckpoint

use of io.prestosql.orc.checkpoint.DoubleStreamCheckpoint in project hetu-core by openlookeng.

the class DoubleColumnWriter method getIndexStreams.

@Override
public List<StreamDataOutput> getIndexStreams(CompressedMetadataWriter metadataWriter) throws IOException {
    checkState(closed);
    ImmutableList.Builder<RowGroupIndex> rowGroupIndexes = ImmutableList.builder();
    List<DoubleStreamCheckpoint> dataCheckpoints = dataStream.getCheckpoints();
    Optional<List<BooleanStreamCheckpoint>> presentCheckpoints = presentStream.getCheckpoints();
    for (int i = 0; i < rowGroupColumnStatistics.size(); i++) {
        int groupId = i;
        ColumnStatistics columnStatistics = rowGroupColumnStatistics.get(groupId);
        DoubleStreamCheckpoint dataCheckpoint = dataCheckpoints.get(groupId);
        Optional<BooleanStreamCheckpoint> presentCheckpoint = presentCheckpoints.map(checkpoints -> checkpoints.get(groupId));
        List<Integer> positions = createDoubleColumnPositionList(compressed, dataCheckpoint, presentCheckpoint);
        rowGroupIndexes.add(new RowGroupIndex(positions, columnStatistics));
    }
    Slice slice = metadataWriter.writeRowIndexes(rowGroupIndexes.build());
    Stream stream = new Stream(columnId, StreamKind.ROW_INDEX, slice.length(), false);
    return ImmutableList.of(new StreamDataOutput(slice, stream));
}
Also used : ColumnStatistics(io.prestosql.orc.metadata.statistics.ColumnStatistics) BooleanStreamCheckpoint(io.prestosql.orc.checkpoint.BooleanStreamCheckpoint) ImmutableList(com.google.common.collect.ImmutableList) StreamDataOutput(io.prestosql.orc.stream.StreamDataOutput) BooleanStreamCheckpoint(io.prestosql.orc.checkpoint.BooleanStreamCheckpoint) DoubleStreamCheckpoint(io.prestosql.orc.checkpoint.DoubleStreamCheckpoint) RowGroupIndex(io.prestosql.orc.metadata.RowGroupIndex) Slice(io.airlift.slice.Slice) DoubleStreamCheckpoint(io.prestosql.orc.checkpoint.DoubleStreamCheckpoint) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) DoubleOutputStream(io.prestosql.orc.stream.DoubleOutputStream) PresentOutputStream(io.prestosql.orc.stream.PresentOutputStream) Stream(io.prestosql.orc.metadata.Stream)

Example 2 with DoubleStreamCheckpoint

use of io.prestosql.orc.checkpoint.DoubleStreamCheckpoint in project hetu-core by openlookeng.

the class DoubleOutputStream method recordCheckpoint.

@Override
public void recordCheckpoint() {
    checkState(!closed);
    checkpoints.add(new DoubleStreamCheckpoint(buffer.getCheckpoint()));
}
Also used : DoubleStreamCheckpoint(io.prestosql.orc.checkpoint.DoubleStreamCheckpoint)

Aggregations

DoubleStreamCheckpoint (io.prestosql.orc.checkpoint.DoubleStreamCheckpoint)2 ImmutableList (com.google.common.collect.ImmutableList)1 Slice (io.airlift.slice.Slice)1 BooleanStreamCheckpoint (io.prestosql.orc.checkpoint.BooleanStreamCheckpoint)1 RowGroupIndex (io.prestosql.orc.metadata.RowGroupIndex)1 Stream (io.prestosql.orc.metadata.Stream)1 ColumnStatistics (io.prestosql.orc.metadata.statistics.ColumnStatistics)1 DoubleOutputStream (io.prestosql.orc.stream.DoubleOutputStream)1 PresentOutputStream (io.prestosql.orc.stream.PresentOutputStream)1 StreamDataOutput (io.prestosql.orc.stream.StreamDataOutput)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1