break; case COMPRESSION_FORMAT_SNAPPY_FRAMED: compressionOut = new SnappyFramedOutputStream(bufferedOut); mimeTypeRef = "application/x-snappy-framed"; break;
break; case COMPRESSION_FORMAT_SNAPPY_FRAMED: compressionOut = new SnappyFramedOutputStream(bufferedOut); mimeTypeRef.set("application/x-snappy-framed"); break;
@Override protected OutputStream decorateWithCompression(NonClosingOutpusStreamDecorator stream) throws IOException { return new SnappyFramedOutputStream(stream, COMPRESSION_BLOCK_SIZE, MIN_COMPRESSION_RATIO); }
@Override protected OutputStream decorateWithCompression(NonClosingOutpusStreamDecorator stream) throws IOException { return new SnappyFramedOutputStream(stream, COMPRESSION_BLOCK_SIZE, MIN_COMPRESSION_RATIO); }
@Override protected OutputStream decorateWithCompression(NonClosingOutpusStreamDecorator stream) throws IOException { return new SnappyFramedOutputStream(stream, COMPRESSION_BLOCK_SIZE, MIN_COMPRESSION_RATIO); }
public static OutputStream getOutputStream(OutputStream outputStream, Compression compression) throws IOException { if (compression != null) { switch (compression) { case SNAPPY: return new SnappyFramedOutputStream(outputStream); case NONE: return outputStream; default: throw new IllegalArgumentException("Unsupported compression codec: " + compression); } } return outputStream; } }
public static OutputStream getOutputStream(OutputStream outputStream, Compression compression) throws IOException { if (compression != null) { switch (compression) { case SNAPPY: return new SnappyFramedOutputStream(outputStream); case NONE: return outputStream; default: throw new IllegalArgumentException("Unsupported compression codec: " + compression); } } return outputStream; } }
public ProtobufRecordStreamWriter(TableSchema schema, OutputStream out, CompressOption option) throws IOException { columns = schema.getColumns().toArray(new Column[0]); OutputStream tmpOut; if (option != null) { if (option.algorithm.equals(CompressOption.CompressAlgorithm.ODPS_ZLIB)) { def = new Deflater(); def.setLevel(option.level); def.setStrategy(option.strategy); tmpOut = new DeflaterOutputStream(out, def); } else if (option.algorithm.equals(CompressOption.CompressAlgorithm.ODPS_SNAPPY)) { tmpOut = new SnappyFramedOutputStream(out); } else if (option.algorithm.equals(CompressOption.CompressAlgorithm.ODPS_RAW)) { tmpOut = out; } else { throw new IOException("invalid compression option."); } } else { tmpOut = out; } bou = new CountingOutputStream(tmpOut); this.out = CodedOutputStream.newInstance(bou); }
break; case COMPRESSION_FORMAT_SNAPPY_FRAMED: compressionOut = new SnappyFramedOutputStream(bufferedOut); mimeTypeRef.set("application/x-snappy-framed"); break;