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 Object
Snapshot metadata file format used in v2.0 and above
-
Field Summary
Modifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ToXContent.Params
static int
-
Constructor Summary
ConstructorDescriptionChecksumBlobStoreFormat(String codec, String blobNameFormat, CheckedBiFunction<String,org.elasticsearch.common.xcontent.XContentParser,T,IOException> reader)
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize(String repoName, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry, InputStream input)
read(String repoName, BlobContainer blobContainer, String name, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry)
Reads and parses the blob with given name, applying name translation using the {link #blobName} methodvoid
serialize(T obj, String blobName, boolean compress, OutputStream outputStream)
void
write(T obj, BlobContainer blobContainer, String name, boolean compress)
Writes blob with resolving the blob name usingblobName(java.lang.String)
method.
-
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(String codec, String blobNameFormat, CheckedBiFunction<String,org.elasticsearch.common.xcontent.XContentParser,T,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(String repoName, BlobContainer blobContainer, String name, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry) throws 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:
IOException
-
blobName
-
deserialize
public T deserialize(String repoName, org.elasticsearch.common.xcontent.NamedXContentRegistry namedXContentRegistry, InputStream input) throws IOException- Throws:
IOException
-
write
public void write(T obj, BlobContainer blobContainer, String name, boolean compress) throws 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:
IOException
-
serialize
public void serialize(T obj, String blobName, boolean compress, OutputStream outputStream) throws IOException- Throws:
IOException
-