Skip to content

Commit 77f7a95

Browse files
authored
修复bug
1 parent 4854976 commit 77f7a95

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/java/examples/OTSMultiDataSample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static void getRange(OTSClient client, String tableName)
155155
PrimaryKeyValue.fromLong(4)); // 范围的边界需要提供完整的PK,若查询的范围不涉及到某一列值的范围,则需要将该列设置为无穷大或者无穷小
156156

157157
GetRangeRequest request = new GetRangeRequest();
158-
158+
int consumedReadCU = 0;
159159
List<Row> rows = new ArrayList<Row>();
160160
RowPrimaryKey next = inclusiveStartKey;
161161

@@ -166,6 +166,8 @@ private static void getRange(OTSClient client, String tableName)
166166
GetRangeResult result = client.getRange(request);
167167
rows.addAll(result.getRows());
168168
next = result.getNextStartPrimaryKey();
169+
consumedReadCU += result.getConsumedCapacity().getCapacityUnit()
170+
.getReadCapacityUnit();
169171
} while (next != null);
170172

171173
System.out.println("GetRange result:");
@@ -179,9 +181,6 @@ private static void getRange(OTSClient client, String tableName)
179181
System.out
180182
.println("age信息为:" + row.getColumns().get(COLUMN_AGE_NAME));
181183
}
182-
183-
int consumedReadCU = result.getConsumedCapacity().getCapacityUnit()
184-
.getReadCapacityUnit();
185184
System.out.println("本次读操作消耗的读CapacityUnit为:" + consumedReadCU);
186185
}
187186

0 commit comments

Comments
 (0)