V - Type of values to read from Couchbasepublic class CouchbaseTableReadFunction<V> extends BaseCouchbaseTableFunction<V> implements org.apache.samza.table.remote.TableReadFunction<java.lang.String,V>
JsonObject or
any other Object. If the value type is JsonObject, data in JSON format will be read from Couchbase directly as
JsonObject. Otherwise, a Serde needs to be provided to serialize and
deserialize the value object.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Class<? extends com.couchbase.client.java.document.Document<?>> |
documentType |
bucket, bucketName, clusterNodes, environmentConfigs, timeout, ttl, valueSerde| Constructor and Description |
|---|
CouchbaseTableReadFunction(java.lang.String bucketName,
java.lang.Class<V> valueClass,
java.lang.String... clusterNodes)
Construct an instance of
CouchbaseTableReadFunction. |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<V> |
getAsync(java.lang.String key) |
protected void |
handleGetAsyncBinaryDocument(com.couchbase.client.java.document.BinaryDocument binaryDocument,
java.util.concurrent.CompletableFuture<V> future,
java.lang.String key) |
void |
init(org.apache.samza.context.Context context,
org.apache.samza.table.AsyncReadWriteTable table) |
close, isRetriable, withBootstrapCarrierDirectPort, withBootstrapCarrierSslPort, withBootstrapHttpDirectPort, withBootstrapHttpSslPort, withSerde, withSslEnabledAndCertAuthEnabled, withSslKeystoreFileAndPassword, withSslTruststoreFileAndPassword, withTimeout, withTtl, withUsernameAndPasswordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected final java.lang.Class<? extends com.couchbase.client.java.document.Document<?>> documentType
public CouchbaseTableReadFunction(java.lang.String bucketName,
java.lang.Class<V> valueClass,
java.lang.String... clusterNodes)
CouchbaseTableReadFunction.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<V> getAsync(java.lang.String key)
getAsync in interface org.apache.samza.table.remote.TableReadFunction<java.lang.String,V>protected void handleGetAsyncBinaryDocument(com.couchbase.client.java.document.BinaryDocument binaryDocument,
java.util.concurrent.CompletableFuture<V> future,
java.lang.String key)