Package com.fasterxml.storemate.shared

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


        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


            final DatabaseEntry keyEntry = new DatabaseEntry();
            final DatabaseEntry data = new DatabaseEntry();
           
            try {
                while (crsr.getNext(keyEntry, data, null) == OperationStatus.SUCCESS) {
                    StorableKey key = _storableKey(keyEntry);
                    EntryLastAccessed entry = _lastAccessedConverter.createLastAccessed(data.getData(),
                            data.getOffset(), data.getSize());
                    if (cb.processEntry(key, entry) == IterationAction.TERMINATE_ITERATION) {
                        return IterationResult.TERMINATED_FOR_ENTRY;
                    }
View Full Code Here

    /* Internal methods
    /**********************************************************************
     */
   
    private StorableKey _storableKey(DatabaseEntry entry) {
        return new StorableKey(entry.getData(), entry.getOffset(), entry.getSize());
    }
View Full Code Here

            return (OUT) badRequest(response, "Invalid prefix: not in key range (%s) of node",
                    _cluster.getLocalState().totalRange());
        }

        // Then extract 'lastSeen', if it's passed:
        StorableKey lastSeen = null;
        String b64str = request.getQueryParameter(ClusterMateConstants.QUERY_PARAM_LAST_SEEN);
        if (b64str != null && b64str.length() > 0) {
            try {
                // Jackson can do base64 decoding, and this is the easiest way
                byte[] lastSeenRaw = _objectMapper.convertValue(b64str, byte[].class);
                lastSeen = new StorableKey(lastSeenRaw);
            } catch (Exception e) {
                return (OUT) badRequest(response, "Invalid '"+ClusterMateConstants.QUERY_PARAM_LAST_SEEN
                        +"' value; not valid base64 encoded byte sequence");
            }
        }
        // Otherwise can start listing
        boolean useSmile = _acceptSmileContentType(request);
        final StorableKey rawPrefix = prefix.asStorableKey();
        ListLimits limits = DEFAULT_LIST_LIMITS;

        String maxStr = request.getQueryParameter(ClusterMateConstants.QUERY_PARAM_MAX_ENTRIES);
        if (maxStr != null) {
            limits = limits.withMaxEntries(_decodeInt(maxStr, limits.getMaxEntries()));
View Full Code Here

            final DatabaseEntry keyEntry = new DatabaseEntry();
            final DatabaseEntry data = new DatabaseEntry();
           
            try {
                while (crsr.getNext(keyEntry, data, null) == OperationStatus.SUCCESS) {
                    StorableKey key = _storableKey(keyEntry);
                    EntryLastAccessed entry = _entryConverter.createLastAccessed(data.getData(),
                            data.getOffset(), data.getSize());

                    if (cb.processEntry(key, entry) == IterationAction.TERMINATE_ITERATION) {
                        return IterationResult.TERMINATED_FOR_ENTRY;
View Full Code Here

    /* Internal methods
    /**********************************************************************
     */
   
    protected StorableKey _storableKey(DatabaseEntry entry) {
        return new StorableKey(entry.getData(), entry.getOffset(), entry.getSize());
    }
View Full Code Here

            final DatabaseEntry keyEntry = new DatabaseEntry();
            final DatabaseEntry data = new DatabaseEntry();
           
            try {
                while (crsr.getNext(keyEntry, data, null) == OperationStatus.SUCCESS) {
                    StorableKey key = _storableKey(keyEntry);
                    EntryLastAccessed entry = _entryConverter.createLastAccessed(data.getData(),
                            data.getOffset(), data.getSize());

                    if (cb.processEntry(key, entry) == IterationAction.TERMINATE_ITERATION) {
                        return IterationResult.TERMINATED_FOR_ENTRY;
View Full Code Here

    /* Internal methods
    /**********************************************************************
     */
   
    protected StorableKey _storableKey(DatabaseEntry entry) {
        return new StorableKey(entry.getData(), entry.getOffset(), entry.getSize());
    }
View Full Code Here

TOP

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

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.