Class ChecksumBlobStoreFormat<T extends org.elasticsearch.common.xcontent.ToXContent>

java.lang.Object
org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat<T>

public final class ChecksumBlobStoreFormat<T extends org.elasticsearch.common.xcontent.ToXContent>
extends java.lang.Object
Snapshot metadata file format used in v2.0 and above
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int VERSION  
  • Constructor Summary

    Constructors 
    Constructor Description
    ChecksumBlobStoreFormat​(java.lang.String codec, java.lang.String blobNameFormat, org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,​T,​java.io.IOException> reader)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String blobName​(java.lang.String name)  
    T deserialize​(java.lang.String blobName, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry, BytesReference bytes)  
    T read​(BlobContainer blobContainer, java.lang.String name, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry)
    Reads and parses the blob with given name, applying name translation using the {link #blobName} method
    BytesReference serialize​(T obj, java.lang.String blobName, boolean compress)  
    void write​(T obj, BlobContainer blobContainer, java.lang.String name, boolean compress)
    Writes blob with resolving the blob name using blobName(java.lang.String) method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ChecksumBlobStoreFormat

      public ChecksumBlobStoreFormat​(java.lang.String codec, java.lang.String blobNameFormat, org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,​T,​java.io.IOException> reader)
      Parameters:
      codec - codec name
      blobNameFormat - format of the blobname in String.format(java.lang.String, java.lang.Object...) format
      reader - prototype object that can deserialize T from XContent
  • Method Details

    • read

      public T read​(BlobContainer blobContainer, java.lang.String name, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry) throws java.io.IOException
      Reads and parses the blob with given name, applying name translation using the {link #blobName} method
      Parameters:
      blobContainer - blob container
      name - name to be translated into
      Returns:
      parsed blob object
      Throws:
      java.io.IOException
    • blobName

      public java.lang.String blobName​(java.lang.String name)
    • deserialize

      public T deserialize​(java.lang.String blobName, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry, BytesReference bytes) throws java.io.IOException
      Throws:
      java.io.IOException
    • write

      public void write​(T obj, BlobContainer blobContainer, java.lang.String name, boolean compress) throws java.io.IOException
      Writes blob with resolving the blob name using blobName(java.lang.String) method.

      The blob will optionally by compressed.

      Parameters:
      obj - object to be serialized
      blobContainer - blob container
      name - blob name
      compress - whether to use compression
      Throws:
      java.io.IOException
    • serialize

      public BytesReference serialize​(T obj, java.lang.String blobName, boolean compress) throws java.io.IOException
      Throws:
      java.io.IOException