Package com.fasterxml.storemate.shared

Examples of com.fasterxml.storemate.shared.StorableKey$Provider


    protected byte[] dbKey(StorableKey key) {
        return key.asBytes();
    }

    protected StorableKey storableKey(byte[] raw) {
        return new StorableKey(raw);
    }
View Full Code Here


        return toIndex+1;
    }

    protected StorableKey _extractPrimaryKey(byte[] indexKey) {
        // First 8 bytes are timestamp, rest is key
        return new StorableKey(indexKey, 8, indexKey.length - 8);
    }
View Full Code Here

*/
public abstract class StoreTestBase extends SharedTestBase
{
    public StorableKey storableKey(String str)
    {
        return new StorableKey(UTF8Encoder.encodeAsUTF8(str));
    }
View Full Code Here

    ///////////////////////////////////////////////////////////////////////
     */

    @Override
    public StorableKey storableKey(String str) {
        return new StorableKey(UTF8Encoder.encodeAsUTF8(str));
    }
View Full Code Here

    public IterationResult scanEntries(LastAccessIterationCallback cb)
        throws StoreException
    {
        // !!! TODO: make more efficient. Until then, just use in-order traversal
        //   Would Snapshot make sense here?
        StorableKey key = null;
        try {
            DBIterator iter = _store.iterator();
            try {
                iter.seekToFirst();

                while (iter.hasNext()) {
                    Map.Entry<byte[], byte[]> entry = iter.next();
                    key = _storableKey(entry.getKey());
                    byte[] b = key.asBytes();
                    EntryLastAccessed lastAcc = _lastAccessedConverter.createLastAccessed(b, 0, b.length);
                    if (cb.processEntry(key, lastAcc) == IterationAction.TERMINATE_ITERATION) {
                        return IterationResult.TERMINATED_FOR_ENTRY;
                    }
                }
View Full Code Here

    private byte[] _lastAccessKey(K key, ACC method) {
        return _lastAccessedConverter.createLastAccessedKey(key, method);
    }

    protected StorableKey _storableKey(byte[] raw) {
        return new StorableKey(raw);
    }
View Full Code Here

    @Override
    public IterationResult iterateEntriesByKey(StorableIterationCallback cb,
            StorableKey firstKey)
        throws StoreException
    {
        StorableKey key = null;
        try {
            DBIterator iter = _dataDB.iterator();
            try {
                if (firstKey == null) {
                    iter.seekToFirst();
View Full Code Here

    @Override
    public IterationResult iterateEntriesAfterKey(StorableIterationCallback cb,
            StorableKey lastSeen)
        throws StoreException
    {
        StorableKey key = null;
        try {
            final byte[] lastSeenRaw = dbKey(lastSeen);
            DBIterator iter = _dataDB.iterator();
            try {
                iter.seek(lastSeenRaw);
View Full Code Here

    {
        if (cb == null) {
            throw new IllegalArgumentException("Can not pass null 'cb' argument");
        }

        StorableKey key = null;
        try {
            DBIterator iter = _indexDB.iterator();

            if (firstTimestamp <= 0L) { // from beginning (i.e. no ranges)
                iter.seekToFirst();
View Full Code Here

    protected byte[] dbKey(StorableKey key) {
        return key.asBytes();
    }

    protected StorableKey storableKey(byte[] raw) {
        return new StorableKey(raw);
    }
View Full Code Here

TOP

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

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.