Search in sources :

Example 1 with InputStreamSliceInput

use of io.airlift.slice.InputStreamSliceInput in project presto by prestodb.

the class BinaryFileSpiller method readPages.

private Iterator<Page> readPages(Path spillPath) {
    try {
        InputStream input = new BufferedInputStream(new FileInputStream(spillPath.toFile()));
        closer.register(input);
        return PagesSerdeUtil.readPages(serde, new InputStreamSliceInput(input));
    } catch (IOException e) {
        throw new PrestoException(GENERIC_INTERNAL_ERROR, "Failed to read spilled pages", e);
    }
}
Also used : BufferedInputStream(java.io.BufferedInputStream) BufferedInputStream(java.io.BufferedInputStream) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) InputStreamSliceInput(io.airlift.slice.InputStreamSliceInput) PrestoException(com.facebook.presto.spi.PrestoException) RuntimeIOException(io.airlift.slice.RuntimeIOException) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream)

Aggregations

PrestoException (com.facebook.presto.spi.PrestoException)1 InputStreamSliceInput (io.airlift.slice.InputStreamSliceInput)1 RuntimeIOException (io.airlift.slice.RuntimeIOException)1 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1