Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.storemate.store;
  
Helper class for containing information needed for storing entries.
 
     implements Cloneable
 {
     /*
     /**********************************************************************
     /* Input data, provided by caller
     /**********************************************************************
      */

    
Size of content before compression, if known (-1 to indicate N/A); may be provided by caller
 
     public long uncompressedSize = -1L;

    
Murmur3/32 (seed 0) hash code on uncompressed content; 0 means "not available"
 
     public int contentHash;

    
Optional Murmur3/32 (seed 0) hash code on compressed content 0 means "not available"
 
     public int compressedContentHash;

    
Compression method used for content, if any. If left as null, means "not known" and store can compress it as it sees fit; if not null, server is NOT to do anything beyond possibly verifying that content has valid signature for compression method.
 
     public Compression compression;
 
     /*
     /**********************************************************************
     /* Additional gathered state
     /**********************************************************************
      */
 
     public boolean deleted;
 
     public boolean replicated;

    
Timestamp used for the BDB entry to store
 
     public long modtime;

    
For external entries, File in which actual data was written.
 
     public FileReference dataFile;
 
     public long storageSize = -1L;
     
     /*
     /**********************************************************************
     /* Construction
     /**********************************************************************
      */
     
     public StorableCreationMetadata(Compression comp,
             int contentHashint compressedContentHash)
     {
          = comp;
         this. = contentHash;
         this. = compressedContentHash
     }
 
     @Override
     public StorableCreationMetadata clone() {
         try {
             return (StorableCreationMetadatasuper.clone();
         } catch (CloneNotSupportedException e) {
             throw new RuntimeException("Failed clone(): "+e.getMessage(), e);
         }
     }
     
     /*
     /**********************************************************************
     /* Helper methods
     /**********************************************************************
      */
 
     public boolean usesCompression() {
        return ( != null) && ( != .);
    }
    public byte compressionAsByte() {
        if ( == null) {
            return 0;
        }
        return (byte.asIndex();
    }
    public byte statusAsByte()
    {
        int status =  ? . : 0;
        if () {
            status |= .;
        }
        return (bytestatus;
    }
New to GrepCode? Check out our FAQ X