Search in sources :

Example 1 with DoubleStreamCheckpoint

use of com.facebook.presto.orc.checkpoint.DoubleStreamCheckpoint in project presto by prestodb.

the class DoubleOutputStream method recordCheckpoint.

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

Example 2 with DoubleStreamCheckpoint

use of com.facebook.presto.orc.checkpoint.DoubleStreamCheckpoint in project presto by prestodb.

the class DoubleColumnWriter method getIndexStreams.

@Override
public List<StreamDataOutput> getIndexStreams() 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(column, StreamKind.ROW_INDEX, slice.length(), false);
    return ImmutableList.of(new StreamDataOutput(slice, stream));
}
Also used : ColumnStatistics(com.facebook.presto.orc.metadata.statistics.ColumnStatistics) BooleanStreamCheckpoint(com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint) ImmutableList(com.google.common.collect.ImmutableList) StreamDataOutput(com.facebook.presto.orc.stream.StreamDataOutput) DoubleStreamCheckpoint(com.facebook.presto.orc.checkpoint.DoubleStreamCheckpoint) BooleanStreamCheckpoint(com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint) RowGroupIndex(com.facebook.presto.orc.metadata.RowGroupIndex) Slice(io.airlift.slice.Slice) DoubleStreamCheckpoint(com.facebook.presto.orc.checkpoint.DoubleStreamCheckpoint) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) PresentOutputStream(com.facebook.presto.orc.stream.PresentOutputStream) Stream(com.facebook.presto.orc.metadata.Stream) DoubleOutputStream(com.facebook.presto.orc.stream.DoubleOutputStream)

Aggregations

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