Skip to content

Commit b99a087

Browse files
committed
Fix table device judgement
1 parent 59bd3c7 commit b99a087

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public void setUp() throws Exception {
6666
BaseEnv baseEnv = EnvFactory.getEnv();
6767
baseEnv.getConfig().getDataNodeConfig().setEnableRestService(true);
6868
baseEnv.initClusterEnvironment();
69-
DataNodeWrapper portConflictDataNodeWrapper = EnvFactory.getEnv().getDataNodeWrapper(0);
70-
port = portConflictDataNodeWrapper.getRestServicePort();
69+
// DataNodeWrapper portConflictDataNodeWrapper = EnvFactory.getEnv().getDataNodeWrapper(0);
70+
// port = portConflictDataNodeWrapper.getRestServicePort();
7171
}
7272

7373
@After

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public class IoTDBRestServiceConfig {
2323

2424
/** If the enableRestService is true, we will start REST Service. */
25-
private boolean enableRestService = false;
25+
private boolean enableRestService = true;
2626

2727
/** Set the REST Service port. */
2828
private int restServicePort = 18080;

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,15 +1710,14 @@ public TsFileResource shallowCloneForNative() throws CloneNotSupportedException
17101710
}
17111711

17121712
public List<TsFileSet> getTsFileSets() {
1713+
if (tsFileManager == null) {
1714+
// loading TsFile, no TsFileSets
1715+
return Collections.emptyList();
1716+
}
17131717
return tsFileManager.getTsFileSet(
17141718
tsFileID.timePartitionId, tsFileID.fileVersion, Long.MAX_VALUE);
17151719
}
17161720

1717-
public List<TsFileSet> getTsFileSets(long maxEndVersionExcluded) {
1718-
return tsFileManager.getTsFileSet(
1719-
tsFileID.timePartitionId, tsFileID.fileVersion, maxEndVersionExcluded);
1720-
}
1721-
17221721
public EvolvedSchema getMergedEvolvedSchema() {
17231722
return getMergedEvolvedSchema(Long.MAX_VALUE);
17241723
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.iotdb.commons.service.metric.enums.Metric;
2929
import org.apache.iotdb.commons.service.metric.enums.Tag;
3030
import org.apache.iotdb.commons.utils.CommonDateTimeUtils;
31+
import org.apache.iotdb.commons.utils.PathUtils;
3132
import org.apache.iotdb.db.exception.query.QueryProcessException;
3233
import org.apache.iotdb.db.exception.sql.SemanticException;
3334
import org.apache.iotdb.db.protocol.thrift.OperationType;
@@ -464,7 +465,7 @@ public static String toString(TsBlock tsBlock) {
464465

465466
public static SeriesPartitionKey getSeriesPartitionKey(
466467
IDeviceID deviceID, String databaseName, boolean tableMustExist) {
467-
if (databaseName != null && deviceID.isTableModel()) {
468+
if (databaseName != null && PathUtils.isTableModelDatabase(databaseName)) {
468469
TsTable table =
469470
DataNodeTableCache.getInstance()
470471
.getTable(databaseName, deviceID.getTableName(), tableMustExist);

0 commit comments

Comments
 (0)