Search in sources :

Example 1 with ByteBufferBinding

use of org.apache.qpid.server.store.berkeleydb.tuple.ByteBufferBinding in project qpid-broker-j by apache.

the class UpgraderTest method assertContent.

private void assertContent() {
    final ByteBufferBinding contentBinding = ByteBufferBinding.getInstance();
    CursorOperation contentCursorOperation = new CursorOperation() {

        @Override
        public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction, DatabaseEntry key, DatabaseEntry value) {
            long id = LongBinding.entryToLong(key);
            assertTrue("Unexpected id", id > 0);
            QpidByteBuffer content = contentBinding.entryToObject(value);
            assertNotNull("Unexpected content", content);
            assertTrue("Expected content", content.hasRemaining());
        }
    };
    new DatabaseTemplate(_environment, "MESSAGE_CONTENT", null).run(contentCursorOperation);
}
Also used : ByteBufferBinding(org.apache.qpid.server.store.berkeleydb.tuple.ByteBufferBinding) Transaction(com.sleepycat.je.Transaction) Database(com.sleepycat.je.Database) QpidByteBuffer(org.apache.qpid.server.bytebuffer.QpidByteBuffer) DatabaseEntry(com.sleepycat.je.DatabaseEntry)

Aggregations

Database (com.sleepycat.je.Database)1 DatabaseEntry (com.sleepycat.je.DatabaseEntry)1 Transaction (com.sleepycat.je.Transaction)1 QpidByteBuffer (org.apache.qpid.server.bytebuffer.QpidByteBuffer)1 ByteBufferBinding (org.apache.qpid.server.store.berkeleydb.tuple.ByteBufferBinding)1