Class BlobStoreIndexShardSnapshot.FileInfo

java.lang.Object
org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo
All Implemented Interfaces:
Writeable
Enclosing class:
BlobStoreIndexShardSnapshot

public static class BlobStoreIndexShardSnapshot.FileInfo extends Object implements Writeable
Information about snapshotted file
  • Field Details

  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • name

      public String name()
      Returns the base file name
      Returns:
      file name
    • partName

      public String partName(int part)
      Returns part name if file is stored as multiple parts
      Parameters:
      part - part number
      Returns:
      part name
    • canonicalName

      public static String canonicalName(String blobName)
      Returns base file name from part name
      Parameters:
      blobName - part name
      Returns:
      base file name
    • physicalName

      public String physicalName()
      Returns original file name
      Returns:
      original file name
    • length

      public long length()
      File length
      Returns:
      file length
    • partSize

      public ByteSizeValue partSize()
      Returns part size
      Returns:
      part size
    • partBytes

      public long partBytes(int part)
      Returns the size (in bytes) of a given part
      Returns:
      the size (in bytes) of a given part
    • numberOfParts

      public int numberOfParts()
      Returns number of parts
      Returns:
      number of parts
    • checksum

      public String checksum()
      Returns file md5 checksum provided by Store
      Returns:
      file checksum
    • metadata

      public StoreFileMetadata metadata()
      Returns the StoreFileMetadata for this file info.
    • isSame

      public boolean isSame(StoreFileMetadata md)
      Checks if a file in a store is the same file
      Parameters:
      md - file in a store
      Returns:
      true if file in a store this this file have the same checksum and length
    • isSame

      public boolean isSame(BlobStoreIndexShardSnapshot.FileInfo fileInfo)
      Checks if a file in a store is the same file
      Parameters:
      fileInfo - file in a store
      Returns:
      true if file in a store this this file have the same checksum and length
    • toXContent

      public static void toXContent(BlobStoreIndexShardSnapshot.FileInfo file, org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Serializes file info into JSON
      Parameters:
      file - file info
      builder - XContent builder
      params - parameters
      Throws:
      IOException
    • fromXContent

      public static BlobStoreIndexShardSnapshot.FileInfo fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Parses JSON that represents file info
      Parameters:
      parser - parser
      Returns:
      file info
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object