V - Type of values to write to Couchbasepublic class CouchbaseTableWriteFunction<V> extends BaseCouchbaseTableFunction<V> implements org.apache.samza.table.remote.TableWriteFunction<java.lang.String,V>
JsonObject or
any other Object. If the value type is JsonObject, data will be stored in Couchbase in JSON format, which can be
queried with N1QL. Otherwise, a Serde needs to be provided to serialize and
deserialize the value object.bucket, bucketName, clusterNodes, environmentConfigs, timeout, ttl, valueSerde| Constructor and Description |
|---|
CouchbaseTableWriteFunction(java.lang.String bucketName,
java.lang.Class<V> valueClass,
java.lang.String... clusterNodes)
Construct an instance of
CouchbaseTableWriteFunction. |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.concurrent.CompletableFuture<java.lang.Void> |
asyncWriteHelper(rx.Observable<? extends com.couchbase.client.java.document.Document> observable,
java.lang.String errorMessage) |
protected <T> java.util.concurrent.CompletableFuture<T> |
asyncWriteHelper(rx.Observable<? extends com.couchbase.client.java.document.Document> observable,
java.lang.String errorMessage,
boolean isVoid) |
java.util.concurrent.CompletableFuture<java.lang.Void> |
deleteAsync(java.lang.String key) |
void |
init(org.apache.samza.context.Context context,
org.apache.samza.table.AsyncReadWriteTable table) |
java.util.concurrent.CompletableFuture<java.lang.Void> |
putAsync(java.lang.String key,
V record) |
close, isRetriable, withBootstrapCarrierDirectPort, withBootstrapCarrierSslPort, withBootstrapHttpDirectPort, withBootstrapHttpSslPort, withSerde, withSslEnabledAndCertAuthEnabled, withSslKeystoreFileAndPassword, withSslTruststoreFileAndPassword, withTimeout, withTtl, withUsernameAndPasswordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic CouchbaseTableWriteFunction(java.lang.String bucketName,
java.lang.Class<V> valueClass,
java.lang.String... clusterNodes)
CouchbaseTableWriteFunction.bucketName - Name of the couchbase bucketclusterNodes - Some Hosts of the Couchbase cluster. Recommended to provide more than one nodes so that if
the first node could not be connected, other nodes can be tried.valueClass - Type of valuespublic void init(org.apache.samza.context.Context context,
org.apache.samza.table.AsyncReadWriteTable table)
init in interface org.apache.samza.table.remote.TableFunctioninit in class BaseCouchbaseTableFunction<V>public java.util.concurrent.CompletableFuture<java.lang.Void> putAsync(java.lang.String key,
V record)
putAsync in interface org.apache.samza.table.remote.TableWriteFunction<java.lang.String,V>public java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync(java.lang.String key)
deleteAsync in interface org.apache.samza.table.remote.TableWriteFunction<java.lang.String,V>protected java.util.concurrent.CompletableFuture<java.lang.Void> asyncWriteHelper(rx.Observable<? extends com.couchbase.client.java.document.Document> observable,
java.lang.String errorMessage)
protected <T> java.util.concurrent.CompletableFuture<T> asyncWriteHelper(rx.Observable<? extends com.couchbase.client.java.document.Document> observable,
java.lang.String errorMessage,
boolean isVoid)