Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.service.sync;
 
Helper POJO to contain details of individual syncable entry, in minimal form: just enough to know if a sync is needed.
    // External key for accessing the entry
    public StorableKey key;
    // (storage) size needed for estimating how many we should request
    public long size;
    // Of timestamps, just need 'insertionTime' (i.e. last state modification);
    // creationTime only needed if we do sync
    public long insertionTime;
    
    static SyncListResponseEntry valueOf(StoredEntry<?> src)
    {
        SyncListResponseEntry e = new SyncListResponseEntry();
        e.key = src.getKey().asStorableKey();
        Storable raw = src.getRaw();
        e.insertionTime = raw.getLastModified();
        e.size = raw.isDeleted() ? -1L : raw.getStorageLength();
        return e;
    }
    // use 'non-getter' name to avoid getting serialized
    public boolean deleted() {
        return  < 0L;
    }
New to GrepCode? Check out our FAQ X