Class BlobStoreFormat<T extends ToXContent>
- java.lang.Object
-
- org.elasticsearch.repositories.blobstore.BlobStoreFormat<T>
-
- Direct Known Subclasses:
ChecksumBlobStoreFormat
public abstract class BlobStoreFormat<T extends ToXContent> extends java.lang.ObjectBase class that handles serialization of various data structures during snapshot/restore operations.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringblobNameFormatprotected NamedXContentRegistrynamedXContentRegistryprotected CheckedFunction<XContentParser,T,java.io.IOException>readerprotected static ToXContent.ParamsSNAPSHOT_ONLY_FORMAT_PARAMS
-
Constructor Summary
Constructors Modifier Constructor Description protectedBlobStoreFormat(java.lang.String blobNameFormat, CheckedFunction<XContentParser,T,java.io.IOException> reader, NamedXContentRegistry namedXContentRegistry)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringblobName(java.lang.String name)voiddelete(BlobContainer blobContainer, java.lang.String name)Deletes obj in the blob containerbooleanexists(BlobContainer blobContainer, java.lang.String name)Checks obj in the blob containerTread(BlobContainer blobContainer, java.lang.String name)Reads and parses the blob with given name, applying name translation using the {link #blobName} methodprotected Tread(BytesReference bytes)abstract TreadBlob(BlobContainer blobContainer, java.lang.String blobName)Reads and parses the blob with given blob name.
-
-
-
Field Detail
-
blobNameFormat
protected final java.lang.String blobNameFormat
-
reader
protected final CheckedFunction<XContentParser,T extends ToXContent,java.io.IOException> reader
-
namedXContentRegistry
protected final NamedXContentRegistry namedXContentRegistry
-
SNAPSHOT_ONLY_FORMAT_PARAMS
protected static final ToXContent.Params SNAPSHOT_ONLY_FORMAT_PARAMS
-
-
Constructor Detail
-
BlobStoreFormat
protected BlobStoreFormat(java.lang.String blobNameFormat, CheckedFunction<XContentParser,T,java.io.IOException> reader, NamedXContentRegistry namedXContentRegistry)- Parameters:
blobNameFormat- format of the blobname inString.format(Locale, String, Object...)formatreader- 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 containerblobName- 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 containername- 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
-
-