public class ChecksumBlobStoreFormat<T extends ToXContent> extends BlobStoreFormat<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
compress |
static int |
VERSION |
protected XContentType |
xContentType |
blobNameFormat, parseFieldMatcher, reader, SNAPSHOT_ONLY_FORMAT_PARAMS
Constructor and Description |
---|
ChecksumBlobStoreFormat(String codec,
String blobNameFormat,
FromXContentBuilder<T> reader,
ParseFieldMatcher parseFieldMatcher,
boolean compress) |
ChecksumBlobStoreFormat(String codec,
String blobNameFormat,
FromXContentBuilder<T> reader,
ParseFieldMatcher parseFieldMatcher,
boolean compress,
XContentType xContentType) |
Modifier and Type | Method and Description |
---|---|
boolean |
isTempBlobName(String blobName)
Returns true if the blob is a leftover temporary blob.
|
T |
readBlob(BlobContainer blobContainer,
String blobName)
Reads blob with specified name without resolving the blobName using using
BlobStoreFormat.blobName(java.lang.String) method. |
protected String |
tempBlobName(String name) |
protected BytesReference |
write(T obj) |
void |
write(T obj,
BlobContainer blobContainer,
String name)
Writes blob with resolving the blob name using
BlobStoreFormat.blobName(java.lang.String) method. |
protected void |
write(T obj,
StreamOutput streamOutput) |
void |
writeAtomic(T obj,
BlobContainer blobContainer,
String name)
Writes blob in atomic manner with resolving the blob name using
BlobStoreFormat.blobName(java.lang.String) and tempBlobName(java.lang.String) methods. |
protected void |
writeBlob(T obj,
BlobContainer blobContainer,
String blobName)
Writes blob in atomic manner without resolving the blobName using using
BlobStoreFormat.blobName(java.lang.String) method. |
public static final int VERSION
protected final XContentType xContentType
protected final boolean compress
public ChecksumBlobStoreFormat(String codec, String blobNameFormat, FromXContentBuilder<T> reader, ParseFieldMatcher parseFieldMatcher, boolean compress, XContentType xContentType)
codec
- codec nameblobNameFormat
- format of the blobname in String.format(java.lang.String, java.lang.Object...)
formatreader
- prototype object that can deserialize T from XContentcompress
- true if the content should be compressedxContentType
- content type that should be used for write operationspublic ChecksumBlobStoreFormat(String codec, String blobNameFormat, FromXContentBuilder<T> reader, ParseFieldMatcher parseFieldMatcher, boolean compress)
codec
- codec nameblobNameFormat
- format of the blobname in String.format(java.lang.String, java.lang.Object...)
formatreader
- prototype object that can deserialize T from XContentcompress
- true if the content should be compressedpublic T readBlob(BlobContainer blobContainer, String blobName) throws IOException
BlobStoreFormat.blobName(java.lang.String)
method.readBlob
in class BlobStoreFormat<T extends ToXContent>
blobContainer
- blob containerblobName
- blob nameIOException
public void writeAtomic(T obj, BlobContainer blobContainer, String name) throws IOException
BlobStoreFormat.blobName(java.lang.String)
and tempBlobName(java.lang.String)
methods.
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.
obj
- object to be serializedblobContainer
- blob containername
- blob nameIOException
public void write(T obj, BlobContainer blobContainer, String name) throws IOException
BlobStoreFormat.blobName(java.lang.String)
method.
The blob will be compressed and checksum will be written if required.
obj
- object to be serializedblobContainer
- blob containername
- blob nameIOException
protected void writeBlob(T obj, BlobContainer blobContainer, String blobName) throws IOException
BlobStoreFormat.blobName(java.lang.String)
method.
The blob will be compressed and checksum will be written if required.
obj
- object to be serializedblobContainer
- blob containerblobName
- blob nameIOException
public boolean isTempBlobName(String blobName)
protected BytesReference write(T obj) throws IOException
IOException
protected void write(T obj, StreamOutput streamOutput) throws IOException
IOException
Copyright © 2009–2017. All rights reserved.