Package com.fasterxml.storemate.store

Examples of com.fasterxml.storemate.store.Storable


        if (timer != null) {
            timer.stop();
        }
        if (opStats != null) {
            if (_metricSizes != null) {
                Storable entity = opStats.getEntry();
                if (entity != null) {
                    _metricSizes.update(entity.getActualUncompressedLength());
                }
            }
            if (_metricEntryCounts != null) {
                _metricEntryCounts.update(opStats.getItemCount());
            }
View Full Code Here


        List<StorableKey> ids = requestEntity.entries;
        ArrayList<E> entries = new ArrayList<E>(ids.size());
        StorableStore store = _stores.getEntryStore();
       
        for (StorableKey key : ids) {
            Storable raw = store.findEntry(key);
            // note: this may give null as well; caller needs to check (converter passes null as-is)
            E entry = (E) _entryConverter.entryFromStorable(raw);
            entries.add(entry);
        }
        if (metadata != null) {
View Full Code Here

    public SyncPullEntry() { }

    SyncPullEntry(StoredEntry<?> src)
    {
        final Storable raw = src.getRaw();
        key = src.getKey().asStorableKey();
        creationTime = src.getCreationTime();
        checksum = raw.getContentHash();
        checksumForCompressed = raw.getCompressedHash();
       
        if (src.isDeleted()) {
            storageSize = -1L;
            size = -1L;
        } else {
            storageSize = raw.getStorageLength();
            size = raw.getOriginalLength();
        }
        compression = raw.getCompression();
        LastAccessUpdateMethod m = src.getLastAccessUpdateMethod();
        lastAccessMethod = (m == null) ? 0 : m.asByte();
        minTTLSecs = src.getMinTTLSinceAccessSecs();
        maxTTLSecs = src.getMaxTTLSecs();
       
View Full Code Here

        StorableStore store = _stores.getEntryStore();

        try {
            for (StorableKey key : ids) {
                // null -> let's not pass 'metadata' yet since we don't use timings?
                Storable raw = store.findEntry(StoreOperationSource.SYNC, null, key);
                // note: this may give null as well; caller needs to check (converter passes null as-is)
                E entry = (E) _entryConverter.entryFromStorable(raw);
                entries.add(entry);
            }
        } catch (StoreException e) {
View Full Code Here

        List<StorableKey> ids = requestEntity.entries;
        ArrayList<E> entries = new ArrayList<E>(ids.size());
        StorableStore store = _stores.getEntryStore();
       
        for (StorableKey key : ids) {
            Storable raw = store.findEntry(key);
            // note: this may give null as well; caller needs to check (converter passes null as-is)
            E entry = (E) _entryConverter.entryFromStorable(raw);
            entries.add(entry);
        }
        return (OUT) response.ok(new SyncPullResponse<E>(_fileManager, _syncPullSmileWriter, entries));
View Full Code Here

    public SyncPullEntry() { }

    SyncPullEntry(StoredEntry<?> src)
    {
        final Storable raw = src.getRaw();
        key = src.getKey().asStorableKey();
        creationTime = src.getCreationTime();
        checksum = raw.getContentHash();
        checksumForCompressed = raw.getCompressedHash();
       
        if (src.isDeleted()) {
            storageSize = -1L;
            size = -1L;
        } else {
            storageSize = raw.getStorageLength();
            size = raw.getOriginalLength();
        }
        compression = raw.getCompression();
        LastAccessUpdateMethod m = src.getLastAccessUpdateMethod();
        lastAccessMethod = (m == null) ? 0 : m.asByte();
        minTTLSecs = src.getMinTTLSinceAccessSecs();
        maxTTLSecs = src.getMaxTTLSecs();
       
View Full Code Here

        StorableStore store = _stores.getEntryStore();

        long nanoStart = System.nanoTime();
        try {
            for (StorableKey key : ids) {
                Storable raw = store.findEntry(key);
                // note: this may give null as well; caller needs to check (converter passes null as-is)
                E entry = (E) _entryConverter.entryFromStorable(raw);
                entries.add(entry);
            }
        } catch (StoreException e) {
View Full Code Here

        if (timer != null) {
            timer.stop();
        }
        if (opStats != null) {
            if (_metricSizes != null) {
                Storable entity = opStats.getEntry();
                if (entity != null) {
                    _metricSizes.update(entity.getActualUncompressedLength());
                }
            }
            if (_metricEntryCounts != null) {
                _metricEntryCounts.update(opStats.getItemCount());
            }
View Full Code Here

    protected ServletServiceResponse _handleGet(ServletServiceRequest request, ServletServiceResponse response,
            OperationDiagnostics stats, K key)
        throws IOException
    {
        Storable entry = _storeHandler.findRawEntryForInfo(key, stats);
        if (entry == null) {
            return response.notFound();
        }
        response = response.setContentTypeJson()
                .ok(_entryConverter.itemInfoFromStorable(entry));
View Full Code Here

    protected ServletServiceResponse _handleHead(ServletServiceRequest request, ServletServiceResponse response,
            OperationDiagnostics stats, K key)
        throws IOException
    {
        Storable entry = _storeHandler.findRawEntryForInfo(key, stats);
        if (entry == null) {
            return response.notFound();
        }
        // What kind of info, if any, should we return? Content-length would be possible,
        // but misleading/inaccurate, since our payload is JSON, not stored entry
View Full Code Here

TOP

Related Classes of com.fasterxml.storemate.store.Storable

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.