AppSearchSession.CommitBlob Method

Definition

Commits the blobs to make it retrievable and immutable.

[Android.Runtime.Register("commitBlob", "(Ljava/util/Set;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "", ApiSince=36)]
public void CommitBlob(System.Collections.Generic.ICollection<Android.App.AppSearch.AppSearchBlobHandle> handles, Java.Util.Concurrent.IExecutor executor, Java.Util.Functions.IConsumer callback);
[<Android.Runtime.Register("commitBlob", "(Ljava/util/Set;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "", ApiSince=36)>]
member this.CommitBlob : System.Collections.Generic.ICollection<Android.App.AppSearch.AppSearchBlobHandle> * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit

Parameters

handles
ICollection<AppSearchBlobHandle>

The AppSearchBlobHandles that identifies the blobs.

executor
IExecutor

Executor on which to invoke the callback.

callback
IConsumer

Callback to receive the CommitBlobResponse.

Attributes

Remarks

Commits the blobs to make it retrievable and immutable.

After this call, the blob is readable via #openBlobForRead. Any change to the content or rewrite via #openBlobForWrite of this blob won't be allowed.

If the blob is already stored in AppSearch and committed. A failed AppSearchResult with error code AppSearchResult#RESULT_ALREADY_EXISTS will be associated with the AppSearchBlobHandle.

If the blob content doesn't match the digest in AppSearchBlobHandle, a failed AppSearchResult with error code AppSearchResult#RESULT_INVALID_ARGUMENT will be associated with the AppSearchBlobHandle. The pending Blob file will be removed from AppSearch.

Pending blobs won't be lost or auto-commit if AppSearchSession closed. Pending blobs will store in disk rather than memory. You can re-open AppSearchSession and re-write the pending blobs.

The default time to recycle pending and orphan blobs is 1 week. A blob will be considered as an orphan if no GenericDocument references it.

Java documentation for android.app.appsearch.AppSearchSession.commitBlob(java.util.Set<android.app.appsearch.AppSearchBlobHandle>, java.util.concurrent.Executor, java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.CommitBlobResponse>>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to