Skip to content

Commit

Permalink
modify int to long in IoTDB && fix bug in iotdb latest query points n…
Browse files Browse the repository at this point in the history
…umber statistic
  • Loading branch information
liyuheng55555 committed Sep 11, 2023
1 parent ff3bb1a commit f2e34a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,10 @@ protected Status executeQueryAndGetStatus(String sql, Operation operation) {
isOk.set(false);
}
long resultPointNum = line.get();
resultPointNum *= config.getQUERY_SENSOR_NUM();
resultPointNum *= config.getQUERY_DEVICE_NUM();
if (!Operation.LATEST_POINT_QUERY.equals(operation)) {
resultPointNum *= config.getQUERY_SENSOR_NUM();
resultPointNum *= config.getQUERY_DEVICE_NUM();
}
queryResultPointNum.set(resultPointNum);
});
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;

public class IoTDBSessionBase extends IoTDB {
Expand Down Expand Up @@ -174,9 +175,8 @@ protected Status executeQueryAndGetStatus(String sql, Operation operation) {
LOGGER.info("{} query SQL: {}", Thread.currentThread().getName(), executeSQL);
}
AtomicInteger line = new AtomicInteger();
AtomicInteger queryResultPointNum = new AtomicInteger();
AtomicLong queryResultPointNum = new AtomicLong();
AtomicBoolean isOk = new AtomicBoolean(true);

try {
List<List<Object>> records = new ArrayList<>();
future =
Expand Down Expand Up @@ -224,8 +224,12 @@ protected Status executeQueryAndGetStatus(String sql, Operation operation) {
LOGGER.error("exception occurred when execute query={}", executeSQL, e);
isOk.set(false);
}
queryResultPointNum.set(
line.get() * config.getQUERY_SENSOR_NUM() * config.getQUERY_DEVICE_NUM());
long resultPointNum = line.get();
if (!Operation.LATEST_POINT_QUERY.equals(operation)) {
resultPointNum *= config.getQUERY_SENSOR_NUM();
resultPointNum *= config.getQUERY_DEVICE_NUM();
}
queryResultPointNum.set(resultPointNum);
});
try {
future.get(config.getREAD_OPERATION_TIMEOUT_MS(), TimeUnit.MILLISECONDS);
Expand Down

0 comments on commit f2e34a3

Please sign in to comment.