| Modifier and Type | Method and Description |
|---|---|
TableStoreCallback<RowChange,ConsumedCapacity> |
DefaultTableStoreWriter.getCallback() |
TableStoreCallback<RowChange,ConsumedCapacity> |
TableStoreWriter.getCallback()
Deprecated.
please change to
TableStoreWriter.getResultCallback() |
TableStoreCallback<RowChange,RowWriteResult> |
DefaultTableStoreWriter.getResultCallback() |
TableStoreCallback<RowChange,RowWriteResult> |
TableStoreWriter.getResultCallback()
获取设置的Callback。
|
| Modifier and Type | Method and Description |
|---|---|
void |
DefaultTableStoreWriter.addRowChange(RowChange rowChange) |
void |
TableStoreWriter.addRowChange(RowChange rowChange)
向本地缓冲区增加一行数据。
在写入缓冲区之前,会对该行数据做如下检查:
- 该行的主键的Schema是否与表定义的相同。
- 该行的主键列或属性列的值大小是否超过限制,值的限制配置在
WriterConfig.maxPKColumnSize和WriterConfig.maxAttrColumnSize。
- 该行的属性列的个数是否超过WriterConfig.maxColumnsCount。
- 该行的大小是否超过WriterConfig.maxBatchSize。
- 属性列中是否有列名与主键列相同。
若在写入缓冲区之前被判定为脏数据,该部分数据不会触发CallBack的调用。
以上检查会在SDK端带来额外的CPU消耗,但是这些检查是必要的,为了减少不必要的RPC开销,以及避免脏数据污染同一批次Batch写入的行。
注意:若缓冲区满,则该操作会被block。
若判断该行为脏数据,该接口会抛出ClientException。 |
Future<WriterResult> |
DefaultTableStoreWriter.addRowChangeWithFuture(RowChange rowChange) |
Future<WriterResult> |
TableStoreWriter.addRowChangeWithFuture(RowChange rowChange)
接口功能同
TableStoreWriter.addRowChange(com.alicloud.openservices.tablestore.model.RowChange)一致,
但会返回写入结果的Future,返回该行的写入成功、失败状态 |
boolean |
DefaultTableStoreWriter.tryAddRowChange(RowChange rowChange) |
boolean |
TableStoreWriter.tryAddRowChange(RowChange rowChange)
Same with
TableStoreWriter.addRowChange(RowChange), but it won't be blocked if the buffer is full. |
| Modifier and Type | Method and Description |
|---|---|
void |
DefaultTableStoreWriter.addRowChange(List<RowChange> rowChanges,
List<RowChange> dirtyRows) |
void |
DefaultTableStoreWriter.addRowChange(List<RowChange> rowChanges,
List<RowChange> dirtyRows) |
void |
TableStoreWriter.addRowChange(List<RowChange> rowChanges,
List<RowChange> dirtyRows)
向本地缓冲区批量写入行。
批量写入的每一行会做与
TableStoreWriter.addRowChange(RowChange)一样的检查,若批量写入的行中存在脏数据,则该函数会抛ClientException,
且所有的脏数据会写入dirtyRows。 |
void |
TableStoreWriter.addRowChange(List<RowChange> rowChanges,
List<RowChange> dirtyRows)
向本地缓冲区批量写入行。
批量写入的每一行会做与
TableStoreWriter.addRowChange(RowChange)一样的检查,若批量写入的行中存在脏数据,则该函数会抛ClientException,
且所有的脏数据会写入dirtyRows。 |
Future<WriterResult> |
DefaultTableStoreWriter.addRowChangeWithFuture(List<RowChange> rowChanges) |
Future<WriterResult> |
TableStoreWriter.addRowChangeWithFuture(List<RowChange> rowChanges)
向本地缓冲区批量写入行。
批量写入的每一行会做与
TableStoreWriter.addRowChange(RowChange)一样的检查;脏数据会直接更新到WriterResponse中统计 |
void |
DefaultTableStoreWriter.setCallback(TableStoreCallback<RowChange,ConsumedCapacity> callback) |
void |
TableStoreWriter.setCallback(TableStoreCallback<RowChange,ConsumedCapacity> callback)
Deprecated.
please change to
TableStoreWriter.setResultCallback(TableStoreCallback) |
void |
DefaultTableStoreWriter.setResultCallback(TableStoreCallback<RowChange,RowWriteResult> resultCallback) |
void |
TableStoreWriter.setResultCallback(TableStoreCallback<RowChange,RowWriteResult> callback)
设置Callback,数据写入成功或者失败均会通过Callback来反馈。
注意:callback会被写入TableStoreWriter的所有行共享,会被并发的调用。
这与
AsyncClientInterface中每个接口的Callback不同,其callback会与每个请求一一对应,且可以是独立的。
但是这里的Callback是与RowChange对应,且所有RowChange都共享该callback。 |
| Constructor and Description |
|---|
DefaultTableStoreWriter(AsyncClientInterface ots,
String tableName,
WriterConfig config,
TableStoreCallback<RowChange,ConsumedCapacity> callback,
Executor executor) |
DefaultTableStoreWriter(String endpoint,
ServiceCredentials credentials,
String instanceName,
String tableName,
WriterConfig config,
ClientConfiguration cc,
TableStoreCallback<RowChange,RowWriteResult> resultCallback) |
DefaultTableStoreWriter(String endpoint,
ServiceCredentials credentials,
String instanceName,
String tableName,
WriterConfig config,
TableStoreCallback<RowChange,RowWriteResult> resultCallback) |
| Modifier and Type | Method and Description |
|---|---|
static void |
ParamChecker.checkRowChange(TableMeta tableMeta,
RowChange rowChange,
WriterConfig config)
It does following checkings:
- primary key schema is matched with which defined in table meta.
|
| Modifier and Type | Class and Description |
|---|---|
class |
RowDeleteChange |
class |
RowPutChange |
class |
RowUpdateChange |
| Modifier and Type | Method and Description |
|---|---|
RowChange |
BulkImportRequest.getRowChange(int index) |
RowChange |
BatchWriteRowRequest.getRowChange(String tableName,
int index)
根据表名和索引返回一次写操作的参数。
BatchWriteRowResult中返回的多行结果允许部分成功部分失败,返回结果按表组织,且表内行的顺序与BatchWriteRowRequest中一一对应。
若用户需要对BatchWriteRowResult中部分失败的行进行重试,则可以根据失败的行所在的表的表名以及在其在返回结果列表内的索引,从BatchWriteRowRequest中反查即可得到请求参数。
|
| Modifier and Type | Method and Description |
|---|---|
List<RowChange> |
BulkImportRequest.getRowChange() |
Map<String,List<RowChange>> |
BatchWriteRowRequest.getRowChange()
获取所有表的操作参数。
|
| Modifier and Type | Method and Description |
|---|---|
void |
BulkImportRequest.addRowChange(RowChange rowChange) |
void |
BatchWriteRowRequest.addRowChange(RowChange rowChange)
添加某个表的写操作参数。
|
| Modifier and Type | Method and Description |
|---|---|
void |
BulkImportRequest.addRowChanges(List<RowChange> rowChanges) |
| Modifier and Type | Class and Description |
|---|---|
class |
RowPutChangeWithCallback |
| Constructor and Description |
|---|
TimestreamDBClient(AsyncClient asyncClient,
TimestreamDBConfiguration config,
WriterConfig writerConfig,
TableStoreCallback<RowChange,ConsumedCapacity> callback)
TimestreamDBClient的构造函数
|
| Modifier and Type | Field and Description |
|---|---|
RowChange |
RowChangeEvent.rowChange |
RowChange |
RowChangeWithGroup.rowChange |
| Modifier and Type | Method and Description |
|---|---|
RowChange |
WriterResult.RowChangeStatus.getRowChange() |
| Modifier and Type | Method and Description |
|---|---|
CallbackImpledFuture<RowChange,WriterResult> |
Group.getFuture() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
Bucket.addRowChange(RowChange rowChange,
Group group) |
void |
Group.failedOneRow(RowChange rowChange,
Exception exception) |
void |
RowChangeEvent.setValue(RowChange rowChange,
Group group) |
void |
Group.succeedOneRow(RowChange rowChange) |
| Modifier and Type | Method and Description |
|---|---|
void |
Bucket.setResultCallback(TableStoreCallback<RowChange,RowWriteResult> resultCallback) |
| Constructor and Description |
|---|
RowChangeStatus(boolean succeed,
RowChange rowChange,
Exception exception) |
RowChangeWithGroup(RowChange rowChange,
Group group) |
| Constructor and Description |
|---|
Bucket(BucketConfig bucketConfig,
AsyncClientInterface ots,
WriterConfig writerConfig,
TableStoreCallback<RowChange,RowWriteResult> resultCallback,
Executor executor,
WriterHandleStatistics writerStatistics,
Semaphore semaphore) |
| Modifier and Type | Method and Description |
|---|---|
int |
HashPartitionKeyDispatcher.getDispatchIndex(RowChange rowChange) |
int |
RoundRobinDispatcher.getDispatchIndex(RowChange rowChange) |
int |
Dispatcher.getDispatchIndex(RowChange rowChange)
获取写入分桶编号
|
int |
HashPrimaryKeyDispatcher.getDispatchIndex(RowChange rowChange) |
| Modifier and Type | Field and Description |
|---|---|
protected TableStoreCallback<RowChange,RowWriteResult> |
FlushCallbackFactory.callback |
protected TableStoreCallback<RowChange,RowWriteResult> |
BaseRequestManager.callback |
| Modifier and Type | Method and Description |
|---|---|
void |
RowEventHandler.setCallback(TableStoreCallback<RowChange,RowWriteResult> callback) |
Copyright © 2024. All Rights Reserved.