]>
Commit | Line | Data |
---|---|---|
494da23a TL |
1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
2 | // This source code is licensed under both the GPLv2 (found in the | |
3 | // COPYING file in the root directory) and Apache 2.0 License | |
4 | // (found in the LICENSE.Apache file in the root directory). | |
5 | ||
6 | package org.rocksdb; | |
7 | ||
8 | /** | |
9 | * TraceWriter allows exporting RocksDB traces to any system, | |
10 | * one operation at a time. | |
11 | */ | |
12 | public interface TraceWriter { | |
13 | ||
14 | /** | |
15 | * Write the data. | |
16 | * | |
17 | * @param data the data | |
18 | * | |
19 | * @throws RocksDBException if an error occurs whilst writing. | |
20 | */ | |
21 | void write(final Slice data) throws RocksDBException; | |
22 | ||
23 | /** | |
24 | * Close the writer. | |
25 | * | |
26 | * @throws RocksDBException if an error occurs whilst closing the writer. | |
27 | */ | |
28 | void closeWriter() throws RocksDBException; | |
29 | ||
30 | /** | |
31 | * Get the size of the file that this writer is writing to. | |
32 | * | |
33 | * @return the file size | |
34 | */ | |
35 | long getFileSize(); | |
36 | } |