K
- the type of the keyV
- the type of the valuepublic class RemoteTableDescriptor<K,V> extends BaseTableDescriptor<K,V,RemoteTableDescriptor<K,V>>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASYNC_CALLBACK_POOL_SIZE |
static java.lang.String |
DEFAULT_RATE_LIMITER_CLASS_NAME |
static java.lang.String |
PROVIDER_FACTORY_CLASS_NAME |
static java.lang.String |
RATE_LIMITER |
static java.lang.String |
READ_CREDIT_FN |
static java.lang.String |
READ_FN |
static java.lang.String |
READ_RETRY_POLICY |
static java.lang.String |
RL_READ_TAG
Tag to be used for provision credits for rate limiting read operations from the remote table.
|
static java.lang.String |
RL_WRITE_TAG
Tag to be used for provision credits for rate limiting write operations into the remote table.
|
static java.lang.String |
WRITE_CREDIT_FN |
static java.lang.String |
WRITE_FN |
static java.lang.String |
WRITE_RETRY_POLICY |
config, tableId
Constructor and Description |
---|
RemoteTableDescriptor(java.lang.String tableId)
Constructs a table descriptor instance
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProviderFactoryClassName()
Return the fully qualified class name of the
TableProviderFactory |
java.util.Map<java.lang.String,java.lang.String> |
toConfig(Config jobConfig)
Generate configuration for this table descriptor, the generated configuration
should be the complete configuration for this table that can be directly
included in the job configuration.
|
protected void |
validate()
Validate that this table descriptor is constructed properly; this method is used internally.
|
RemoteTableDescriptor<K,V> |
withAsyncCallbackExecutorPoolSize(int poolSize)
Specify the size of the thread pool for the executor used to execute
callbacks of CompletableFutures of async Table operations.
|
RemoteTableDescriptor<K,V> |
withRateLimiter(RateLimiter rateLimiter,
TableRateLimiter.CreditFunction<K,V> readCreditFn,
TableRateLimiter.CreditFunction<K,V> writeCreditFn)
Specify a rate limiter along with credit functions to map a table record (as KV) to the amount
of credits to be charged from the rate limiter for table read and write operations.
|
RemoteTableDescriptor<K,V> |
withReadFunction(TableReadFunction<K,V> readFn)
Use specified TableReadFunction with remote table and a retry policy.
|
RemoteTableDescriptor<K,V> |
withReadRateLimit(int creditsPerSec)
Specify the rate limit for table read operations.
|
RemoteTableDescriptor<K,V> |
withReadRetryPolicy(TableRetryPolicy retryPolicy)
Use specified
TableRetryPolicy with the TableReadFunction . |
RemoteTableDescriptor<K,V> |
withWriteFunction(TableWriteFunction<K,V> writeFn)
Use specified TableWriteFunction with remote table and a retry policy.
|
RemoteTableDescriptor<K,V> |
withWriteRateLimit(int creditsPerSec)
Specify the rate limit for table write operations.
|
RemoteTableDescriptor<K,V> |
withWriteRetryPolicy(TableRetryPolicy retryPolicy)
Use specified
TableRetryPolicy with the TableWriteFunction . |
addTableConfig, getTableId, withConfig
public static final java.lang.String PROVIDER_FACTORY_CLASS_NAME
public static final java.lang.String DEFAULT_RATE_LIMITER_CLASS_NAME
public static final java.lang.String RL_READ_TAG
withRateLimiter(RateLimiter, TableRateLimiter.CreditFunction,
TableRateLimiter.CreditFunction)
public static final java.lang.String RL_WRITE_TAG
withRateLimiter(RateLimiter, TableRateLimiter.CreditFunction,
TableRateLimiter.CreditFunction)
and it needs the write functionality.public static final java.lang.String READ_FN
public static final java.lang.String WRITE_FN
public static final java.lang.String RATE_LIMITER
public static final java.lang.String READ_CREDIT_FN
public static final java.lang.String WRITE_CREDIT_FN
public static final java.lang.String ASYNC_CALLBACK_POOL_SIZE
public static final java.lang.String READ_RETRY_POLICY
public static final java.lang.String WRITE_RETRY_POLICY
public RemoteTableDescriptor(java.lang.String tableId)
tableId
- Id of the table, it must conform to pattern [\\d\\w-_]+public RemoteTableDescriptor<K,V> withReadFunction(TableReadFunction<K,V> readFn)
readFn
- read function instancepublic RemoteTableDescriptor<K,V> withWriteFunction(TableWriteFunction<K,V> writeFn)
writeFn
- write function instancepublic RemoteTableDescriptor<K,V> withReadRetryPolicy(TableRetryPolicy retryPolicy)
TableRetryPolicy
with the TableReadFunction
.retryPolicy
- retry policy for the write functionpublic RemoteTableDescriptor<K,V> withWriteRetryPolicy(TableRetryPolicy retryPolicy)
TableRetryPolicy
with the TableWriteFunction
.retryPolicy
- retry policy for the write functionpublic RemoteTableDescriptor<K,V> withRateLimiter(RateLimiter rateLimiter, TableRateLimiter.CreditFunction<K,V> readCreditFn, TableRateLimiter.CreditFunction<K,V> writeCreditFn)
withReadRateLimit(int)
and
withWriteRateLimit(int)
.rateLimiter
- rate limiter instance to be used for throttlingreadCreditFn
- credit function for rate limiting read operationswriteCreditFn
- credit function for rate limiting write operationspublic RemoteTableDescriptor<K,V> withReadRateLimit(int creditsPerSec)
withRateLimiter(RateLimiter,
TableRateLimiter.CreditFunction, TableRateLimiter.CreditFunction)
and vice versa.creditsPerSec
- rate limit for read operations; must be positivepublic RemoteTableDescriptor<K,V> withWriteRateLimit(int creditsPerSec)
withRateLimiter(RateLimiter,
TableRateLimiter.CreditFunction, TableRateLimiter.CreditFunction)
and vice versa.creditsPerSec
- rate limit for write operations; must be positivepublic RemoteTableDescriptor<K,V> withAsyncCallbackExecutorPoolSize(int poolSize)
poolSize
- max number of threads in the executor for async callbackspublic java.lang.String getProviderFactoryClassName()
BaseTableDescriptor
TableProviderFactory
getProviderFactoryClassName
in class BaseTableDescriptor<K,V,RemoteTableDescriptor<K,V>>
TableProviderFactory
public java.util.Map<java.lang.String,java.lang.String> toConfig(Config jobConfig)
TableDescriptor
jobConfig
.toConfig
in interface TableDescriptor<K,V,RemoteTableDescriptor<K,V>>
toConfig
in class BaseTableDescriptor<K,V,RemoteTableDescriptor<K,V>>
jobConfig
- job configurationprotected void validate()
BaseTableDescriptor
validate
in class BaseTableDescriptor<K,V,RemoteTableDescriptor<K,V>>