Class ChecksumBlobStoreFormat<T extends org.elasticsearch.xcontent.ToXContent>
java.lang.Object
org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat<T>
public final class ChecksumBlobStoreFormat<T extends org.elasticsearch.xcontent.ToXContent>
extends Object
Snapshot metadata file format used in v2.0 and above
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ToXContent.Params
static final int
-
Constructor Summary
ConstructorDescriptionChecksumBlobStoreFormat
(String codec, String blobNameFormat, CheckedBiFunction<String, org.elasticsearch.xcontent.XContentParser, T, IOException> reader) ChecksumBlobStoreFormat
(String codec, String blobNameFormat, CheckedBiFunction<String, org.elasticsearch.xcontent.XContentParser, T, IOException> reader, CheckedBiFunction<String, org.elasticsearch.xcontent.XContentParser, T, IOException> fallbackReader) -
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(String repoName, org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry, InputStream input) read
(String repoName, BlobContainer blobContainer, String name, org.elasticsearch.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
serialize
(T obj, String blobName, boolean compress, Map<String, String> extraParams, OutputStream outputStream) void
write
(T obj, BlobContainer blobContainer, String name, boolean compress) Writes blob with resolving the blob name usingblobName(java.lang.String)
method.void
write
(T obj, BlobContainer blobContainer, String name, boolean compress, Map<String, String> serializationParams) Writes blob with resolving the blob name usingblobName(java.lang.String)
method.
-
Field Details
-
SNAPSHOT_ONLY_FORMAT_PARAMS
public static final org.elasticsearch.xcontent.ToXContent.Params SNAPSHOT_ONLY_FORMAT_PARAMS -
VERSION
public static final int VERSION- See Also:
-
-
Constructor Details
-
ChecksumBlobStoreFormat
public ChecksumBlobStoreFormat(String codec, String blobNameFormat, CheckedBiFunction<String, org.elasticsearch.xcontent.XContentParser, T, IOException> reader, @Nullable CheckedBiFunction<String, org.elasticsearch.xcontent.XContentParser, T, IOException> fallbackReader) - Parameters:
codec
- codec nameblobNameFormat
- format of the blobname inString.format(java.lang.String, java.lang.Object...)
formatreader
- prototype object that can deserialize T from XContentfallbackReader
- fallback prototype object that can deserialize T from XContent in case reader fails
-
ChecksumBlobStoreFormat
public ChecksumBlobStoreFormat(String codec, String blobNameFormat, CheckedBiFunction<String, org.elasticsearch.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.xcontent.NamedXContentRegistry namedXContentRegistry) throws 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:
IOException
-
blobName
-
deserialize
public T deserialize(String repoName, org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry, InputStream input) throws IOException - Throws:
IOException
-
write
public void write(T obj, BlobContainer blobContainer, String name, boolean compress) throws IOException Writes blob with resolving the blob name usingblobName(java.lang.String)
method.The blob will optionally be compressed.
- Parameters:
obj
- object to be serializedblobContainer
- blob containername
- blob namecompress
- whether to use compression- Throws:
IOException
-
write
public void write(T obj, BlobContainer blobContainer, String name, boolean compress, Map<String, String> serializationParams) throws IOExceptionWrites blob with resolving the blob name usingblobName(java.lang.String)
method.The blob will optionally be compressed.
- Parameters:
obj
- object to be serializedblobContainer
- blob containername
- blob namecompress
- whether to use compressionserializationParams
- extra serialization parameters- Throws:
IOException
-
serialize
public void serialize(T obj, String blobName, boolean compress, OutputStream outputStream) throws IOException - Throws:
IOException
-
serialize
public void serialize(T obj, String blobName, boolean compress, Map<String, String> extraParams, OutputStream outputStream) throws IOException- Throws:
IOException
-