Package com.fasterxml.storemate.shared

Examples of com.fasterxml.storemate.shared.StorableKey


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

        final StorableKey KEY1 = storableKey("data/small-LZF-1");
        final byte[] SMALL_DATA_ORIG = biggerCompressibleData(400).getBytes("UTF-8");
        final byte[] SMALL_DATA_LZF = Compressors.lzfCompress(SMALL_DATA_ORIG);
        final byte[] CUSTOM_METADATA_IN = new byte[] { (byte) 255 };

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


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

        final StorableKey KEY1 = storableKey("data/small-LZF-invalid");
        final byte[] SMALL_DATA = "ZV but not really LZF".getBytes("UTF-8");
        final byte[] CUSTOM_METADATA_IN = new byte[] { 77, 65, 13, 19, 0, 0 };

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

    {
        final long startTime = _date(2012, 7, 9);
        StorableStore store = createStore("db-delete-small", startTime);
        _verifyCounts(0L, store);

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

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

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

        final StorableKey KEY1 = storableKey("data/1");
        int origSize = StoreConfig.DEFAULT_MAX_FOR_GZIP - 100;
        final String DATA_STRING = biggerCompressibleData(origSize);
        final byte[] DATA = DATA_STRING.getBytes("UTF-8");
        final byte[] CUSTOM_METADATA_IN = new byte[] { 1, 2, 3 };
        final byte[] GZIPPED_DATA = Compressors.gzipCompress(DATA);
View Full Code Here

    {
        final long startTime = _date(2012, 7, 9);
        StorableStore store = createStore("bdb-medium-lzf", startTime);
        _verifyCounts(0L, store);

        final StorableKey KEY1 = storableKey("data/1");
        int origSize = StoreConfig.DEFAULT_MAX_FOR_GZIP + 2000;
        final String DATA_STRING = biggerCompressibleData(origSize);
        final byte[] DATA = DATA_STRING.getBytes("UTF-8");
        final byte[] CUSTOM_METADATA_IN = new byte[] { 1, 2, 3 };
        final byte[] LZF_DATA = Compressors.lzfCompress(DATA);
View Full Code Here

    }

    public void testLargerAlreadyLZF() throws Exception
    {
        StorableStore store = createStore("bdb-large-lzf", START_TIME);
        final StorableKey KEY1 = storableKey("data/small-LZF-1");
        final byte[] DATA_ORIG = biggerCompressibleData(480 * 1000).getBytes("UTF-8");
        final byte[] DATA_LZF = Compressors.lzfCompress(DATA_ORIG);
        final byte[] CUSTOM_METADATA_IN = new byte[] { (byte) 255 };

        try {
View Full Code Here

    private void _testLarger(long startTime, StorableStore store,
            int origSize) throws Exception
    {
        _verifyCounts(0L, store);

        final StorableKey KEY1 = storableKey("data/1");
        final String DATA_STRING = biggerCompressibleData(origSize);
        final byte[] DATA = DATA_STRING.getBytes("UTF-8");

        final byte[] CUSTOM_METADATA_IN = new byte[] { 1, 2, 3 };
        final byte[] COMPRESSED_DATA = Compressors.lzfCompress(DATA);
View Full Code Here

                } else {
                    entry = iter.seek(SeekOp.RANGE, dbKey(firstKey));
                }
                main_loop:
                for (; entry != null; entry = iter.get(GetOp.NEXT)) {
                    StorableKey key = storableKey(entry.getKey());
                    switch (cb.verifyKey(key)) {
                    case SKIP_ENTRY: // nothing to do
                        continue main_loop;
                    case PROCESS_ENTRY: // bind, process
                        break;
View Full Code Here

                    }
                    b = entry.getKey();
                }
                main_loop:
                while (true) {
                    StorableKey key = storableKey(b);
                    switch (cb.verifyKey(key)) {
                    case SKIP_ENTRY: // nothing to do
                        continue main_loop;
                    case TERMINATE_ITERATION: // all done?
                        return IterationResult.TERMINATED_FOR_KEY;
View Full Code Here

                        break;
                    case TERMINATE_ITERATION: // all done?
                        return IterationResult.TERMINATED_FOR_TIMESTAMP;
                    }

                    StorableKey key = _extractPrimaryKey(rawKey);
                    switch (cb.verifyKey(key)) {
                    case SKIP_ENTRY: // nothing to do
                        continue main_loop;
                    case PROCESS_ENTRY: // bind, process
                        break;
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.