private static
void putRow(SyncClient client, String pkValue) {
//
构造主键
PrimaryKeyBuilder
primaryKeyBuilder = PrimaryKeyBuilder.createPrimaryKeyBuilder();
primaryKeyBuilder.addPrimaryKeyColumn(PRIMARY_KEY_NAME,
PrimaryKeyValue.fromString(pkValue));
PrimaryKey
primaryKey = primaryKeyBuilder.build();
RowPutChange
rowPutChange = new RowPutChange(TABLE_NAME, primaryKey);
//
加入一些属性列
rowPutChange.addColumn("truckId",
ColumnValue.fromLong(1));
rowPutChange.addColumn("longitude",
ColumnValue.fromString("30"));
rowPutChange.addColumn("latitude",
ColumnValue.fromString("35"));
rowPutChange.addColumn("updateTime",
ColumnValue.fromString(StringUtil.trim(new Date())));
client.putRow(new
PutRowRequest(rowPutChange));
}
异常:
操作失败,详情:Validate PK size
fail. Input: 1, Meta: 2.
Request ID:00055eb6-24b7-87ae-8cd8-970a00401a01