Class ChecksumBlobStoreFormat<T extends ToXContent>


  • public final class ChecksumBlobStoreFormat<T extends ToXContent>
    extends Object
    Snapshot metadata file format used in v2.0 and above
    • Method Detail

      • read

        public T read​(BlobContainer blobContainer,
                      String name)
               throws 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:
        IOException
      • writeAtomic

        public void writeAtomic​(T obj,
                                BlobContainer blobContainer,
                                String name)
                         throws IOException
        Writes blob in atomic manner with resolving the blob name using blobName(java.lang.String) method.

        The blob will be compressed and checksum will be written if required. Atomic move might be very inefficient on some repositories. It also cannot override existing files.

        Parameters:
        obj - object to be serialized
        blobContainer - blob container
        name - blob name
        Throws:
        IOException
      • write

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

        The blob will be compressed and checksum will be written if required.

        Parameters:
        obj - object to be serialized
        blobContainer - blob container
        name - blob name
        failIfAlreadyExists - Whether to fail if the blob already exists
        Throws:
        IOException