summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/BtreeCompressor.java
diff options
context:
space:
mode:
authorLorry <lorry@roadtrain.codethink.co.uk>2012-07-20 20:00:05 +0100
committerLorry <lorry@roadtrain.codethink.co.uk>2012-07-20 20:00:05 +0100
commit3ef782d3745ea8f25a3151561a3cfb882190210e (patch)
tree86b9c2f5fde051dd0bced99b3fc9f5a3ba08db69 /lang/java/src/com/sleepycat/db/BtreeCompressor.java
downloadberkeleydb-3ef782d3745ea8f25a3151561a3cfb882190210e.tar.gz
Tarball conversion
Diffstat (limited to 'lang/java/src/com/sleepycat/db/BtreeCompressor.java')
-rw-r--r--lang/java/src/com/sleepycat/db/BtreeCompressor.java63
1 files changed, 63 insertions, 0 deletions
diff --git a/lang/java/src/com/sleepycat/db/BtreeCompressor.java b/lang/java/src/com/sleepycat/db/BtreeCompressor.java
new file mode 100644
index 00000000..d6c45851
--- /dev/null
+++ b/lang/java/src/com/sleepycat/db/BtreeCompressor.java
@@ -0,0 +1,63 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001, 2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * $Id$
+ */
+
+package com.sleepycat.db;
+
+/**
+An interface specifying how Btree compression works.
+*/
+public interface BtreeCompressor {
+ /**
+ The application-specific Btree compress callback.
+ <p>
+ The compress function must return true on success and false on failure. If
+ the compressed data is larger than dest.getUserBufferLength() the function
+ should set the required length in the dest DatabaseEntry via setSize and
+ return false.
+ <p>
+ @param db
+ The enclosing database handle.
+ @param prevKey
+ A database entry representing the previous key from the compressed stream.
+ @param prevData
+ A database entry representing the data matching prevKey key entry.
+ @param key
+ A database entry representing representing the application supplied key.
+ @param data
+ A database entry representing representing the application supplied data.
+ @param dest
+ A database entry representing the data stored in the tree. This is where
+ the callback function should write the compressed data.
+ */
+ boolean compress(Database db, DatabaseEntry prevKey, DatabaseEntry prevData,
+ DatabaseEntry key, DatabaseEntry data, DatabaseEntry dest);
+
+ /**
+ The application-specific Btree decompress callback.
+ <p>
+ The decompress function must return true on success, and false on failure.
+ <p>
+ @param db
+ The enclosing database handle.
+ @param prevKey
+ A database entry representing the previous key from the compressed stream.
+ @param prevData
+ A database entry representing the data matching prevKey key entry.
+ @param compressed
+ A database entry representing the data stored in the tree. That is the
+ compressed data.
+ @param key
+ A database entry representing representing the application supplied key.
+ @param data
+ A database entry representing representing the application supplied data.
+ */
+ boolean decompress(Database db, DatabaseEntry prevKey,
+ DatabaseEntry prevData, DatabaseEntry compressed, DatabaseEntry key,
+ DatabaseEntry data);
+}
+