Class BlobStoreFormat<T extends ToXContent>

  • Direct Known Subclasses:
    ChecksumBlobStoreFormat

    public abstract class BlobStoreFormat<T extends ToXContent>
    extends java.lang.Object
    Base class that handles serialization of various data structures during snapshot/restore operations.
    • Constructor Detail

      • BlobStoreFormat

        protected BlobStoreFormat​(java.lang.String blobNameFormat,
                                  CheckedFunction<XContentParser,​T,​java.io.IOException> reader,
                                  NamedXContentRegistry namedXContentRegistry)
        Parameters:
        blobNameFormat - format of the blobname in String.format(Locale, String, Object...) format
        reader - the prototype object that can deserialize objects with type T
    • Method Detail

      • readBlob

        public abstract T readBlob​(BlobContainer blobContainer,
                                   java.lang.String blobName)
                            throws java.io.IOException
        Reads and parses the blob with given blob name.
        Parameters:
        blobContainer - blob container
        blobName - blob name
        Returns:
        parsed blob object
        Throws:
        java.io.IOException
      • read

        public T read​(BlobContainer blobContainer,
                      java.lang.String name)
               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
      • delete

        public void delete​(BlobContainer blobContainer,
                           java.lang.String name)
                    throws java.io.IOException
        Deletes obj in the blob container
        Throws:
        java.io.IOException
      • exists

        public boolean exists​(BlobContainer blobContainer,
                              java.lang.String name)
                       throws java.io.IOException
        Checks obj in the blob container
        Throws:
        java.io.IOException
      • blobName

        protected java.lang.String blobName​(java.lang.String name)
      • read

        protected T read​(BytesReference bytes)
                  throws java.io.IOException
        Throws:
        java.io.IOException