Package com.fasterxml.storemate.shared

Examples of com.fasterxml.storemate.shared.StorableKey


    @Override
    public IterationResult iterateEntriesByKey(StorableIterationCallback cb,
            StorableKey firstKey)
        throws StoreException
    {
        StorableKey key = null;
        try {
            CursorConfig config = new CursorConfig();
            Cursor crsr = _entries.openCursor(null, config);
            final DatabaseEntry keyEntry;
            final DatabaseEntry data = new DatabaseEntry();
View Full Code Here


    @Override
    public IterationResult iterateEntriesAfterKey(StorableIterationCallback cb,
            StorableKey lastSeen)
        throws StoreException
    {
        StorableKey key = null;
        try {
            Cursor crsr = _entries.openCursor(null, new CursorConfig());
            try {
                final DatabaseEntry data = new DatabaseEntry();
                final DatabaseEntry keyEntry = dbKey(lastSeen);
View Full Code Here

        throws StoreException
    {
        if (cb == null) {
            throw new IllegalArgumentException("Can not pass null 'cb' argument");
        }
        StorableKey key = null;
        try {
            CursorConfig config = new CursorConfig();
            SecondaryCursor crsr = _index.openCursor(null, config);
            final DatabaseEntry keyEntry;
            final DatabaseEntry primaryKeyEntry = new DatabaseEntry();
View Full Code Here

    protected DatabaseEntry dbValue(Storable storable) {
        return storable.withRaw(BDB_CONV);
    }

    protected StorableKey storableKey(DatabaseEntry entry) {
        return new StorableKey(entry.getData(), entry.getOffset(), entry.getSize());
    }
View Full Code Here

        TimeMasterForSimpleTesting timeMaster = new TimeMasterForSimpleTesting(startTime);
        StorableStore store = createStore("bdb-listbyname", timeMaster);

        final byte[] CUSTOM_METADATA_IN = new byte[0];

        final StorableKey KEY1 = storableKey("entryA");
        final StorableKey KEY2 = storableKey("entryB");
        final StorableKey KEY3 = storableKey("entryC");
        final StorableKey KEY4 = storableKey("entryD");
       
        /* Here we will use 4 keys, but insert them in different order, to
         * avoid relying on physical insertion order
         */
        for (StorableKey key : new StorableKey[] { KEY2, KEY4, KEY3, KEY1 } ) {
View Full Code Here

        StorableStore store = createStore("bdb-empty-1");

        // should be... empty.
        _verifyCounts(0L, store);

        StorableKey testKey = storableKey("bogus");
       
        assertNull(store.findEntry(StoreOperationSource.REQUEST, null, testKey));
       
        store.stop();
    }
View Full Code Here

        final long startTime = _date(2012, 6, 6);
        StorableStore store = createStore("bdb-small-simple", startTime);
        _verifyEntryCount(0L, store);
        _verifyIndexCount(0L, store);

        final StorableKey KEY1 = storableKey("data/entry/1");
        final String SMALL_STRING = "Some data that we want to store -- small, gets inlined...";
        final byte[] SMALL_DATA = SMALL_STRING.getBytes("UTF-8");
        final byte[] CUSTOM_METADATA_IN = new byte[] { 1, 2, 3 };

        assertNull(store.findEntry(StoreOperationSource.REQUEST, null, KEY1));
View Full Code Here

        final long startTime = _date(2012, 6, 6);
        StorableStore store = createStore("bdb-small-empty", startTime);
        _verifyEntryCount(0L, store);
        _verifyIndexCount(0L, store);

        final StorableKey KEY1 = storableKey("data/entry/0");
        final byte[] NO_DATA = new byte[0];
        final byte[] CUSTOM_METADATA_IN = new byte[] { 1, 2, 3 };

        assertNull(store.findEntry(StoreOperationSource.REQUEST, null, KEY1));
View Full Code Here

        final long startTime = _date(2012, 7, 7);
        StorableStore store = createStore("bdb-small-gzip", startTime);
        _verifyEntryCount(0L, store);
        _verifyIndexCount(0L, store);

        final StorableKey KEY1 = storableKey("data/entry/2");
        final String SMALL_STRING = this.biggerCompressibleData(400); // about 400 bytes
        final byte[] SMALL_DATA = SMALL_STRING.getBytes("UTF-8");
        final byte[] CUSTOM_METADATA_IN = new byte[] { 4, 5, 6, 7 };

        assertNull(store.findEntry(StoreOperationSource.REQUEST, null, KEY1));
View Full Code Here

    {
        final long startTime = _date(2012, 7, 8);
        StorableStore store = createStore("bdb-small-dups", startTime);
        _verifyCounts(0L, store);

        final StorableKey KEY1 = storableKey("data/entry/1");
        final byte[] SMALL_DATA = "Some smallish data...".getBytes("UTF-8");
        final byte[] CUSTOM_METADATA_IN = new byte[] { (byte) 255 };

        assertNull(store.findEntry(StoreOperationSource.REQUEST, null, KEY1));
       
View Full Code Here

TOP

Related Classes of com.fasterxml.storemate.shared.StorableKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.