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 org.elasticsearch.common.xcontent.ToXContent.Params
SNAPSHOT_ONLY_FORMAT_PARAMS
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, BigArrays bigArrays)
Reads and parses the blob with given name, applying name translation using the {link #blobName} methodvoid
serialize(T obj, java.lang.String blobName, boolean compress, BigArrays bigArrays, org.elasticsearch.common.CheckedConsumer<BytesReference,java.io.IOException> consumer)
void
write(T obj, BlobContainer blobContainer, java.lang.String name, boolean compress, BigArrays bigArrays)
Writes blob with resolving the blob name usingblobName(java.lang.String)
method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
SNAPSHOT_ONLY_FORMAT_PARAMS
public static final org.elasticsearch.common.xcontent.ToXContent.Params SNAPSHOT_ONLY_FORMAT_PARAMS -
VERSION
public static final int VERSION- See Also:
- Constant Field Values
-
-
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 nameblobNameFormat
- format of the blobname inString.format(java.lang.String, java.lang.Object...)
formatreader
- 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, BigArrays bigArrays) throws java.io.IOExceptionReads 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
-
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, BigArrays bigArrays) throws java.io.IOExceptionWrites blob with resolving the blob name usingblobName(java.lang.String)
method.The blob will optionally by compressed.
- Parameters:
obj
- object to be serializedblobContainer
- blob containername
- blob namecompress
- whether to use compression- Throws:
java.io.IOException
-
serialize
public void serialize(T obj, java.lang.String blobName, boolean compress, BigArrays bigArrays, org.elasticsearch.common.CheckedConsumer<BytesReference,java.io.IOException> consumer) throws java.io.IOException- Throws:
java.io.IOException
-