add data size field for partition cache (#6026)
Co-authored-by: wangxixu <wangxixu@xiaomi.com>
This commit is contained in:
@ -167,13 +167,17 @@ public class RowBatchBuilder {
|
||||
Long key = entry.getKey();
|
||||
PartitionRange.PartitionSingle partition = cachePartMap.get(key);
|
||||
partitionRowList = entry.getValue();
|
||||
int data_size = 0;
|
||||
for (byte[] buf : partitionRowList) {
|
||||
data_size += buf.length;
|
||||
}
|
||||
updateRequest = updateRequest.toBuilder()
|
||||
.addValues(InternalService.PCacheValue.newBuilder()
|
||||
.setParam(InternalService.PCacheParam.newBuilder()
|
||||
.setPartitionKey(key)
|
||||
.setLastVersion(partition.getPartition().getVisibleVersion())
|
||||
.setLastVersionTime(partition.getPartition().getVisibleVersionTime())
|
||||
.build()).addAllRows(
|
||||
.build()).setDataSize(dataSize).addAllRows(
|
||||
partitionRowList.stream().map(row -> ByteString.copyFrom(row))
|
||||
.collect(Collectors.toList()))).build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user