Class StoreFileMetaData

  • All Implemented Interfaces:
    Writeable

    public class StoreFileMetaData
    extends java.lang.Object
    implements Writeable
    • Constructor Summary

      Constructors 
      Constructor Description
      StoreFileMetaData​(java.lang.String name, long length, java.lang.String checksum, org.apache.lucene.util.Version writtenBy)  
      StoreFileMetaData​(java.lang.String name, long length, java.lang.String checksum, org.apache.lucene.util.Version writtenBy, org.apache.lucene.util.BytesRef hash)  
      StoreFileMetaData​(StreamInput in)
      Read from a stream.
    • Method Summary

      Modifier and Type Method Description
      java.lang.String checksum()
      Returns a string representation of the files checksum.
      org.apache.lucene.util.BytesRef hash()
      Returns a variable length hash of the file represented by this metadata object.
      boolean isSame​(StoreFileMetaData other)
      Returns true iff the length and the checksums are the same.
      long length()
      the actual file size on "disk", if compressed, the compressed size
      java.lang.String name()
      Returns the name of this file
      java.lang.String toString()  
      void writeTo​(StreamOutput out)
      Write this into the StreamOutput.
      org.apache.lucene.util.Version writtenBy()
      Returns the Lucene version this file has been written by or null if unknown
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StoreFileMetaData

        public StoreFileMetaData​(java.lang.String name,
                                 long length,
                                 java.lang.String checksum,
                                 org.apache.lucene.util.Version writtenBy)
      • StoreFileMetaData

        public StoreFileMetaData​(java.lang.String name,
                                 long length,
                                 java.lang.String checksum,
                                 org.apache.lucene.util.Version writtenBy,
                                 org.apache.lucene.util.BytesRef hash)
      • StoreFileMetaData

        public StoreFileMetaData​(StreamInput in)
                          throws java.io.IOException
        Read from a stream.
        Throws:
        java.io.IOException
    • Method Detail

      • name

        public java.lang.String name()
        Returns the name of this file
      • length

        public long length()
        the actual file size on "disk", if compressed, the compressed size
      • checksum

        public java.lang.String checksum()
        Returns a string representation of the files checksum. Since Lucene 4.8 this is a CRC32 checksum written by lucene.
      • isSame

        public boolean isSame​(StoreFileMetaData other)
        Returns true iff the length and the checksums are the same. otherwise false
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writtenBy

        public org.apache.lucene.util.Version writtenBy()
        Returns the Lucene version this file has been written by or null if unknown
      • hash

        public org.apache.lucene.util.BytesRef hash()
        Returns a variable length hash of the file represented by this metadata object. This can be the file itself if the file is small enough. If the length of the hash is 0 no hash value is available