| 1 | /** |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | #ifndef ORC_COMPRESSION_HH |
| 20 | #define ORC_COMPRESSION_HH |
| 21 | |
| 22 | #include "io/InputStream.hh" |
| 23 | #include "io/OutputStream.hh" |
| 24 | |
| 25 | namespace orc { |
| 26 | |
| 27 | /** |
| 28 | * Create a decompressor for the given compression kind. |
| 29 | * @param kind the compression type to implement |
| 30 | * @param input the input stream that is the underlying source |
| 31 | * @param bufferSize the maximum size of the buffer |
| 32 | * @param pool the memory pool |
| 33 | */ |
| 34 | std::unique_ptr<SeekableInputStream> |
| 35 | createDecompressor(CompressionKind kind, |
| 36 | std::unique_ptr<SeekableInputStream> input, |
| 37 | uint64_t bufferSize, |
| 38 | MemoryPool& pool); |
| 39 | |
| 40 | /** |
| 41 | * Create a compressor for the given compression kind. |
| 42 | * @param kind the compression type to implement |
| 43 | * @param outStream the output stream that is the underlying target |
| 44 | * @param strategy compression strategy |
| 45 | * @param bufferCapacity compression stream buffer total capacity |
| 46 | * @param compressionBlockSize compresssion buffer block size |
| 47 | * @param pool the memory pool |
| 48 | */ |
| 49 | std::unique_ptr<BufferedOutputStream> |
| 50 | createCompressor(CompressionKind kind, |
| 51 | OutputStream * outStream, |
| 52 | CompressionStrategy strategy, |
| 53 | uint64_t bufferCapacity, |
| 54 | uint64_t compressionBlockSize, |
| 55 | MemoryPool& pool); |
| 56 | } |
| 57 | |
| 58 | #endif |
| 59 | |