break; case COMPRESSION_FORMAT_SNAPPY_FRAMED: compressionIn = new SnappyFramedInputStream(bufferedIn); break; default:
@Override protected InputStream decorateWithCompression(NonClosingInputStreamDecorator stream) throws IOException { return new SnappyFramedInputStream(stream, false); } }
@Override protected InputStream decorateWithCompression(NonClosingInputStreamDecorator stream) throws IOException { return new SnappyFramedInputStream(stream, false); } }
@Override protected InputStream decorateWithCompression(NonClosingInputStreamDecorator stream) throws IOException { return new SnappyFramedInputStream(stream, false); } }
public static InputStream getInputStream(InputStream inputStream, Compression compression) throws IOException { if (compression != null) { switch (compression) { case SNAPPY: return new SnappyFramedInputStream(inputStream); case NONE: return inputStream; default: throw new IllegalArgumentException("Unsupported compression codec: " + compression); } } return inputStream; }
public static InputStream getInputStream(InputStream inputStream, Compression compression) throws IOException { if (compression != null) { switch (compression) { case SNAPPY: return new SnappyFramedInputStream(inputStream); case NONE: return inputStream; default: throw new IllegalArgumentException("Unsupported compression codec: " + compression); } } return inputStream; }
public ProtobufRecordStreamReader(TableSchema schema, List<Column> columns, InputStream in, CompressOption option) throws IOException { if (columns == null) { this.columns = schema.getColumns().toArray(new Column[0]); } else { Column[] tmpColumns = new Column[columns.size()]; for (int i = 0; i < columns.size(); ++i) { tmpColumns[i] = schema.getColumn(columns.get(i).getName()); } this.columns = tmpColumns; } bin = new BufferedInputStream(in); if (option != null) { if (option.algorithm.equals(CompressOption.CompressAlgorithm.ODPS_ZLIB)) { this.in = CodedInputStream.newInstance(new InflaterInputStream(bin)); } else if (option.algorithm.equals(CompressOption.CompressAlgorithm.ODPS_SNAPPY)) { this.in = CodedInputStream.newInstance(new SnappyFramedInputStream(bin)); } else if (option.algorithm.equals(CompressOption.CompressAlgorithm.ODPS_RAW)) { this.in = CodedInputStream.newInstance((bin)); } else { throw new IOException("invalid compression option."); } } else { this.in = CodedInputStream.newInstance(bin); } this.in.setSizeLimit(Integer.MAX_VALUE); }
break; case COMPRESSION_FORMAT_SNAPPY_FRAMED: compressionIn = new SnappyFramedInputStream(bufferedIn); break; default: