Module org.elasticsearch.server
Class BlobContainerUtils
java.lang.Object
org.elasticsearch.common.blobstore.support.BlobContainerUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic BytesReference
getRegisterBlobContents
(long value) Convert thelong
value into its representation in bytes for storage in a blob store register.static long
getRegisterUsingConsistentRead
(InputStream inputStream, String container, String key) Many blob stores have consistent (linearizable/atomic) read semantics and in these casees it is safe to implementBlobContainer.getRegister(java.lang.String, org.elasticsearch.action.ActionListener<java.util.OptionalLong>)
by simply reading the blob using this utility.
-
Method Details
-
getRegisterUsingConsistentRead
public static long getRegisterUsingConsistentRead(InputStream inputStream, String container, String key) throws IOException Many blob stores have consistent (linearizable/atomic) read semantics and in these casees it is safe to implementBlobContainer.getRegister(java.lang.String, org.elasticsearch.action.ActionListener<java.util.OptionalLong>)
by simply reading the blob using this utility. NB it is not safe for the supplied stream to resume a partial downloads, because the resumed stream may see a different state from the original.- Throws:
IOException
-
getRegisterBlobContents
Convert thelong
value into its representation in bytes for storage in a blob store register.- Throws:
IOException
-