Skip to content

Commit ecdf0d7

Browse files
authored
Fixed the device NPE for table view in view device & Added semantic check to prohibit the last data query for prefix paths with "*" & Refactored metric log of tag number
1 parent 3ff855e commit ecdf0d7

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/auth/BasicAuthorityCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void putRoleCache(String roleName, Role role) {
7676
* initialized.
7777
*/
7878
@Override
79-
public boolean invalidateCache(String userName, String roleName) {
79+
public boolean invalidateCache(final String userName, final String roleName) {
8080
if (userName != null) {
8181
if (userCache.getIfPresent(userName) != null) {
8282
Set<String> roleSet = userCache.getIfPresent(userName).getRoleSet();

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,13 @@ public TSExecuteStatementResp executeFastLastDataQueryForOnePrefixPath(
946946
// 1. Map<Device, String[] measurements> ISchemaFetcher.getAllSensors(prefix) ~= 50ms
947947

948948
final PartialPath prefixPath = new PartialPath(req.getPrefixes().toArray(new String[0]));
949+
if (prefixPath.hasWildcard()) {
950+
RpcUtils.getTSExecuteStatementResp(
951+
new TSStatus(TSStatusCode.SEMANTIC_ERROR.getStatusCode())
952+
.setMessage(
953+
"The \"executeFastLastDataQueryForOnePrefixPath\" dos not support wildcards."));
954+
}
955+
949956
final Map<TableId, Map<IDeviceID, Map<String, Pair<TSDataType, TimeValuePair>>>> resultMap =
950957
new HashMap<>();
951958
int sensorNum = 0;

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/schema/source/TableDeviceQuerySource.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ public boolean hasNext() {
129129
}
130130

131131
if (Objects.isNull(filter)) {
132-
if (innerHasNext()) {
133-
next = deviceReader.next();
132+
while (innerHasNext()) {
133+
final IDeviceSchemaInfo device = deviceReader.next();
134+
if (device.isAligned() == null) {
135+
continue;
136+
}
137+
next = device;
134138
return true;
135139
}
136140
return false;
@@ -142,7 +146,11 @@ public boolean hasNext() {
142146
}
143147

144148
while (innerHasNext() && !filter.hasNext()) {
145-
filter.addBatch(deviceReader.next());
149+
final IDeviceSchemaInfo device = deviceReader.next();
150+
if (device.isAligned() == null) {
151+
continue;
152+
}
153+
filter.addBatch(device);
146154
}
147155

148156
if (!filter.hasNext()) {

iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/utils/MetricInfo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public MetricInfo(MetricType type, String name, String... tags) {
5151
this.tags.put(tags[i], tags[i + 1]);
5252
}
5353
} else {
54-
logger.error("The size of metric tags should be even, but was {}.", String.join(",", tags));
54+
logger.error(
55+
"The size of metric tags should be even, but was odd, tags: {}.", String.join(",", tags));
5556
}
5657
this.metaInfo = new MetaInfo(type, this.tags.keySet());
5758
}

0 commit comments

Comments
 (0)