You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2025/07/30 04:29:46 UTC
(iotdb) branch master updated: Add strong password related configs (#15675)
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 1d0b33ebafd Add strong password related configs (#15675)
1d0b33ebafd is described below
commit 1d0b33ebafd3dd4cc5586465a4d5a2c726fa4356
Author: Jiang Tian <jt...@163.com>
AuthorDate: Wed Jul 30 12:29:40 2025 +0800
Add strong password related configs (#15675)
* Add enforce_strong_password
* Refacotr getPasswordChangeTime
* remove unused config in CN
* fix it
* multiple fixes
* fix test
* fix its
* record password history in IoTDB time precision
* fix tests
* fix IT & error message & minimum password length
* fix tests
* spotless
* fix tests
* fix it
* fix tests
* add debug output
* fix test
* remove config entrance
* fix it
* fix test
* fix IT
* change default password
* fix tests
* format
* fix test
* format
* Create password history for the first login of an old user.
Hint the expiration time after login.
* log welcome message in jdbc
* fix tests
* fix its
* fix its
* fix tests
* fix tests
* fix tests
* fix tests
* spotless
* fix tests
* spotless
* fix tests
* fix tests
* fix tests
* spotless
* fix writing redundant password history
* fix skipped password history creation
* add HashDistributionPolicy for tests
* fix test
* fix it
* fix test
* fix test
* fix tests
* add logs
* fix test
* Fix message when password is reused shortly
* Fix cannot create password history for root
* spotless
* update default password
* fix tests
---
CONTRIBUTING.md | 2 +-
README.md | 4 +-
README_ZH.md | 4 +-
.../src/AlignedTimeseriesSessionExample.cpp | 2 +-
example/client-cpp-example/src/SessionExample.cpp | 2 +-
.../src/TableModelSessionExample.cpp | 4 +-
.../java/org/apache/iotdb/JDBCCharsetExample.java | 4 +-
.../main/java/org/apache/iotdb/JDBCExample.java | 2 +-
.../org/apache/iotdb/PrepareStatementDemo.java | 2 +-
.../iotdb/SyntaxConventionRelatedExample.java | 2 +-
.../org/apache/iotdb/TableModelJDBCExample.java | 4 +-
.../java/org/apache/iotdb/mqtt/MQTTClient.java | 2 +-
example/odbc/README.md | 2 +-
.../iotdb/opcua/IoTDBKeyStoreLoaderClient.java | 2 +-
.../main/java/org/apache/iotdb/HttpExample.java | 2 +-
.../main/java/org/apache/iotdb/HttpsExample.java | 2 +-
.../java/org/apache/iotdb/TableHttpExample.java | 2 +-
.../java/org/apache/iotdb/TableHttpsExample.java | 2 +-
.../org/apache/iotdb/schema/PathCheckExample.java | 3 +-
.../iotdb/AlignedTimeseriesSessionExample.java | 2 +-
.../org/apache/iotdb/DataMigrationExample.java | 4 +-
.../iotdb/HybridTimeseriesSessionExample.java | 2 +-
.../org/apache/iotdb/SessionConcurrentExample.java | 4 +-
.../main/java/org/apache/iotdb/SessionExample.java | 6 +-
.../java/org/apache/iotdb/SessionPoolExample.java | 4 +-
.../apache/iotdb/SubscriptionSessionExample.java | 4 +-
.../iotdb/SyntaxConventionRelatedExample.java | 2 +-
.../org/apache/iotdb/TableModelSessionExample.java | 4 +-
.../apache/iotdb/TableModelSessionPoolExample.java | 4 +-
.../TableModelSubscriptionSessionExample.java | 6 +-
.../main/java/org/apache/iotdb/TabletExample.java | 2 +-
.../it/env/cluster/config/MppCommonConfig.java | 6 +
.../it/env/cluster/config/MppConfigNodeConfig.java | 6 +
.../it/env/cluster/config/MppDataNodeConfig.java | 6 +
.../env/cluster/config/MppSharedCommonConfig.java | 7 +
.../iotdb/it/env/cluster/env/AbstractEnv.java | 5 +-
.../it/env/cluster/node/AbstractNodeWrapper.java | 53 ++--
.../it/env/remote/config/RemoteCommonConfig.java | 6 +
.../env/remote/config/RemoteConfigNodeConfig.java | 5 +
.../it/env/remote/config/RemoteDataNodeConfig.java | 5 +
.../iotdb/it/env/remote/env/RemoteServerEnv.java | 4 +-
.../org/apache/iotdb/itbase/env/CommonConfig.java | 2 +
.../apache/iotdb/itbase/env/ConfigNodeConfig.java | 2 +
.../apache/iotdb/itbase/env/DataNodeConfig.java | 2 +
.../apache/iotdb/cli/it/StartClientScriptIT.java | 4 +-
.../confignode/it/IoTDBConfigNodeSnapshotIT.java | 2 +-
.../it/cluster/IoTDBClusterNodeGetterIT.java | 4 +-
.../it/database/IoTDBDatabaseSetAndDeleteIT.java | 6 +-
...oTDBMultiDBRegionGroupLeaderDistributionIT.java | 4 +
.../load/IoTDBRegionGroupLeaderDistributionIT.java | 16 ++
.../IoTDBAutoRegionGroupExtension2IT.java | 3 +
.../partition/IoTDBAutoRegionGroupExtensionIT.java | 12 +-
.../it/partition/IoTDBPartitionCreationIT.java | 7 +
.../it/partition/IoTDBPartitionDurableIT.java | 13 +
.../it/partition/IoTDBPartitionGetterIT.java | 5 +-
.../confignode/it/procedure/IoTDBProcedureIT.java | 2 +-
...IoTDBRegionOperationReliabilityITFramework.java | 18 +-
.../IoTDBRegionGroupExpandAndShrinkForIoTV1IT.java | 3 +-
.../commit/IoTDBRegionReconstructForIoTV1IT.java | 104 +++++--
.../apache/iotdb/db/it/GrafanaApiServiceIT.java | 4 +-
.../org/apache/iotdb/db/it/IoTDBEncodingIT.java | 4 +-
.../org/apache/iotdb/db/it/IoTDBExampleIT.java | 2 +-
.../apache/iotdb/db/it/IoTDBFloatPrecisionIT.java | 4 +-
.../org/apache/iotdb/db/it/IoTDBFlushQueryIT.java | 2 +-
.../apache/iotdb/db/it/IoTDBInsertWithQueryIT.java | 4 +-
.../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java | 37 +--
.../org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java | 4 +-
.../org/apache/iotdb/db/it/IoTDBRestServiceIT.java | 85 +++---
.../org/apache/iotdb/db/it/IoTDBRestartIT.java | 6 +-
.../apache/iotdb/db/it/IoTDBRestartRatisIT.java | 6 +-
.../it/IoTDBSameMeasurementsDifferentTypesIT.java | 2 +-
.../iotdb/db/it/IoTDBSetConfigurationIT.java | 4 +-
.../org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java | 31 +-
.../db/it/IoTDBSyntaxConventionIdentifierIT.java | 17 +-
.../it/IoTDBSyntaxConventionStringLiteralIT.java | 19 +-
.../org/apache/iotdb/db/it/IoTDBTimeZoneIT.java | 2 +-
.../it/aggregation/IoTDBAggregationByLevelIT.java | 2 +-
.../aggregation/IoTDBAggregationSmallDataIT.java | 2 +-
.../db/it/aggregation/IoTDBTimeDurationIT.java | 30 +-
.../db/it/aligned/IoTDBInsertAlignedValuesIT.java | 2 +-
.../org/apache/iotdb/db/it/auth/IoTDBAuthIT.java | 311 ++++++++++++++++-----
.../iotdb/db/it/auth/IoTDBClusterAuthorityIT.java | 5 +-
.../it/auth/IoTDBClusterAuthorityRelationalIT.java | 5 +-
.../iotdb/db/it/auth/IoTDBRelationalAuthIT.java | 33 ++-
.../iotdb/db/it/auth/IoTDBSeriesPermissionIT.java | 86 +++---
.../iotdb/db/it/auth/IoTDBSystemPermissionIT.java | 78 +++---
.../db/it/auth/IoTDBTemplatePermissionIT.java | 39 +--
.../db/it/query/IoTDBEncryptionValueQueryIT.java | 16 +-
.../apache/iotdb/db/it/query/IoTDBQueryDemoIT.java | 16 +-
.../it/schema/IoTDBCreateAlignedTimeseriesIT.java | 2 +-
.../iotdb/db/it/schema/IoTDBCreateDatabaseIT.java | 2 +-
.../db/it/schema/IoTDBDeactivateTemplateIT.java | 6 +-
.../it/schema/IoTDBDeleteAlignedTimeseriesIT.java | 6 +-
.../iotdb/db/it/schema/IoTDBDeleteDatabaseIT.java | 10 +-
.../db/it/schema/IoTDBDeleteTimeSeriesIT.java | 8 +-
.../it/schema/IoTDBDisableAutoCreateSchemaIT.java | 4 +-
.../iotdb/db/it/schema/IoTDBExtendTemplateIT.java | 6 +-
.../iotdb/db/it/schema/IoTDBMetadataFetchIT.java | 22 +-
.../iotdb/db/it/schema/IoTDBSchemaTemplateIT.java | 6 +-
.../db/it/schema/IoTDBSortedShowTimeseriesIT.java | 117 ++++----
.../apache/iotdb/db/it/schema/IoTDBTagAlterIT.java | 20 +-
.../org/apache/iotdb/db/it/schema/IoTDBTagIT.java | 61 ++--
.../apache/iotdb/db/it/schema/IoTDBTagLimitIT.java | 2 +-
.../schema/regionscan/IoTDBActiveRegionScanIT.java | 12 +-
.../IoTDBActiveRegionScanWithModsIT.java | 8 +-
.../regionscan/IoTDBActiveRegionScanWithTTLIT.java | 2 +-
.../regionscan/IoTDBActiveSchemaQueryIT.java | 13 +-
.../iotdb/db/it/selectinto/IoTDBSelectInto2IT.java | 1 +
.../iotdb/db/it/selectinto/IoTDBSelectInto3IT.java | 1 +
.../iotdb/db/it/selectinto/IoTDBSelectIntoIT.java | 9 +-
.../org/apache/iotdb/db/it/utils/TestUtils.java | 113 ++++++--
.../pipe/it/dual/tablemodel/TableModelUtils.java | 11 +-
.../manual/AbstractPipeTableModelDualManualIT.java | 4 +
.../tablemodel/manual/basic/IoTDBPipeAlterIT.java | 10 +
.../manual/basic/IoTDBPipeDataSinkIT.java | 45 +--
.../manual/basic/IoTDBPipeLifeCycleIT.java | 29 +-
.../manual/basic/IoTDBPipePermissionIT.java | 26 +-
.../tablemodel/manual/basic/IoTDBPipeSourceIT.java | 76 +++--
.../manual/basic/IoTDBPipeSwitchStatusIT.java | 18 ++
.../tablemodel/manual/basic/IoTDBPipeSyntaxIT.java | 10 +
.../manual/basic/IoTDBPipeWithLoadIT.java | 10 +-
.../manual/enhanced/IoTDBPipeClusterIT.java | 10 +-
.../manual/enhanced/IoTDBPipeDoubleLivingIT.java | 91 +++---
.../manual/enhanced/IoTDBPipeIdempotentIT.java | 22 +-
.../manual/enhanced/IoTDBPipeMetaIT.java | 36 ++-
.../enhanced/IoTDBPipeSinkCompressionIT.java | 17 +-
.../manual/enhanced/IoTDBPipeSinkParallelIT.java | 5 +-
.../IoTDBPipeTypeConversionISessionIT.java | 5 +-
.../manual/enhanced/IoTDBPipeTypeConversionIT.java | 20 +-
.../auto/AbstractPipeDualTreeModelAutoIT.java | 10 +-
.../treemodel/auto/basic/IoTDBPipeAlterIT.java | 27 +-
.../treemodel/auto/basic/IoTDBPipeDataSinkIT.java | 50 ++--
.../treemodel/auto/basic/IoTDBPipeLifeCycleIT.java | 292 ++++++++++++-------
.../treemodel/auto/basic/IoTDBPipeProcessorIT.java | 8 +-
.../treemodel/auto/basic/IoTDBPipeProtocolIT.java | 44 +--
.../auto/basic/IoTDBPipeSinkParallelIT.java | 5 +-
.../treemodel/auto/basic/IoTDBPipeSourceIT.java | 89 ++++--
.../auto/basic/IoTDBPipeSwitchStatusIT.java | 22 +-
.../treemodel/auto/basic/IoTDBPipeSyntaxIT.java | 10 +
.../auto/basic/IoTDBTreePatternFormatIT.java | 18 +-
.../auto/enhanced/IoTDBPipeAutoConflictIT.java | 154 ++++++----
.../auto/enhanced/IoTDBPipeAutoDropIT.java | 11 +-
.../auto/enhanced/IoTDBPipeClusterIT.java | 131 ++++++---
.../enhanced/IoTDBPipeConditionalOperationsIT.java | 5 +
.../auto/enhanced/IoTDBPipeIdempotentIT.java | 72 ++---
.../auto/enhanced/IoTDBPipeNullValueIT.java | 14 +-
.../auto/enhanced/IoTDBPipeSinkCompressionIT.java | 21 +-
.../auto/enhanced/IoTDBPipeWithLoadIT.java | 23 +-
.../treemodel/auto/enhanced/PipeNowFunctionIT.java | 4 +
.../manual/AbstractPipeDualTreeModelManualIT.java | 4 +-
.../treemodel/manual/IoTDBPipeInclusionIT.java | 27 +-
.../manual/IoTDBPipeManualConflictIT.java | 34 ++-
.../manual/IoTDBPipeMetaHistoricalIT.java | 33 ++-
.../manual/IoTDBPipeMetaLeaderChangeIT.java | 14 +-
.../treemodel/manual/IoTDBPipeMetaRestartIT.java | 34 ++-
.../manual/IoTDBPipeMultiSchemaRegionIT.java | 16 +-
.../treemodel/manual/IoTDBPipePermissionIT.java | 27 +-
.../treemodel/manual/IoTDBPipeReqAutoSliceIT.java | 4 +-
.../manual/IoTDBPipeTypeConversionISessionIT.java | 5 +-
.../manual/IoTDBPipeTypeConversionIT.java | 19 +-
.../iotdb/pipe/it/single/IoTDBPipeAggregateIT.java | 9 +-
.../iotdb/pipe/it/single/IoTDBPipeOPCUAIT.java | 13 +-
.../pipe/it/single/IoTDBPipePermissionIT.java | 20 +-
.../it/db/it/IoTDBAuthenticationTableIT.java | 41 +--
.../relational/it/db/it/IoTDBRestartTableIT.java | 4 +-
.../it/insertquery/IoTDBInsertQueryIT.java | 11 +-
.../relational/it/mqtt/IoTDBMQTTServiceIT.java | 2 +-
.../scalar/IoTDBBitwiseFunctionTableIT.java | 73 ++---
.../it/query/recent/IoTDBMaintainAuthIT.java | 3 +-
.../it/query/recent/IoTDBNullIdQueryIT.java | 5 +-
.../it/query/recent/IoTDBQueryAuthIT.java | 3 +-
.../view/recent/IoTDBNullIdQueryTableViewIT.java | 5 +-
.../relational/it/rest/it/IoTDBRestServiceIT.java | 1 +
.../iotdb/relational/it/rest/it/RestUtils.java | 2 +-
.../relational/it/schema/IoTDBDatabaseIT.java | 23 +-
.../iotdb/relational/it/schema/IoTDBTableIT.java | 23 +-
.../it/session/IoTDBSessionRelationalIT.java | 3 +
.../iotdb/session/it/IoTDBSessionComplexIT.java | 15 +-
.../session/it/IoTDBSessionSchemaTemplateIT.java | 4 +-
.../iotdb/session/it/IoTDBSessionSimpleIT.java | 4 +-
.../session/it/IoTDBSessionSyntaxConventionIT.java | 2 +-
.../it/dual/AbstractSubscriptionDualIT.java | 1 +
.../IoTDBSubscriptionConsumerGroupIT.java | 7 +-
.../IoTDBSubscriptionTimePrecisionIT.java | 2 +-
.../dual/treemodel/IoTDBSubscriptionTopicIT.java | 8 +-
.../tablemodel/IoTDBSubscriptionPermissionIT.java | 31 +-
.../it/triple/AbstractSubscriptionTripleIT.java | 5 +
.../AbstractSubscriptionTreeRegressionIT.java | 21 +-
...DBTestAutoCommitFalseDataSetPullConsumerIT.java | 39 ++-
.../apache/iotdb/tools/it/ExportDataTestIT.java | 12 +-
.../apache/iotdb/tools/it/ExportSchemaTestIT.java | 4 +-
.../apache/iotdb/tools/it/ExportTsFileTestIT.java | 8 +-
.../apache/iotdb/tools/it/ImportDataTestIT.java | 4 +-
.../apache/iotdb/tools/it/ImportSchemaTestIT.java | 4 +-
.../src/main/java/org/apache/iotdb/cli/Cli.java | 2 +-
.../org/apache/iotdb/tool/common/Constants.java | 2 +-
.../iotdb/tool/tsfile/AbstractTsFileTool.java | 2 +-
.../tool/tsfile/subscription/CommonParam.java | 2 +-
.../java/org/apache/iotdb/cli/AbstractCliTest.java | 10 +-
iotdb-client/client-cpp/README.md | 2 +-
.../client-cpp/src/main/AbstractSessionBuilder.h | 2 +-
iotdb-client/client-cpp/src/main/Session.h | 2 +-
iotdb-client/client-cpp/src/test/main.cpp | 2 +-
.../client-cpp/src/test/main_Relational.cpp | 2 +-
iotdb-client/client-py/README.md | 10 +-
iotdb-client/client-py/iotdb/Session.py | 2 +-
iotdb-client/client-py/iotdb/table_session.py | 2 +-
.../session_aligned_timeseries_example.py | 2 +-
iotdb-client/client-py/session_example.py | 4 +-
iotdb-client/client-py/session_pool_example.py | 2 +-
iotdb-client/client-py/session_ssl_example.py | 2 +-
.../client-py/table_model_session_example.py | 6 +-
.../client-py/table_model_session_pool_example.py | 2 +-
.../client-py/tests/integration/iotdb_container.py | 7 +-
.../tests/integration/sqlalchemy/test_dialect.py | 19 +-
.../integration/tablet_performance_comparison.py | 2 +-
.../tests/integration/test_new_data_types.py | 2 +-
.../client-py/tests/integration/test_session.py | 2 +-
.../tests/integration/test_session_pool.py | 4 +-
.../tests/integration/test_treemodel_insert.py | 3 +-
.../org/apache/iotdb/isession/SessionConfig.java | 2 +-
iotdb-client/jdbc/README.md | 2 +-
.../org/apache/iotdb/jdbc/IoTDBConnection.java | 2 +-
.../java/org/apache/iotdb/rpc/TSStatusCode.java | 1 +
.../apache/iotdb/session/TableSessionBuilder.java | 2 +-
.../session/pool/TableSessionPoolBuilder.java | 2 +-
.../apache/iotdb/session/util/SessionUtils.java | 9 +-
.../iotdb/session/SessionConnectionTest.java | 6 +-
.../java/org/apache/iotdb/session/SessionTest.java | 2 +-
.../session/pool/SessionPoolExceptionTest.java | 5 +-
.../apache/iotdb/session/pool/SessionPoolTest.java | 2 +-
.../client/async/CnToDnAsyncRequestType.java | 3 +
.../CnToDnInternalServiceAsyncRequestManager.java | 5 +
.../confignode/conf/ConfigNodeDescriptor.java | 6 +-
.../confignode/conf/ConfigNodeStartupCheck.java | 5 +-
.../iotdb/confignode/manager/ConfigManager.java | 19 +-
.../confignode/manager/PermissionManager.java | 4 +
.../manager/load/balancer/RouteBalancer.java | 4 +
.../router/leader/AbstractLeaderBalancer.java | 1 +
.../balancer/router/leader/HashLeaderBalancer.java | 61 ++++
.../iotdb/confignode/persistence/AuthorInfo.java | 18 +-
.../thrift/ConfigNodeRPCServiceProcessor.java | 5 +
.../request/ConfigPhysicalPlanSerDeTest.java | 2 +-
.../confignode/persistence/AuthorInfoTest.java | 16 +-
.../persistence/CNPhysicalPlanGeneratorTest.java | 6 +-
.../ConfigRegionListeningQueueTest.java | 2 +-
.../impl/sync/AuthOperationProcedureTest.java | 2 +-
.../iotdb/db/auth/ClusterAuthorityFetcher.java | 37 +++
.../apache/iotdb/db/auth/IAuthorityFetcher.java | 3 +
.../iotdb/db/protocol/client/ConfigNodeClient.java | 6 +
.../iotdb/db/protocol/session/SessionManager.java | 132 ++++++++-
.../impl/DataNodeInternalRPCServiceImpl.java | 22 ++
.../queryengine/plan/analyze/AnalyzeVisitor.java | 3 +-
.../plan/analyze/ClusterPartitionFetcher.java | 9 +-
.../plan/analyze/IPartitionFetcher.java | 5 +
.../analyze/cache/partition/PartitionCache.java | 22 +-
.../plan/analyze/schema/ClusterSchemaFetcher.java | 8 +-
.../plan/analyze/schema/NormalSchemaFetcher.java | 29 +-
.../execution/config/TableConfigTaskVisitor.java | 16 ++
.../execution/config/TreeConfigTaskVisitor.java | 16 ++
.../sql/ast/RelationalAuthorStatement.java | 47 ++++
.../plan/statement/sys/AuthorStatement.java | 37 +++
.../db/storageengine/dataregion/DataRegion.java | 9 +
.../dataregion/memtable/TsFileProcessor.java | 5 +
.../apache/iotdb/db/utils/DataNodeAuthUtils.java | 184 ++++++++++++
.../iotdb/db/auth/AuthorizerManagerTest.java | 2 +-
.../auth/authorizer/LocalFileAuthorizerTest.java | 18 +-
.../org/apache/iotdb/db/auth/entity/UserTest.java | 2 +-
.../db/auth/user/LocalFileUserAccessorTest.java | 4 +-
.../db/auth/user/LocalFileUserManagerTest.java | 2 +-
.../db/protocol/rest/GrafanaApiServiceTest.java | 2 +-
.../db/protocol/rest/IoTDBRestServiceTest.java | 2 +-
.../security/encrypt/MessageDigestEncryptTest.java | 4 +-
.../apache/iotdb/metrics/config/MetricConfig.java | 2 +-
.../iotdb/metrics/config/MetricConfigTest.java | 8 +-
.../resources/conf/iotdb-system.properties | 1 +
.../iotdb/commons/auth/user/BasicUserManager.java | 17 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 31 +-
.../pipe/config/constant/PipeSinkConstant.java | 2 +-
.../pipe/config/constant/SystemConstant.java | 3 +
.../org/apache/iotdb/commons/utils/AuthUtils.java | 87 +++++-
.../iotdb/commons/utils/CommonDateTimeUtils.java | 12 +
.../apache/iotdb/commons/utils/AuthUtilsTest.java | 18 +-
.../src/main/thrift/confignode.thrift | 2 +
.../src/main/thrift/datanode.thrift | 4 +
scripts/sbin/start-cli.sh | 4 +-
scripts/sbin/windows/start-cli-table.bat | 4 +-
scripts/sbin/windows/start-cli.bat | 4 +-
scripts/tools/ops/collect-info.sh | 2 +-
scripts/tools/windows/ops/collect-info.bat | 2 +-
290 files changed, 3404 insertions(+), 1496 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e29a9cd2540..e5c7d3a994e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -133,7 +133,7 @@ mvn clean package -DskipTests
Mark `iotdb-core/antlr/target/generated-sources/antlr4` and `iotdb-protocol/thrift-datanode/target/generated-sources/thrift` as `Source Root`.
* Server main function:`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode`, can be started in debug mode.
-* Cli:`iotdb-client/cli/src/main/java/org/apache/iotdb/cli/`,Use Cli for linux and WinCli for windows, you can start directly with the parameter "`-h 127.0.0.1 -p 6667 -u root -pw root`"
+* Cli:`iotdb-client/cli/src/main/java/org/apache/iotdb/cli/`,Use Cli for linux and WinCli for windows, you can start directly with the parameter "`-h 127.0.0.1 -p 6667 -u root -pw IoTDB@2011`"
* Server rpc implementation (mainly used for cli and server communication, generally start interruption point here):`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/TSServiceImpl`
* all jdbc statements:`executeStatement(TSExecuteStatementReq req)`
* jdbc query:`executeQueryStatement(TSExecuteStatementReq req)`
diff --git a/README.md b/README.md
index fa0f249a95e..cdd4c898c3f 100644
--- a/README.md
+++ b/README.md
@@ -334,9 +334,9 @@ Users can start 1C1D IoTDB by the start-standalone script under the sbin folder.
IoTDB offers different ways to interact with server, here we introduce the basic steps of using Cli tool to insert and query data.
-After installing IoTDB, there is a default user 'root', its default password is also 'root'. Users can use this
+After installing IoTDB, there is a default user 'root', its default password is 'IoTDB@2011'. Users can use this
default user to login Cli to use IoTDB. The start-up script of Cli is the start-cli script in the folder sbin. When executing the script, user should assign
-IP, PORT, USER_NAME and PASSWORD. The default parameters are "-h 127.0.0.1 -p 6667 -u root -pw -root".
+IP, PORT, USER_NAME and PASSWORD. The default parameters are "-h 127.0.0.1 -p 6667 -u root -pw IoTDB@2011".
Here is the command for starting the Cli:
diff --git a/README_ZH.md b/README_ZH.md
index 89d180f5259..e30e0540729 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -209,9 +209,9 @@ git checkout rel/x.x
IoTDB提供了与服务器交互的不同方式,这里我们将介绍使用 Cli 工具插入和查询数据的基本步骤。
-安装 IoTDB 后,有一个默认的用户`root`,它的默认密码也是`root`。用户可以使用这个
+安装 IoTDB 后,有一个默认的用户`root`,它的默认密码是`IoTDB@2011`。用户可以使用这个
默认用户登录 Cli 并使用 IoTDB。Cli 的启动脚本是 sbin 文件夹中的 start-cli 脚本。
-在执行脚本时,用户应该指定 IP,端口,USER_NAME 和 密码。默认参数为`-h 127.0.0.1 -p 6667 -u root -pw root`。
+在执行脚本时,用户应该指定 IP,端口,USER_NAME 和 密码。默认参数为`-h 127.0.0.1 -p 6667 -u root -pw IoTDB@2011`。
下面是启动 Cli 的命令:
diff --git a/example/client-cpp-example/src/AlignedTimeseriesSessionExample.cpp b/example/client-cpp-example/src/AlignedTimeseriesSessionExample.cpp
index 2cc04ab3b39..6e26b66d7d0 100644
--- a/example/client-cpp-example/src/AlignedTimeseriesSessionExample.cpp
+++ b/example/client-cpp-example/src/AlignedTimeseriesSessionExample.cpp
@@ -339,7 +339,7 @@ void deleteStorageGroups() {
int main() {
LOG_LEVEL = LEVEL_DEBUG;
- session = new Session("127.0.0.1", 6667, "root", "root");
+ session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011");
cout << "session open\n" << endl;
session->open(false);
diff --git a/example/client-cpp-example/src/SessionExample.cpp b/example/client-cpp-example/src/SessionExample.cpp
index 2803d18976c..8d776dfe628 100644
--- a/example/client-cpp-example/src/SessionExample.cpp
+++ b/example/client-cpp-example/src/SessionExample.cpp
@@ -376,7 +376,7 @@ void queryLast() {
int main() {
LOG_LEVEL = LEVEL_DEBUG;
- session = new Session("127.0.0.1", 6667, "root", "root");
+ session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011");
session->open(false);
cout << "setStorageGroup: root.sg1\n" << endl;
diff --git a/example/client-cpp-example/src/TableModelSessionExample.cpp b/example/client-cpp-example/src/TableModelSessionExample.cpp
index 4e4f9274342..60c7ea473d7 100644
--- a/example/client-cpp-example/src/TableModelSessionExample.cpp
+++ b/example/client-cpp-example/src/TableModelSessionExample.cpp
@@ -99,7 +99,7 @@ int main() {
->host("127.0.0.1")
->rpcPort(6667)
->username("root")
- ->password("root")
+ ->password("IoTDB@2011")
->build();
@@ -165,7 +165,7 @@ int main() {
->host("127.0.0.1")
->rpcPort(6667)
->username("root")
- ->password("root")
+ ->password("IoTDB@2011")
->database("db1")
->build();
diff --git a/example/jdbc/src/main/java/org/apache/iotdb/JDBCCharsetExample.java b/example/jdbc/src/main/java/org/apache/iotdb/JDBCCharsetExample.java
index 3ecb9c05646..a53c7748c6c 100644
--- a/example/jdbc/src/main/java/org/apache/iotdb/JDBCCharsetExample.java
+++ b/example/jdbc/src/main/java/org/apache/iotdb/JDBCCharsetExample.java
@@ -41,7 +41,7 @@ public class JDBCCharsetExample {
try (final Connection connection =
DriverManager.getConnection(
- "jdbc:iotdb://127.0.0.1:6667?charset=GB18030", "root", "root");
+ "jdbc:iotdb://127.0.0.1:6667?charset=GB18030", "root", "IoTDB@2011");
final IoTDBStatement statement = (IoTDBStatement) connection.createStatement()) {
final String insertSQLWithGB18030 =
@@ -63,7 +63,7 @@ public class JDBCCharsetExample {
System.out.println("[Charset: " + charset + "]");
try (final Connection connection =
DriverManager.getConnection(
- "jdbc:iotdb://127.0.0.1:6667?charset=" + charset, "root", "root");
+ "jdbc:iotdb://127.0.0.1:6667?charset=" + charset, "root", "IoTDB@2011");
final IoTDBStatement statement = (IoTDBStatement) connection.createStatement()) {
outputResult(statement.executeQuery("select ** from root"), Charset.forName(charset));
} catch (IoTDBSQLException e) {
diff --git a/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java b/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
index efd94490797..317d80751ca 100644
--- a/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
+++ b/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
@@ -39,7 +39,7 @@ public class JDBCExample {
Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
try (Connection connection =
DriverManager.getConnection(
- "jdbc:iotdb://127.0.0.1:6667?version=V_1_0", "root", "root");
+ "jdbc:iotdb://127.0.0.1:6667?version=V_1_0", "root", "IoTDB@2011");
Statement statement = connection.createStatement()) {
// set JDBC fetchSize
diff --git a/example/jdbc/src/main/java/org/apache/iotdb/PrepareStatementDemo.java b/example/jdbc/src/main/java/org/apache/iotdb/PrepareStatementDemo.java
index a9a580a8e82..cdc207d20cc 100644
--- a/example/jdbc/src/main/java/org/apache/iotdb/PrepareStatementDemo.java
+++ b/example/jdbc/src/main/java/org/apache/iotdb/PrepareStatementDemo.java
@@ -37,7 +37,7 @@ public class PrepareStatementDemo {
public static void main(String[] args) throws ClassNotFoundException, SQLException {
Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
try (Connection connection =
- DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+ DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "IoTDB@2011");
PreparedStatement preparedStatement =
connection.prepareStatement(
"insert into root.ln.wf01.wt01(timestamp,status,temperature) values(?,?,?)")) {
diff --git a/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java b/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
index 98d75a39884..4bdd34a55cf 100644
--- a/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
+++ b/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
@@ -69,7 +69,7 @@ public class SyntaxConventionRelatedExample {
Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
try (Connection connection =
DriverManager.getConnection(
- "jdbc:iotdb://127.0.0.1:6667?version=V_1_0", "root", "root");
+ "jdbc:iotdb://127.0.0.1:6667?version=V_1_0", "root", "IoTDB@2011");
Statement statement = connection.createStatement()) {
// set JDBC fetchSize
diff --git a/example/jdbc/src/main/java/org/apache/iotdb/TableModelJDBCExample.java b/example/jdbc/src/main/java/org/apache/iotdb/TableModelJDBCExample.java
index 49619b5639c..b5bf7e79c6a 100644
--- a/example/jdbc/src/main/java/org/apache/iotdb/TableModelJDBCExample.java
+++ b/example/jdbc/src/main/java/org/apache/iotdb/TableModelJDBCExample.java
@@ -41,7 +41,7 @@ public class TableModelJDBCExample {
// don't specify database in url
try (Connection connection =
DriverManager.getConnection(
- "jdbc:iotdb://127.0.0.1:6667?sql_dialect=table", "root", "root");
+ "jdbc:iotdb://127.0.0.1:6667?sql_dialect=table", "root", "IoTDB@2011");
Statement statement = connection.createStatement()) {
statement.execute("CREATE DATABASE test1");
@@ -82,7 +82,7 @@ public class TableModelJDBCExample {
// specify database in url
try (Connection connection =
DriverManager.getConnection(
- "jdbc:iotdb://127.0.0.1:6667/test1?sql_dialect=table", "root", "root");
+ "jdbc:iotdb://127.0.0.1:6667/test1?sql_dialect=table", "root", "IoTDB@2011");
Statement statement = connection.createStatement()) {
// show tables from current database test1
try (ResultSet resultSet = statement.executeQuery("SHOW TABLES")) {
diff --git a/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java b/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
index 84815a85a48..d98fbd3ec1b 100644
--- a/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
+++ b/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
@@ -32,7 +32,7 @@ public class MQTTClient {
MQTT mqtt = new MQTT();
mqtt.setHost("127.0.0.1", 1883);
mqtt.setUserName("root");
- mqtt.setPassword("root");
+ mqtt.setPassword("IoTDB@2011");
mqtt.setConnectAttemptsMax(3);
mqtt.setReconnectDelay(10);
diff --git a/example/odbc/README.md b/example/odbc/README.md
index 5f62ce6953c..0b2630c1266 100644
--- a/example/odbc/README.md
+++ b/example/odbc/README.md
@@ -63,7 +63,7 @@ Then, you can see the output `iotdb-jdbc-1.3.2-SNAPSHOT-jar-with-dependencies.ja
| Driver Class | org.apache.iotdb.jdbc.IoTDBDriver | org.apache.iotdb.jdbc.IoTDBDriver |
| JDBC driver file(s) | The path of IoTDB JDBC jar-with-dependencies | C:\Users\13361\Documents\GitHub\iotdb\iotdb-client\jdbc\target\iotdb-jdbc-1.3.2-SNAPSHOT-jar-with-dependencies.jar |
| User name | IoTDB's user name | root |
- | User password | IoTDB's password | root |
+ | User password | IoTDB's password | IoTDB@2011 |

diff --git a/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/IoTDBKeyStoreLoaderClient.java b/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/IoTDBKeyStoreLoaderClient.java
index e3245994493..7a816930dc3 100644
--- a/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/IoTDBKeyStoreLoaderClient.java
+++ b/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/IoTDBKeyStoreLoaderClient.java
@@ -42,7 +42,7 @@ class IoTDBKeyStoreLoaderClient {
Pattern.compile("^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
private static final String CLIENT_ALIAS = "client-ai";
- private static final char[] PASSWORD = "root".toCharArray();
+ private static final char[] PASSWORD = "IoTDB@2011".toCharArray();
private X509Certificate[] clientCertificateChain;
private X509Certificate clientCertificate;
diff --git a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
index bccc2fd2549..e3d26d6aac3 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
@@ -83,7 +83,7 @@ public class HttpExample {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
diff --git a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
index a3dbbceafc7..76db1639c6b 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
@@ -83,7 +83,7 @@ public class HttpsExample {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
diff --git a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
index b9651245d02..e7f0d562111 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
@@ -82,7 +82,7 @@ public class TableHttpExample {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
diff --git a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
index 200dbf66fdb..6f31da78c4f 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
@@ -82,7 +82,7 @@ public class TableHttpsExample {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
diff --git a/example/schema/src/main/java/org/apache/iotdb/schema/PathCheckExample.java b/example/schema/src/main/java/org/apache/iotdb/schema/PathCheckExample.java
index 5c2eea3c1a7..1bc9e5a9683 100644
--- a/example/schema/src/main/java/org/apache/iotdb/schema/PathCheckExample.java
+++ b/example/schema/src/main/java/org/apache/iotdb/schema/PathCheckExample.java
@@ -46,7 +46,8 @@ import java.util.concurrent.Future;
*
* <p>The usage of export-csv.sh can be found in the <a
* href="https://iotdb.apache.org/zh/UserGuide/V1.2.x/Tools-System/Import-Export-Tool.html#csv%E5%AF%BC%E5%85%A5%E5%AF%BC%E5%87%BA%E5%B7%A5%E5%85%B7">documentation</a>.
- * For example: ./export-csv.sh -h 127.0.0.1 -p 6667 -u root -pw root -td . -q "show timeseries"
+ * For example: ./export-csv.sh -h 127.0.0.1 -p 6667 -u root -pw IoTDB@2011 -td . -q "show
+ * timeseries"
*/
public class PathCheckExample {
private static final List<String> INPUT_LIST = new ArrayList<>();
diff --git a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
index a9d3150e23b..1fc1bec487b 100644
--- a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
@@ -57,7 +57,7 @@ public class AlignedTimeseriesSessionExample {
public static void main(String[] args)
throws IoTDBConnectionException, StatementExecutionException {
- session = new Session("127.0.0.1", 6667, "root", "root");
+ session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011");
session.open(false);
// set session fetchSize
diff --git a/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java b/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
index fb130cce40a..7fcf9cadebb 100644
--- a/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
@@ -75,8 +75,8 @@ public class DataMigrationExample {
path = args[0];
}
- readerPool = new SessionPool("127.0.0.1", 6667, "root", "root", CONCURRENCY);
- writerPool = new SessionPool("127.0.0.1", 6668, "root", "root", CONCURRENCY);
+ readerPool = new SessionPool("127.0.0.1", 6667, "root", "IoTDB@2011", CONCURRENCY);
+ writerPool = new SessionPool("127.0.0.1", 6668, "root", "IoTDB@2011", CONCURRENCY);
SessionDataSetWrapper deviceDataSet = readerPool.executeQueryStatement("count devices " + path);
DataIterator deviceIter = deviceDataSet.iterator();
diff --git a/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java b/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
index 34f529d257d..06fc3dfc9da 100644
--- a/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
@@ -50,7 +50,7 @@ public class HybridTimeseriesSessionExample {
public static void main(String[] args)
throws IoTDBConnectionException, StatementExecutionException {
- session = new Session("127.0.0.1", 6667, "root", "root");
+ session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011");
session.open(false);
// set session fetchSize
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java b/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
index 40d3ed12e80..13459505c26 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
@@ -53,7 +53,7 @@ public class SessionConcurrentExample {
public static void main(String[] args)
throws IoTDBConnectionException, StatementExecutionException, IOException {
- try (Session session = new Session("127.0.0.1", 6667, "root", "root")) {
+ try (Session session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011")) {
session.open(false);
createTemplate(session);
} catch (Exception e) {
@@ -80,7 +80,7 @@ public class SessionConcurrentExample {
private static void concurrentOperation(CountDownLatch latch, int currentIndex) {
- Session session = new Session("127.0.0.1", 6667, "root", "root");
+ Session session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011");
try {
session.open(false);
} catch (IoTDBConnectionException e) {
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index 9d4c1f700ee..1dd2f90d2c1 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -73,7 +73,7 @@ public class SessionExample {
.host(LOCAL_HOST)
.port(6667)
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.version(Version.V_1_0)
.build();
session.open(false);
@@ -112,7 +112,7 @@ public class SessionExample {
// deleteTimeseries();
// setTimeout();
- sessionEnableRedirect = new Session(LOCAL_HOST, 6667, "root", "root");
+ sessionEnableRedirect = new Session(LOCAL_HOST, 6667, "root", "IoTDB@2011");
sessionEnableRedirect.setEnableQueryRedirection(true);
sessionEnableRedirect.open(false);
@@ -820,7 +820,7 @@ public class SessionExample {
}
private static void setTimeout() throws IoTDBConnectionException {
- try (Session tempSession = new Session(LOCAL_HOST, 6667, "root", "root", 10000, 20000)) {
+ try (Session tempSession = new Session(LOCAL_HOST, 6667, "root", "IoTDB@2011", 10000, 20000)) {
tempSession.setQueryTimeout(60000);
}
}
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java b/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
index 578a82d4b84..61052bda7d5 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
@@ -48,7 +48,7 @@ public class SessionPoolExample {
.host("127.0.0.1")
.port(6667)
.user("root")
- .password("root")
+ .password("IoTDB@2011")
.maxSize(3)
.build();
}
@@ -62,7 +62,7 @@ public class SessionPoolExample {
new SessionPool.Builder()
.nodeUrls(nodeUrls)
.user("root")
- .password("root")
+ .password("IoTDB@2011")
.maxSize(3)
.build();
}
diff --git a/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java b/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
index 6f4d503bce0..d9a367e5016 100644
--- a/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
@@ -74,7 +74,7 @@ public class SubscriptionSessionExample {
.host(HOST)
.port(PORT)
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.version(Version.V_1_0)
.build();
session.open(false);
@@ -103,7 +103,7 @@ public class SubscriptionSessionExample {
.host(HOST)
.port(PORT)
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.version(Version.V_1_0)
.build();
session.open(false);
diff --git a/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java b/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
index ada3646fcce..fff3d97e4d0 100644
--- a/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
@@ -84,7 +84,7 @@ public class SyntaxConventionRelatedExample {
.host(LOCAL_HOST)
.port(6667)
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.version(Version.V_1_0)
.build();
session.open(false);
diff --git a/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java b/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java
index f7e9275ce15..5d6a97e7ed0 100644
--- a/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java
@@ -45,7 +45,7 @@ public class TableModelSessionExample {
new TableSessionBuilder()
.nodeUrls(Collections.singletonList(LOCAL_URL))
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.build()) {
session.executeNonQueryStatement("CREATE DATABASE test1");
@@ -140,7 +140,7 @@ public class TableModelSessionExample {
new TableSessionBuilder()
.nodeUrls(Collections.singletonList(LOCAL_URL))
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.database("test1")
.build()) {
diff --git a/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java b/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java
index a8d3c8b382b..2272f6c4ab2 100644
--- a/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java
@@ -46,7 +46,7 @@ public class TableModelSessionPoolExample {
new TableSessionPoolBuilder()
.nodeUrls(Collections.singletonList(LOCAL_URL))
.user("root")
- .password("root")
+ .password("IoTDB@2011")
.maxSize(1)
.build();
@@ -159,7 +159,7 @@ public class TableModelSessionPoolExample {
new TableSessionPoolBuilder()
.nodeUrls(Collections.singletonList(LOCAL_URL))
.user("root")
- .password("root")
+ .password("IoTDB@2011")
.maxSize(1)
.database("test1")
.build();
diff --git a/example/session/src/main/java/org/apache/iotdb/TableModelSubscriptionSessionExample.java b/example/session/src/main/java/org/apache/iotdb/TableModelSubscriptionSessionExample.java
index 363ff971662..12db882335c 100644
--- a/example/session/src/main/java/org/apache/iotdb/TableModelSubscriptionSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TableModelSubscriptionSessionExample.java
@@ -103,7 +103,7 @@ public class TableModelSubscriptionSessionExample {
.host("127.0.0.1")
.port(6667)
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.build()) {
final Properties config = new Properties();
config.put(TopicConstant.DATABASE_KEY, "db.*");
@@ -151,7 +151,7 @@ public class TableModelSubscriptionSessionExample {
.host("127.0.0.1")
.port(6667)
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.build()) {
session.getTopics().forEach((System.out::println));
session.getSubscriptions().forEach((System.out::println));
@@ -166,7 +166,7 @@ public class TableModelSubscriptionSessionExample {
new TableSessionBuilder()
.nodeUrls(Collections.singletonList(HOST + ":" + PORT))
.username("root")
- .password("root")
+ .password("IoTDB@2011")
.build()) {
createDataBaseAndTable(session, "db1", "test1");
createDataBaseAndTable(session, "db1", "test2");
diff --git a/example/session/src/main/java/org/apache/iotdb/TabletExample.java b/example/session/src/main/java/org/apache/iotdb/TabletExample.java
index f85dba2215b..8f7c6c2ca2d 100644
--- a/example/session/src/main/java/org/apache/iotdb/TabletExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TabletExample.java
@@ -130,7 +130,7 @@ public class TabletExample {
*/
public static void main(String[] args) throws Exception {
- try (Session session = new Session("127.0.0.1", 6667, "root", "root")) {
+ try (Session session = new Session("127.0.0.1", 6667, "root", "IoTDB@2011")) {
session.open();
String dataFileName = "sample.csv";
int rowSize = 10000;
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
index 78baab77218..c6cbc091c2e 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
@@ -561,6 +561,12 @@ public class MppCommonConfig extends MppBaseConfig implements CommonConfig {
return this;
}
+ @Override
+ public CommonConfig setEnforceStrongPassword(boolean enforceStrongPassword) {
+ setProperty("enforce_strong_password", String.valueOf(enforceStrongPassword));
+ return this;
+ }
+
// For part of the log directory
public String getClusterConfigStr() {
return fromConsensusFullNameToAbbr(properties.getProperty(CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS))
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppConfigNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppConfigNodeConfig.java
index 8e4a6def365..4385097ce04 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppConfigNodeConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppConfigNodeConfig.java
@@ -67,4 +67,10 @@ public class MppConfigNodeConfig extends MppBaseConfig implements ConfigNodeConf
properties.setProperty("metric_prometheus_reporter_password", password);
return this;
}
+
+ @Override
+ public ConfigNodeConfig setLeaderDistributionPolicy(String policy) {
+ properties.setProperty("leader_distribution_policy", policy);
+ return this;
+ }
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppDataNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppDataNodeConfig.java
index b7fa3bdee2c..357c15c7856 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppDataNodeConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppDataNodeConfig.java
@@ -131,4 +131,10 @@ public class MppDataNodeConfig extends MppBaseConfig implements DataNodeConfig {
setProperty("delete_wal_files_period_in_ms", String.valueOf(deleteWalFilesPeriodInMs));
return this;
}
+
+ @Override
+ public DataNodeConfig setDataNodeMemoryProportion(String dataNodeMemoryProportion) {
+ setProperty("datanode_memory_proportion", dataNodeMemoryProportion);
+ return this;
+ }
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
index 6db1003f5b9..2fdf256f11b 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
@@ -580,4 +580,11 @@ public class MppSharedCommonConfig implements CommonConfig {
cnConfig.setDefaultStorageGroupLevel(defaultStorageGroupLevel);
return this;
}
+
+ @Override
+ public CommonConfig setEnforceStrongPassword(boolean enforceStrongPassword) {
+ dnConfig.setEnforceStrongPassword(enforceStrongPassword);
+ cnConfig.setEnforceStrongPassword(enforceStrongPassword);
+ return this;
+ }
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java
index 625280358e0..4361e213c8e 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java
@@ -539,7 +539,8 @@ public abstract class AbstractEnv implements BaseEnv {
if (statusCode != 0) {
logger.info("Node {} is not running due to {}", nodeWrapper.getId(), statusCode);
}
- if (statusCode == TSStatusCode.PORT_OCCUPIED.getStatusCode()) {
+ if (statusCode == TSStatusCode.PORT_OCCUPIED.getStatusCode() || statusCode == 1) {
+ // the occupation of jmx port may return 1
try {
Map<Integer, Long> portOccupationMap =
EnvUtils.listPortOccupation(
@@ -961,7 +962,7 @@ public abstract class AbstractEnv implements BaseEnv {
+ dataNodeEndpoint
+ getParam(null, NODE_NETWORK_TIMEOUT_MS, ZERO_TIME_ZONE),
System.getProperty("User", "root"),
- System.getProperty("Password", "root"))) {
+ System.getProperty("Password", "IoTDB@2011"))) {
logger.info("Successfully connecting to DataNode: {}.", dataNodeEndpoint);
return null;
} catch (final Exception e) {
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java
index 27c688dc328..5fee09552b6 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java
@@ -339,61 +339,64 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
clusterConfigProperties.setProperty(
CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_CONFIG_NODE_CONSENSUS)));
+ System.getProperty(
+ LIGHT_WEIGHT_STANDALONE_MODE_CONFIG_NODE_CONSENSUS, "Simple")));
clusterConfigProperties.setProperty(
SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_SCHEMA_REGION_CONSENSUS)));
+ System.getProperty(
+ LIGHT_WEIGHT_STANDALONE_MODE_SCHEMA_REGION_CONSENSUS, "Simple")));
clusterConfigProperties.setProperty(
DATA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_DATA_REGION_CONSENSUS)));
+ System.getProperty(
+ LIGHT_WEIGHT_STANDALONE_MODE_DATA_REGION_CONSENSUS, "Simple")));
clusterConfigProperties.setProperty(
SCHEMA_REPLICATION_FACTOR,
- System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_SCHEMA_REGION_REPLICA_NUM));
+ System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_SCHEMA_REGION_REPLICA_NUM, "1"));
clusterConfigProperties.setProperty(
DATA_REPLICATION_FACTOR,
- System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_DATA_REGION_REPLICA_NUM));
+ System.getProperty(LIGHT_WEIGHT_STANDALONE_MODE_DATA_REGION_REPLICA_NUM, "1"));
break;
case SCALABLE_SINGLE_NODE_MODE:
clusterConfigProperties.setProperty(
CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(SCALABLE_SINGLE_NODE_MODE_CONFIG_NODE_CONSENSUS)));
+ System.getProperty(SCALABLE_SINGLE_NODE_MODE_CONFIG_NODE_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(SCALABLE_SINGLE_NODE_MODE_SCHEMA_REGION_CONSENSUS)));
+ System.getProperty(SCALABLE_SINGLE_NODE_MODE_SCHEMA_REGION_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
DATA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(SCALABLE_SINGLE_NODE_MODE_DATA_REGION_CONSENSUS)));
+ System.getProperty(SCALABLE_SINGLE_NODE_MODE_DATA_REGION_CONSENSUS, "IoT")));
clusterConfigProperties.setProperty(
SCHEMA_REPLICATION_FACTOR,
- System.getProperty(SCALABLE_SINGLE_NODE_MODE_SCHEMA_REGION_REPLICA_NUM));
+ System.getProperty(SCALABLE_SINGLE_NODE_MODE_SCHEMA_REGION_REPLICA_NUM, "1"));
clusterConfigProperties.setProperty(
DATA_REPLICATION_FACTOR,
- System.getProperty(SCALABLE_SINGLE_NODE_MODE_DATA_REGION_REPLICA_NUM));
+ System.getProperty(SCALABLE_SINGLE_NODE_MODE_DATA_REGION_REPLICA_NUM, "1"));
break;
case HIGH_PERFORMANCE_MODE:
clusterConfigProperties.setProperty(
CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(HIGH_PERFORMANCE_MODE_CONFIG_NODE_CONSENSUS)));
+ System.getProperty(HIGH_PERFORMANCE_MODE_CONFIG_NODE_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(HIGH_PERFORMANCE_MODE_SCHEMA_REGION_CONSENSUS)));
+ System.getProperty(HIGH_PERFORMANCE_MODE_SCHEMA_REGION_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
DATA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(HIGH_PERFORMANCE_MODE_DATA_REGION_CONSENSUS)));
+ System.getProperty(HIGH_PERFORMANCE_MODE_DATA_REGION_CONSENSUS, "IoT")));
clusterConfigProperties.setProperty(
SCHEMA_REPLICATION_FACTOR,
- System.getProperty(HIGH_PERFORMANCE_MODE_SCHEMA_REGION_REPLICA_NUM));
+ System.getProperty(HIGH_PERFORMANCE_MODE_SCHEMA_REGION_REPLICA_NUM, "3"));
clusterConfigProperties.setProperty(
DATA_REPLICATION_FACTOR,
- System.getProperty(HIGH_PERFORMANCE_MODE_DATA_REGION_REPLICA_NUM));
+ System.getProperty(HIGH_PERFORMANCE_MODE_DATA_REGION_REPLICA_NUM, "2"));
break;
case STRONG_CONSISTENCY_CLUSTER_MODE:
clusterConfigProperties.setProperty(
@@ -419,21 +422,21 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
clusterConfigProperties.setProperty(
CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(PIPE_CONSENSUS_BATCH_MODE_CONFIG_NODE_CONSENSUS)));
+ System.getProperty(PIPE_CONSENSUS_BATCH_MODE_CONFIG_NODE_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(PIPE_CONSENSUS_BATCH_MODE_SCHEMA_REGION_CONSENSUS)));
+ System.getProperty(PIPE_CONSENSUS_BATCH_MODE_SCHEMA_REGION_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
DATA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(PIPE_CONSENSUS_BATCH_MODE_DATA_REGION_CONSENSUS)));
+ System.getProperty(PIPE_CONSENSUS_BATCH_MODE_DATA_REGION_CONSENSUS, "IoTV2")));
clusterConfigProperties.setProperty(
SCHEMA_REPLICATION_FACTOR,
- System.getProperty(PIPE_CONSENSUS_BATCH_MODE_SCHEMA_REGION_REPLICA_NUM));
+ System.getProperty(PIPE_CONSENSUS_BATCH_MODE_SCHEMA_REGION_REPLICA_NUM, "3"));
clusterConfigProperties.setProperty(
DATA_REPLICATION_FACTOR,
- System.getProperty(PIPE_CONSENSUS_BATCH_MODE_DATA_REGION_REPLICA_NUM));
+ System.getProperty(PIPE_CONSENSUS_BATCH_MODE_DATA_REGION_REPLICA_NUM, "2"));
// set mode
clusterConfigProperties.setProperty(
IOT_CONSENSUS_V2_MODE, ConsensusFactory.IOT_CONSENSUS_V2_BATCH_MODE);
@@ -442,21 +445,21 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
clusterConfigProperties.setProperty(
CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(PIPE_CONSENSUS_STREAM_MODE_CONFIG_NODE_CONSENSUS)));
+ System.getProperty(PIPE_CONSENSUS_STREAM_MODE_CONFIG_NODE_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(PIPE_CONSENSUS_STREAM_MODE_SCHEMA_REGION_CONSENSUS)));
+ System.getProperty(PIPE_CONSENSUS_STREAM_MODE_SCHEMA_REGION_CONSENSUS, "Ratis")));
clusterConfigProperties.setProperty(
DATA_REGION_CONSENSUS_PROTOCOL_CLASS,
fromConsensusAbbrToFullName(
- System.getProperty(PIPE_CONSENSUS_STREAM_MODE_DATA_REGION_CONSENSUS)));
+ System.getProperty(PIPE_CONSENSUS_STREAM_MODE_DATA_REGION_CONSENSUS, "IoTV2")));
clusterConfigProperties.setProperty(
SCHEMA_REPLICATION_FACTOR,
- System.getProperty(PIPE_CONSENSUS_STREAM_MODE_SCHEMA_REGION_REPLICA_NUM));
+ System.getProperty(PIPE_CONSENSUS_STREAM_MODE_SCHEMA_REGION_REPLICA_NUM, "3"));
clusterConfigProperties.setProperty(
DATA_REPLICATION_FACTOR,
- System.getProperty(PIPE_CONSENSUS_STREAM_MODE_DATA_REGION_REPLICA_NUM));
+ System.getProperty(PIPE_CONSENSUS_STREAM_MODE_DATA_REGION_REPLICA_NUM, "2"));
// set mode
clusterConfigProperties.setProperty(
IOT_CONSENSUS_V2_MODE, ConsensusFactory.IOT_CONSENSUS_V2_STREAM_MODE);
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteCommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteCommonConfig.java
index 55a772a60da..ba82d7d9c77 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteCommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteCommonConfig.java
@@ -386,6 +386,11 @@ public class RemoteCommonConfig implements CommonConfig {
return this;
}
+ @Override
+ public CommonConfig setEnforceStrongPassword(boolean enforceStrongPassword) {
+ return this;
+ }
+
@Override
public CommonConfig setSubscriptionPrefetchTsFileBatchMaxDelayInMs(
int subscriptionPrefetchTsFileBatchMaxDelayInMs) {
@@ -398,6 +403,7 @@ public class RemoteCommonConfig implements CommonConfig {
return this;
}
+ @Override
public CommonConfig setSubscriptionEnabled(boolean subscriptionEnabled) {
return this;
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteConfigNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteConfigNodeConfig.java
index ae8645eff52..c16722f4bd9 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteConfigNodeConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteConfigNodeConfig.java
@@ -38,4 +38,9 @@ public class RemoteConfigNodeConfig implements ConfigNodeConfig {
public ConfigNodeConfig setMetricPrometheusReporterPassword(String password) {
return this;
}
+
+ @Override
+ public ConfigNodeConfig setLeaderDistributionPolicy(String policy) {
+ return this;
+ }
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteDataNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteDataNodeConfig.java
index 1f61ff4289c..1af7cb8f613 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteDataNodeConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteDataNodeConfig.java
@@ -88,4 +88,9 @@ public class RemoteDataNodeConfig implements DataNodeConfig {
public DataNodeConfig setDeleteWalFilesPeriodInMs(long deleteWalFilesPeriodInMs) {
return this;
}
+
+ @Override
+ public DataNodeConfig setDataNodeMemoryProportion(String dataNodeMemoryProportion) {
+ return this;
+ }
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/env/RemoteServerEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/env/RemoteServerEnv.java
index c2308cfe103..6ba4892fd3a 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/env/RemoteServerEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/env/RemoteServerEnv.java
@@ -68,7 +68,7 @@ public class RemoteServerEnv implements BaseEnv {
private final String dataNodeMetricPort = System.getProperty("RemoteDataNodeMetricPort", "9093");
private final String user = System.getProperty("RemoteUser", "root");
- private final String password = System.getProperty("RemotePassword", "root");
+ private final String password = System.getProperty("RemotePassword", "IoTDB@2011");
private IClientManager<TEndPoint, SyncConfigNodeIServiceClient> clientManager;
private RemoteClusterConfig clusterConfig = new RemoteClusterConfig();
@@ -134,7 +134,7 @@ public class RemoteServerEnv implements BaseEnv {
connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + ip_addr + ":" + port,
- BaseEnv.constructProperties(this.user, this.password, sqlDialect));
+ BaseEnv.constructProperties(username, password, sqlDialect));
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new AssertionError();
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
index 6f02ebfc770..370fca6216b 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
@@ -181,4 +181,6 @@ public interface CommonConfig {
default CommonConfig setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
return this;
}
+
+ CommonConfig setEnforceStrongPassword(boolean enforceStrongPassword);
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java
index 65a5a3271fc..4af35f6f56a 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java
@@ -29,4 +29,6 @@ public interface ConfigNodeConfig {
ConfigNodeConfig setMetricPrometheusReporterUsername(String username);
ConfigNodeConfig setMetricPrometheusReporterPassword(String password);
+
+ ConfigNodeConfig setLeaderDistributionPolicy(String policy);
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java
index 4d2e4435bdb..0ae46ffc70f 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java
@@ -49,4 +49,6 @@ public interface DataNodeConfig {
DataNodeConfig setWalThrottleSize(long walThrottleSize);
DataNodeConfig setDeleteWalFilesPeriodInMs(long deleteWalFilesPeriodInMs);
+
+ DataNodeConfig setDataNodeMemoryProportion(String dataNodeMemoryProportion);
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java b/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
index bd1a7d88207..0bf7c56ca5c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
@@ -91,7 +91,7 @@ public class StartClientScriptIT extends AbstractScriptIT {
"-u",
"root",
"-pw",
- "root",
+ "IoTDB@2011",
"&",
"exit",
"%^errorlevel%");
@@ -134,7 +134,7 @@ public class StartClientScriptIT extends AbstractScriptIT {
"-u",
"root",
"-pw",
- "root");
+ "IoTDB@2011");
builder.environment().put("IOTDB_HOME", homePath);
testOutput(builder, output, 1);
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
index 1c8b7c5fb29..3c373dfbf63 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
@@ -91,7 +91,7 @@ public class IoTDBConfigNodeSnapshotIT {
.getConfig()
.getCommonConfig()
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
- .setConfigNodeRatisSnapshotTriggerThreshold(100)
+ .setConfigNodeRatisSnapshotTriggerThreshold(1000)
.setTimePartitionInterval(testTimePartitionInterval);
// Init 2C2D cluster environment
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java
index 2ca034497f0..6f94e0e16f4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java
@@ -306,7 +306,7 @@ public class IoTDBClusterNodeGetterIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), dataNodeRemoveResp.getStatus().getCode());
// Waiting for RemoveDataNodeProcedure
- for (int retry = 0; retry < 10; retry++) {
+ for (int retry = 0; retry < 60; retry++) {
showDataNodesResp = client.showDataNodes();
if (showDataNodesResp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
&& showDataNodesResp.getDataNodesInfoListSize() == testDataNodeNum - 1) {
@@ -315,7 +315,7 @@ public class IoTDBClusterNodeGetterIT {
TimeUnit.SECONDS.sleep(1);
}
- fail("Remove DataNode failed");
+ fail("Remove DataNode failed, last showDataNodesResp: " + showDataNodesResp);
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java
index 7a81810a1f5..e08339823d6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java
@@ -90,7 +90,7 @@ public class IoTDBDatabaseSetAndDeleteIT {
// test count all Databases
TCountDatabaseResp countResp =
client.countMatchedDatabases(
- new TGetDatabaseReq(Arrays.asList("root", "**"), ALL_MATCH_SCOPE_BINARY));
+ new TGetDatabaseReq(Arrays.asList("root", "sg*"), ALL_MATCH_SCOPE_BINARY));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), countResp.getStatus().getCode());
Assert.assertEquals(2, countResp.getCount());
@@ -106,7 +106,7 @@ public class IoTDBDatabaseSetAndDeleteIT {
// test query all DatabaseSchemas
TDatabaseSchemaResp getResp =
client.getMatchedDatabaseSchemas(
- new TGetDatabaseReq(Arrays.asList("root", "**"), ALL_MATCH_SCOPE_BINARY));
+ new TGetDatabaseReq(Arrays.asList("root", "sg*"), ALL_MATCH_SCOPE_BINARY));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), getResp.getStatus().getCode());
Map<String, TDatabaseSchema> schemaMap = getResp.getDatabaseSchemaMap();
@@ -180,7 +180,7 @@ public class IoTDBDatabaseSetAndDeleteIT {
TSStatus deleteSgStatus = client.deleteDatabases(deleteStorageGroupsReq);
TDatabaseSchemaResp root =
client.getMatchedDatabaseSchemas(
- new TGetDatabaseReq(Arrays.asList("root", "*"), ALL_MATCH_SCOPE_BINARY));
+ new TGetDatabaseReq(Arrays.asList("root", "sg*"), ALL_MATCH_SCOPE_BINARY));
Assert.assertTrue(root.getDatabaseSchemaMap().isEmpty());
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), deleteSgStatus.getCode());
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBMultiDBRegionGroupLeaderDistributionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBMultiDBRegionGroupLeaderDistributionIT.java
index 381c2a6fff5..98395aeb785 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBMultiDBRegionGroupLeaderDistributionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBMultiDBRegionGroupLeaderDistributionIT.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.client.exception.ClientManagerException;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.RegionRoleType;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionTableResp;
@@ -110,6 +111,9 @@ public class IoTDBMultiDBRegionGroupLeaderDistributionIT {
Map<Integer, Integer> dataNodeLeaderCounter = new TreeMap<>();
Map<String, Map<Integer, Integer>> databaseLeaderCounter = new TreeMap<>();
TShowRegionResp showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.startsWith("root." + SystemConstant.SYSTEM_PREFIX_KEY));
showRegionResp
.getRegionInfoList()
.forEach(
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBRegionGroupLeaderDistributionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBRegionGroupLeaderDistributionIT.java
index 83dc1e2c58f..8e4df1551f5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBRegionGroupLeaderDistributionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBRegionGroupLeaderDistributionIT.java
@@ -25,6 +25,7 @@ import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.cluster.RegionRoleType;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionTableResp;
import org.apache.iotdb.confignode.rpc.thrift.TDatabaseSchema;
@@ -116,6 +117,9 @@ public class IoTDBRegionGroupLeaderDistributionIT {
// Check the number of RegionGroup-leader in each DataNode.
Map<Integer, Integer> leaderCounter = new TreeMap<>();
TShowRegionResp showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.startsWith(SystemConstant.SYSTEM_DATABASE));
showRegionResp
.getRegionInfoList()
.forEach(
@@ -164,6 +168,9 @@ public class IoTDBRegionGroupLeaderDistributionIT {
for (int retry = 0; retry < retryNum; retry++) {
leaderCounter.clear();
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.startsWith(SystemConstant.SYSTEM_DATABASE));
showRegionResp
.getRegionInfoList()
.forEach(
@@ -203,6 +210,9 @@ public class IoTDBRegionGroupLeaderDistributionIT {
for (int retry = 0; retry < retryNum; retry++) {
leaderCounter.clear();
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.startsWith(SystemConstant.SYSTEM_DATABASE));
showRegionResp
.getRegionInfoList()
.forEach(
@@ -268,6 +278,9 @@ public class IoTDBRegionGroupLeaderDistributionIT {
for (int retry = 0; retry < retryNum; retry++) {
leaderCounter.clear();
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.startsWith(SystemConstant.SYSTEM_DATABASE));
showRegionResp
.getRegionInfoList()
.forEach(
@@ -318,6 +331,9 @@ public class IoTDBRegionGroupLeaderDistributionIT {
for (int retry = 0; retry < retryNum; retry++) {
isDistributionBalanced.set(true);
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.startsWith(SystemConstant.SYSTEM_DATABASE));
showRegionResp
.getRegionInfoList()
.forEach(
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtension2IT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtension2IT.java
index 5d00ef023eb..9be144b6c7e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtension2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtension2IT.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.client.exception.ClientManagerException;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.NodeStatus;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionTableResp;
@@ -147,6 +148,8 @@ public class IoTDBAutoRegionGroupExtension2IT {
// Check DataRegionGroups
TShowRegionResp resp = client.showRegion(new TShowRegionReq());
+ resp.getRegionInfoList()
+ .removeIf(r -> r.getDatabase().startsWith(SystemConstant.SYSTEM_DATABASE));
Map<Integer, AtomicInteger> counter = new HashMap<>();
resp.getRegionInfoList()
.forEach(
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
index 4c48c004624..c68d1779839 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.exception.IllegalPathException;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionTableResp;
@@ -109,6 +110,9 @@ public class IoTDBAutoRegionGroupExtensionIT {
boolean isAllRegionGroupDeleted = false;
for (int retry = 0; retry < retryNum; retry++) {
TShowRegionResp showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
if (showRegionResp.getRegionInfoListSize() == 0) {
isAllRegionGroupDeleted = true;
break;
@@ -182,7 +186,8 @@ public class IoTDBAutoRegionGroupExtensionIT {
.merge(regionInfo.getDataNodeId(), 1, Integer::sum);
});
// The number of RegionGroups should not less than the testMinRegionGroupNum for each database
- Assert.assertEquals(TEST_DATABASE_NUM, databaseRegionCounter.size());
+ // +1 for system database
+ Assert.assertEquals(TEST_DATABASE_NUM + 1, databaseRegionCounter.size());
databaseRegionCounter.forEach(
(database, regionCount) ->
Assert.assertTrue(
@@ -193,13 +198,16 @@ public class IoTDBAutoRegionGroupExtensionIT {
// The maximal Region count - minimal Region count should be less than or equal to 1 for each
// DataNode
Assert.assertEquals(TEST_DATA_NODE_NUM, dataNodeRegionCounter.size());
+ System.out.println(databaseRegionCounter);
+ System.out.println(dataNodeRegionCounter);
Assert.assertTrue(
dataNodeRegionCounter.values().stream().max(Integer::compareTo).orElse(0)
- dataNodeRegionCounter.values().stream().min(Integer::compareTo).orElse(0)
<= 1);
// The maximal Region count - minimal Region count should be less than or equal to 1 for each
// Database
- Assert.assertEquals(TEST_DATABASE_NUM, databaseDataNodeRegionCounter.size());
+ // +1 for system database
+ Assert.assertEquals(TEST_DATABASE_NUM + 1, databaseDataNodeRegionCounter.size());
databaseDataNodeRegionCounter.forEach(
(database, dataNodeRegionCount) ->
Assert.assertTrue(
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java
index 2a0ccffe60c..fb1e315be10 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.cluster.RegionStatus;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionTableResp;
@@ -401,6 +402,9 @@ public class IoTDBPartitionCreationIT {
readOnlyCnt = 0;
removingCnt = 0;
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), showRegionResp.getStatus().getCode());
for (TRegionInfo regionInfo : showRegionResp.getRegionInfoList()) {
@@ -463,6 +467,9 @@ public class IoTDBPartitionCreationIT {
readOnlyCnt = 0;
removingCnt = 0;
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), showRegionResp.getStatus().getCode());
for (TRegionInfo regionInfo : showRegionResp.getRegionInfoList()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
index 93780ec68dc..9560fb2d88c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
@@ -25,6 +25,7 @@ import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.cluster.RegionStatus;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
import org.apache.iotdb.confignode.rpc.thrift.TDataNodeInfo;
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
@@ -151,6 +152,9 @@ public class IoTDBPartitionDurableIT {
/* Check Region distribution */
TShowRegionResp showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), showRegionResp.getStatus().getCode());
// Create exactly one RegionGroup
@@ -235,6 +239,9 @@ public class IoTDBPartitionDurableIT {
/* Check Region distribution */
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), showRegionResp.getStatus().getCode());
// There should be 2 RegionGroups
@@ -358,6 +365,9 @@ public class IoTDBPartitionDurableIT {
runningCnt = 0;
unknownCnt = 0;
TShowRegionResp showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), showRegionResp.getStatus().getCode());
for (TRegionInfo regionInfo : showRegionResp.getRegionInfoList()) {
@@ -413,6 +423,9 @@ public class IoTDBPartitionDurableIT {
runningCnt = 0;
unknownCnt = 0;
showRegionResp = client.showRegion(new TShowRegionReq());
+ showRegionResp
+ .getRegionInfoList()
+ .removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), showRegionResp.getStatus().getCode());
for (TRegionInfo regionInfo : showRegionResp.getRegionInfoList()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
index 65ff81cb8b1..e097e2bc8cd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
@@ -208,7 +208,7 @@ public class IoTDBPartitionGetterIT {
final String d11 = sg1 + ".d1.s";
- final String allPaths = "root.**";
+ final String allPaths = "root.sg*";
final String allSg0 = "root.sg0.**";
final String notExistsSg = "root.sg10.**";
@@ -535,7 +535,8 @@ public class IoTDBPartitionGetterIT {
nodeManagementResp = client.getSchemaNodeManagementPartition(nodeManagementReq);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), nodeManagementResp.getStatus().getCode());
- Assert.assertEquals(storageGroupNum, nodeManagementResp.getMatchedNodeSize());
+ // +1 for SYSTEM database
+ Assert.assertEquals(storageGroupNum + 1, nodeManagementResp.getMatchedNodeSize());
Assert.assertNotNull(nodeManagementResp.getSchemaRegionMap());
Assert.assertEquals(0, nodeManagementResp.getSchemaRegionMapSize());
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/procedure/IoTDBProcedureIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/procedure/IoTDBProcedureIT.java
index 0722dde7489..ef56141d0bf 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/procedure/IoTDBProcedureIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/procedure/IoTDBProcedureIT.java
@@ -137,7 +137,7 @@ public class IoTDBProcedureIT {
Callable<Boolean> finalCheck =
() -> {
TShowDatabaseResp resp1 = newLeaderClient.showDatabase(showAllDatabasesReq);
- if (MAX_STATE != resp1.getDatabaseInfoMap().size()) {
+ if (MAX_STATE != resp1.getDatabaseInfoMap().size() - 1) {
return false;
}
resp1
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/IoTDBRegionOperationReliabilityITFramework.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/IoTDBRegionOperationReliabilityITFramework.java
index 075035dcab9..224dcf890dd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/IoTDBRegionOperationReliabilityITFramework.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/IoTDBRegionOperationReliabilityITFramework.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.RegionStatus;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.conf.IoTDBConstant;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
import org.apache.iotdb.commons.utils.KillPoint.KillNode;
import org.apache.iotdb.commons.utils.KillPoint.KillPoint;
@@ -436,7 +437,10 @@ public class IoTDBRegionOperationReliabilityITFramework {
Map<Integer, Set<Integer>> regionMap = new HashMap<>();
while (showRegionsResult.next()) {
if (String.valueOf(TConsensusGroupType.DataRegion)
- .equals(showRegionsResult.getString(ColumnHeaderConstant.TYPE))) {
+ .equals(showRegionsResult.getString(ColumnHeaderConstant.TYPE))
+ && !showRegionsResult
+ .getString(ColumnHeaderConstant.DATABASE)
+ .equals(SystemConstant.SYSTEM_DATABASE)) {
int regionId = showRegionsResult.getInt(ColumnHeaderConstant.REGION_ID);
int dataNodeId = showRegionsResult.getInt(ColumnHeaderConstant.DATA_NODE_ID);
regionMap.computeIfAbsent(regionId, id -> new HashSet<>()).add(dataNodeId);
@@ -451,7 +455,10 @@ public class IoTDBRegionOperationReliabilityITFramework {
Map<Integer, Pair<Integer, Set<Integer>>> regionMap = new HashMap<>();
while (showRegionsResult.next()) {
if (String.valueOf(TConsensusGroupType.DataRegion)
- .equals(showRegionsResult.getString(ColumnHeaderConstant.TYPE))) {
+ .equals(showRegionsResult.getString(ColumnHeaderConstant.TYPE))
+ && !showRegionsResult
+ .getString(ColumnHeaderConstant.DATABASE)
+ .equals(SystemConstant.SYSTEM_DATABASE)) {
int regionId = showRegionsResult.getInt(ColumnHeaderConstant.REGION_ID);
int dataNodeId = showRegionsResult.getInt(ColumnHeaderConstant.DATA_NODE_ID);
Pair<Integer, Set<Integer>> leaderNodesPair =
@@ -627,13 +634,16 @@ public class IoTDBRegionOperationReliabilityITFramework {
private static void checkRegionFileClear(int dataNode) {
File originalRegionDir = new File(buildRegionDirPath(dataNode));
Assert.assertTrue(originalRegionDir.isDirectory());
+ File[] files = originalRegionDir.listFiles();
try {
- Assert.assertEquals(0, Objects.requireNonNull(originalRegionDir.listFiles()).length);
+ int length = Objects.requireNonNull(files).length;
+ // the node may still have a region of the system database
+ Assert.assertTrue(length == 0 || length == 1 && files[0].getName().equals("1_1"));
} catch (AssertionError e) {
LOGGER.error(
"Original DataNode {} region file not clear, these files is still remain: {}",
dataNode,
- Arrays.toString(originalRegionDir.listFiles()));
+ Arrays.toString(files));
throw e;
}
LOGGER.info("Original DataNode {} region file clear", dataNode);
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionGroupExpandAndShrinkForIoTV1IT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionGroupExpandAndShrinkForIoTV1IT.java
index 3c4aa16a401..07a84d96657 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionGroupExpandAndShrinkForIoTV1IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionGroupExpandAndShrinkForIoTV1IT.java
@@ -89,7 +89,8 @@ public class IoTDBRegionGroupExpandAndShrinkForIoTV1IT
Set<Integer> allDataNodeId = getAllDataNodes(statement);
// expect one data region, one schema region
- Assert.assertEquals(2, regionMap.size());
+ // plus one system data region, one system schema region
+ Assert.assertEquals(4, regionMap.size());
// expand
for (int selectedRegion : regionMap.keySet()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionReconstructForIoTV1IT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionReconstructForIoTV1IT.java
index 05f92893839..c422444383a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionReconstructForIoTV1IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionReconstructForIoTV1IT.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.confignode.it.regionmigration.pass.commit;
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.cluster.NodeStatus;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.confignode.it.regionmigration.IoTDBRegionOperationReliabilityITFramework;
import org.apache.iotdb.consensus.ConsensusFactory;
import org.apache.iotdb.isession.SessionDataSet;
@@ -28,11 +29,12 @@ import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
+import org.apache.iotdb.itbase.env.BaseEnv;
import org.apache.iotdb.rpc.StatementExecutionException;
import org.apache.iotdb.session.Session;
-import org.apache.commons.io.FileUtils;
import org.apache.tsfile.read.common.RowRecord;
+import org.apache.tsfile.utils.Pair;
import org.awaitility.Awaitility;
import org.junit.Assert;
import org.junit.Test;
@@ -44,12 +46,12 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.sql.Connection;
import java.sql.Statement;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static org.apache.iotdb.util.MagicUtils.makeItCloseQuietly;
+import static org.junit.Assert.fail;
@Category({ClusterIT.class})
@RunWith(IoTDBTestRunner.class)
@@ -57,6 +59,24 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
private static final String RECONSTRUCT_FORMAT = "reconstruct region %d on %d";
private static Logger LOGGER = LoggerFactory.getLogger(IoTDBRegionReconstructForIoTV1IT.class);
+ private boolean deleteTsFiles(File file) {
+ if (file.isDirectory()) {
+ File[] files = file.listFiles();
+ if (files != null) {
+ for (File f : files) {
+ if (!deleteTsFiles(f)) {
+ return false;
+ } else if (f.getName().endsWith(".tsfile")) {
+ LOGGER.info("{} is removed", f);
+ }
+ }
+ }
+ } else if (file.getName().endsWith(".tsfile")) {
+ return file.delete();
+ }
+ return true;
+ }
+
@Test
public void normal1C3DTest() throws Exception {
EnvFactory.getEnv()
@@ -66,6 +86,7 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setDataReplicationFactor(2)
.setSchemaReplicationFactor(3);
+ EnvFactory.getEnv().getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
EnvFactory.getEnv().initClusterEnvironment(1, 3);
@@ -78,16 +99,19 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
statement.execute(FLUSH_COMMAND);
// collect necessary information
- Map<Integer, Set<Integer>> dataRegionMap = getDataRegionMap(statement);
+ Map<Integer, Pair<Integer, Set<Integer>>> dataRegionMap =
+ getDataRegionMapWithLeader(statement);
Set<Integer> allDataNodeId = getAllDataNodes(statement);
// select datanode
- final int selectedRegion = 1;
+ final int selectedRegion = 3;
Assert.assertTrue(dataRegionMap.containsKey(selectedRegion));
- Assert.assertEquals(2, dataRegionMap.get(selectedRegion).size());
- Iterator<Integer> iterator = dataRegionMap.get(selectedRegion).iterator();
- final int dataNodeToBeClosed = iterator.next();
- final int dataNodeToBeReconstructed = iterator.next();
+ Pair<Integer, Set<Integer>> leaderAndNodeIds = dataRegionMap.get(selectedRegion);
+ Assert.assertEquals(2, leaderAndNodeIds.right.size());
+ // reconstruct from the leader to ensure no data is lost
+ final int dataNodeToBeClosed = leaderAndNodeIds.left;
+ final int dataNodeToBeReconstructed =
+ leaderAndNodeIds.right.stream().filter(x -> x != dataNodeToBeClosed).findAny().get();
final int dataNodeAlwaysGood =
allDataNodeId.stream()
.filter(x -> x != dataNodeToBeReconstructed && x != dataNodeToBeClosed)
@@ -102,6 +126,16 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
.build();
session.open();
+ LOGGER.info(
+ "IoTDBRegionReconstructForIoTV1IT: Node {} is to be closed",
+ EnvFactory.getEnv().dataNodeIdToWrapper(dataNodeToBeClosed).get().getIpAndPortString());
+ LOGGER.info(
+ "IoTDBRegionReconstructForIoTV1IT: Node {} is to be reconstructed",
+ EnvFactory.getEnv()
+ .dataNodeIdToWrapper(dataNodeToBeReconstructed)
+ .get()
+ .getIpAndPortString());
+
// delete one DataNode's data dir, stop another DataNode
File dataDirToBeReconstructed =
new File(
@@ -109,13 +143,29 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
.dataNodeIdToWrapper(dataNodeToBeReconstructed)
.get()
.getDataPath());
- FileUtils.deleteDirectory(dataDirToBeReconstructed);
+
EnvFactory.getEnv().dataNodeIdToWrapper(dataNodeToBeClosed).get().stopForcibly();
- // now, the query should throw exception
- Assert.assertThrows(
- StatementExecutionException.class,
- () -> session.executeQueryStatement("select * from root.**"));
+ while (true) {
+ try (Connection flushConn =
+ EnvFactory.getEnv()
+ .getConnection(
+ EnvFactory.getEnv().dataNodeIdToWrapper(dataNodeToBeReconstructed).get(),
+ CommonDescriptor.getInstance().getConfig().getAdminName(),
+ CommonDescriptor.getInstance().getConfig().getAdminPassword(),
+ BaseEnv.TREE_SQL_DIALECT);
+ Statement flushStatement = flushConn.createStatement()) {
+ flushStatement.execute("FLUSH ON LOCAL");
+ }
+ deleteTsFiles(dataDirToBeReconstructed);
+
+ // now, the query should throw exception
+ try {
+ session.executeQueryStatement("select * from root.sg.**");
+ } catch (StatementExecutionException e) {
+ break;
+ }
+ }
// start DataNode, reconstruct the delete one
EnvFactory.getEnv().dataNodeIdToWrapper(dataNodeToBeClosed).get().start();
@@ -125,7 +175,7 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
try {
Awaitility.await()
.pollInterval(1, TimeUnit.SECONDS)
- .atMost(1, TimeUnit.MINUTES)
+ .atMost(10, TimeUnit.MINUTES)
.until(
() ->
getRegionStatusWithoutRunning(session).isEmpty()
@@ -133,17 +183,29 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
} catch (Exception e) {
LOGGER.error(
"Two factor: {} && {}",
- getRegionStatusWithoutRunning(session).isEmpty(),
+ getRegionStatusWithoutRunning(session),
dataDirToBeReconstructed.getAbsoluteFile().exists());
- Assert.fail();
+ fail();
}
EnvFactory.getEnv().dataNodeIdToWrapper(dataNodeToBeClosed).get().stopForcibly();
- // now, the query should work fine
- SessionDataSet resultSet = session.executeQueryStatement("select * from root.**");
- RowRecord rowRecord = resultSet.next();
- Assert.assertEquals("2.0", rowRecord.getField(0).getStringValue());
- Assert.assertEquals("1.0", rowRecord.getField(1).getStringValue());
+ // now, the query should work fine, but the update of region status may have some delay
+ long start = System.currentTimeMillis();
+ while (true) {
+ SessionDataSet resultSet = null;
+ try {
+ resultSet = session.executeQueryStatement("select * from root.sg.**");
+ } catch (StatementExecutionException e) {
+ if (System.currentTimeMillis() - start > 60_000L) {
+ fail("Cannot execute query within 60s");
+ }
+ continue;
+ }
+ RowRecord rowRecord = resultSet.next();
+ Assert.assertEquals("2.0", rowRecord.getField(0).getStringValue());
+ Assert.assertEquals("1.0", rowRecord.getField(1).getStringValue());
+ break;
+ }
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
index ee0ee073c96..963f0d1f036 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
@@ -84,7 +84,7 @@ public class GrafanaApiServiceIT {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
@@ -95,7 +95,7 @@ public class GrafanaApiServiceIT {
HttpGet httpGet = new HttpGet("http://127.0.0.1:" + port + "/grafana/v1/login");
CloseableHttpResponse response = null;
try {
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpGet.setHeader("Authorization", authorization);
for (int i = 0; i < 30; i++) {
try {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java
index 6bcbc762fc5..647303ad7e2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java
@@ -482,7 +482,7 @@ public class IoTDBEncodingIT {
}
}
- ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES");
+ ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES root.db1.**");
while (resultSet.next()) {
seriesCnt--;
@@ -518,7 +518,7 @@ public class IoTDBEncodingIT {
}
}
- ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES");
+ ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES root.db1.**");
assertFalse(resultSet.next());
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
index be8ddabeb2c..91bf6462033 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
@@ -56,7 +56,7 @@ public class IoTDBExampleIT {
Statement statement = connection.createStatement()) {
statement.execute("CREATE DATABASE root.sg");
- try (ResultSet resultSet = statement.executeQuery("show databases")) {
+ try (ResultSet resultSet = statement.executeQuery("show databases root.sg")) {
if (resultSet.next()) {
String storageGroupPath = resultSet.getString(ColumnHeaderConstant.DATABASE);
Assert.assertEquals("root.sg", storageGroupPath);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
index 3a73be3adb3..4fd8c2dee4e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
@@ -108,7 +108,7 @@ public class IoTDBFloatPrecisionIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
int cnt;
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.vehicle.**")) {
assertNotNull(resultSet);
cnt = 0;
while (resultSet.next()) {
@@ -137,7 +137,7 @@ public class IoTDBFloatPrecisionIT {
}
statement.execute("flush");
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.vehicle.**")) {
cnt = 0;
while (resultSet.next()) {
assertEquals(TIMESTAMP + "", resultSet.getString(TIMESTAMP_STR));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java
index 3eb48614513..ae039b792b1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java
@@ -91,7 +91,7 @@ public class IoTDBFlushQueryIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.**"); ) {
+ try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.vehicle.**"); ) {
int cnt = 0;
while (resultSet.next()) {
cnt++;
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java
index a5032580f22..a5978558751 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java
@@ -470,7 +470,7 @@ public class IoTDBInsertWithQueryIT {
// test count
private void selectAndCount(int res) {
- String selectSql = "select * from root.**";
+ String selectSql = "select * from root.fans.**";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -496,7 +496,7 @@ public class IoTDBInsertWithQueryIT {
// test order
private void select() {
- String selectSql = "select * from root.**";
+ String selectSql = "select * from root.fans.**";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
index d0f5eead050..9c9003c2bff 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
@@ -84,6 +84,7 @@ public class IoTDBLoadTsFileIT {
public void setUp() throws Exception {
tmpDir = new File(Files.createTempDirectory("load").toUri());
EnvFactory.getEnv().getConfig().getCommonConfig().setTimePartitionInterval(PARTITION_INTERVAL);
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv()
.getConfig()
.getDataNodeConfig()
@@ -234,7 +235,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -299,7 +300,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -389,7 +390,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -406,7 +407,7 @@ public class IoTDBLoadTsFileIT {
isAligned.put(SchemaConfig.DEVICE_2, "false");
isAligned.put(SchemaConfig.DEVICE_3, "false");
isAligned.put(SchemaConfig.DEVICE_4, "true");
- try (final ResultSet resultSet = statement.executeQuery("show devices")) {
+ try (final ResultSet resultSet = statement.executeQuery("show devices root.sg.**")) {
int size = 0;
while (resultSet.next()) {
size += 1;
@@ -424,7 +425,7 @@ public class IoTDBLoadTsFileIT {
@Test
public void testAuth() throws Exception {
- createUser("test", "test123");
+ createUser("test", "test123123456");
// device 0, device 1, sg 0
try (final TsFileGenerator generator =
@@ -473,7 +474,7 @@ public class IoTDBLoadTsFileIT {
String.format("load \"%s\" sgLevel=2", tmpDir.getAbsolutePath()),
"No permissions for this operation, please add privilege WRITE_DATA",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.WRITE_DATA, "root.**");
@@ -481,7 +482,7 @@ public class IoTDBLoadTsFileIT {
String.format("load \"%s\" sgLevel=2", tmpDir.getAbsolutePath()),
"No permissions for this operation, please add privilege MANAGE_DATABASE",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.MANAGE_DATABASE);
@@ -489,12 +490,12 @@ public class IoTDBLoadTsFileIT {
String.format("load \"%s\" sgLevel=2", tmpDir.getAbsolutePath()),
"Auto create or verify schema error when executing statement LoadTsFileStatement",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.WRITE_SCHEMA);
executeNonQuery(
- String.format("load \"%s\" sgLevel=2", tmpDir.getAbsolutePath()), "test", "test123");
+ String.format("load \"%s\" sgLevel=2", tmpDir.getAbsolutePath()), "test", "test123123456");
}
@Test
@@ -555,7 +556,7 @@ public class IoTDBLoadTsFileIT {
file1.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -575,7 +576,7 @@ public class IoTDBLoadTsFileIT {
file2.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -644,7 +645,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -720,7 +721,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -742,7 +743,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\"", tmpDir.getAbsolutePath()));
- try (final ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (final ResultSet resultSet = statement.executeQuery("show timeseries root.sg")) {
Assert.assertFalse(resultSet.next());
}
}
@@ -810,7 +811,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
@@ -854,7 +855,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" ", file.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.** group by level=1,2")) {
+ statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
if (resultSet.next()) {
final long sgCount = resultSet.getLong("count(root.sg.test_0.*.*)");
Assert.assertEquals(writtenPoint, sgCount);
@@ -913,7 +914,7 @@ public class IoTDBLoadTsFileIT {
// Prepare normal user
try (final Connection adminCon = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
final Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("create user test 'password'");
+ adminStmt.execute("create user test 'password123456'");
adminStmt.execute(
String.format(
"grant create, insert on %s.%s to user test",
@@ -924,7 +925,7 @@ public class IoTDBLoadTsFileIT {
}
try (final Connection connection =
- EnvFactory.getEnv().getConnection("test", "password", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv().getConnection("test", "password123456", BaseEnv.TABLE_SQL_DIALECT);
final Statement statement = connection.createStatement()) {
statement.execute(String.format("use %s", SchemaConfig.DATABASE_0));
statement.execute(String.format("load '%s'", file.getAbsolutePath()));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java
index 0910a14dfbb..d751b71778e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java
@@ -202,7 +202,7 @@ public class IoTDBMultiDeviceIT {
}
private void testSelectAll() {
- String selectSql = "select * from root.**";
+ String selectSql = "select * from root.fans.**,root.car.**";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -226,7 +226,7 @@ public class IoTDBMultiDeviceIT {
}
private void testSelectAfterDelete() {
- String selectSql = "select * from root.**";
+ String selectSql = "select * from root.fans.**,root.car.**";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
index 42dd2587881..49997268e0c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
@@ -68,6 +68,7 @@ public class IoTDBRestServiceIT {
public void setUp() throws Exception {
BaseEnv baseEnv = EnvFactory.getEnv();
baseEnv.getConfig().getDataNodeConfig().setEnableRestService(true);
+ baseEnv.getConfig().getCommonConfig().setEnforceStrongPassword(false);
baseEnv.initClusterEnvironment();
DataNodeWrapper portConflictDataNodeWrapper = EnvFactory.getEnv().getDataNodeWrapper(0);
port = portConflictDataNodeWrapper.getRestServicePort();
@@ -132,7 +133,7 @@ public class IoTDBRestServiceIT {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root", "root");
+ String authorization = getAuthorization("root", "IoTDB@2011");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
@@ -141,7 +142,7 @@ public class IoTDBRestServiceIT {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
- String authorization = getAuthorization("root1", "root1");
+ String authorization = getAuthorization("root1", "rooT@11234567");
httpPost.setHeader("Authorization", authorization);
return httpPost;
}
@@ -378,7 +379,7 @@ public class IoTDBRestServiceIT {
HttpPost httpPost2 = getHttpPost("http://127.0.0.1:" + port + "/rest/v1/nonQuery");
HttpPost httpPostV2 = getHttpPost("http://127.0.0.1:" + port + "/rest/v2/nonQuery");
- nonQuery(httpClient, "{\"sql\":\"CREATE USER `root1` 'root1'\"}", httpPost2);
+ nonQuery(httpClient, "{\"sql\":\"CREATE USER `root1` 'rooT@11234567'\"}", httpPost2);
nonQuery(httpClient, "{\"sql\":\"GRANT WRITE ON root.** to user root1\"}", httpPostV2);
}
@@ -1007,7 +1008,7 @@ public class IoTDBRestServiceIT {
}
public void queryShowChildPaths(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show child paths root\"}";
+ String sql = "{\"sql\":\"show child paths root.sg25\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1022,7 +1023,12 @@ public class IoTDBRestServiceIT {
List<Object> values1 =
new ArrayList<Object>() {
{
- add("root.sg25");
+ add("root.sg25.s3");
+ add("root.sg25.s4");
+ add("root.sg25.s5");
+ add("root.sg25.s6");
+ add("root.sg25.s7");
+ add("root.sg25.s8");
}
};
@@ -1031,7 +1037,7 @@ public class IoTDBRestServiceIT {
}
public void queryShowNodes(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show child nodes root\"}";
+ String sql = "{\"sql\":\"show child nodes root.sg25\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1045,7 +1051,12 @@ public class IoTDBRestServiceIT {
List<Object> values1 =
new ArrayList<Object>() {
{
- add("sg25");
+ add("s3");
+ add("s4");
+ add("s5");
+ add("s6");
+ add("s7");
+ add("s8");
}
};
@@ -1084,7 +1095,7 @@ public class IoTDBRestServiceIT {
}
public void showStorageGroup(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"SHOW DATABASES root.*\"}";
+ String sql = "{\"sql\":\"SHOW DATABASES root.sg25\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1119,7 +1130,7 @@ public class IoTDBRestServiceIT {
}
public void showTimeseries(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show timeseries\"}";
+ String sql = "{\"sql\":\"show timeseries root.sg25.**\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1181,7 +1192,7 @@ public class IoTDBRestServiceIT {
}
public void showLastTimeseries(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"SHOW LATEST TIMESERIES\"}";
+ String sql = "{\"sql\":\"SHOW LATEST TIMESERIES root.sg25.**\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1243,7 +1254,7 @@ public class IoTDBRestServiceIT {
}
public void countTimeseries(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"COUNT TIMESERIES root.** GROUP BY LEVEL=1\"}";
+ String sql = "{\"sql\":\"COUNT TIMESERIES root.sg25.** GROUP BY LEVEL=1\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1274,7 +1285,7 @@ public class IoTDBRestServiceIT {
}
public void countNodes(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"count nodes root.** level=2\"}";
+ String sql = "{\"sql\":\"count nodes root.sg25.** level=2\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1296,7 +1307,7 @@ public class IoTDBRestServiceIT {
}
public void showDevices(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show devices\"}";
+ String sql = "{\"sql\":\"show devices root.sg25\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("columnNames");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1373,10 +1384,10 @@ public class IoTDBRestServiceIT {
}
};
Assert.assertEquals(columnNames, columnNamesResult);
- Assert.assertEquals(values1, valuesResult.get(0));
- Assert.assertEquals(values2, valuesResult.get(1));
- Assert.assertEquals(values3, valuesResult.get(2));
- Assert.assertEquals(values4, valuesResult.get(3));
+ Assert.assertTrue(valuesResult.get(0).containsAll(values1));
+ Assert.assertTrue(valuesResult.get(1).containsAll(values2));
+ Assert.assertTrue(valuesResult.get(2).containsAll(values3));
+ Assert.assertTrue(valuesResult.get(3).containsAll(values4));
}
public void listUser(CloseableHttpClient httpClient) {
@@ -1402,7 +1413,7 @@ public class IoTDBRestServiceIT {
}
public void selectCount(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"select count(s3) from root.** group by level = 1\"}";
+ String sql = "{\"sql\":\"select count(s3) from root.sg25 group by level = 1\"}";
Map map = queryMetaData(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("expressions");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1659,7 +1670,7 @@ public class IoTDBRestServiceIT {
}
public void queryShowChildPathsV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show child paths root\"}";
+ String sql = "{\"sql\":\"show child paths root.sg25\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1674,7 +1685,12 @@ public class IoTDBRestServiceIT {
List<Object> values1 =
new ArrayList<Object>() {
{
- add("root.sg25");
+ add("root.sg25.s3");
+ add("root.sg25.s4");
+ add("root.sg25.s5");
+ add("root.sg25.s6");
+ add("root.sg25.s7");
+ add("root.sg25.s8");
}
};
@@ -1683,7 +1699,7 @@ public class IoTDBRestServiceIT {
}
public void queryShowNodesV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show child nodes root\"}";
+ String sql = "{\"sql\":\"show child nodes root.sg25\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1697,7 +1713,12 @@ public class IoTDBRestServiceIT {
List<Object> values1 =
new ArrayList<Object>() {
{
- add("sg25");
+ add("s3");
+ add("s4");
+ add("s5");
+ add("s6");
+ add("s7");
+ add("s8");
}
};
@@ -1736,7 +1757,7 @@ public class IoTDBRestServiceIT {
}
public void showStorageGroupV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"SHOW DATABASES root.*\"}";
+ String sql = "{\"sql\":\"SHOW DATABASES root.sg25\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1833,7 +1854,7 @@ public class IoTDBRestServiceIT {
}
public void showLastTimeseriesV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"SHOW LATEST TIMESERIES\"}";
+ String sql = "{\"sql\":\"SHOW LATEST TIMESERIES root.sg25.**\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1895,7 +1916,7 @@ public class IoTDBRestServiceIT {
}
public void countTimeseriesV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"COUNT TIMESERIES root.** GROUP BY LEVEL=1\"}";
+ String sql = "{\"sql\":\"COUNT TIMESERIES root.sg25.** GROUP BY LEVEL=1\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1926,7 +1947,7 @@ public class IoTDBRestServiceIT {
}
public void countNodesV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"count nodes root.** level=2\"}";
+ String sql = "{\"sql\":\"count nodes root.sg25.** level=2\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -1948,7 +1969,7 @@ public class IoTDBRestServiceIT {
}
public void showDevicesV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"show devices\"}";
+ String sql = "{\"sql\":\"show devices root.sg25\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("column_names");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
@@ -2026,10 +2047,10 @@ public class IoTDBRestServiceIT {
}
};
Assert.assertEquals(columnNames, columnNamesResult);
- Assert.assertEquals(values1, valuesResult.get(0));
- Assert.assertEquals(values2, valuesResult.get(1));
- Assert.assertEquals(values3, valuesResult.get(2));
- Assert.assertEquals(values4, valuesResult.get(3));
+ assertTrue(valuesResult.get(0).containsAll(values1));
+ assertTrue(valuesResult.get(1).containsAll(values2));
+ assertTrue(valuesResult.get(2).containsAll(values3));
+ assertTrue(valuesResult.get(3).containsAll(values4));
}
public void listUserV2(CloseableHttpClient httpClient) {
@@ -2055,7 +2076,7 @@ public class IoTDBRestServiceIT {
}
public void selectCountV2(CloseableHttpClient httpClient) {
- String sql = "{\"sql\":\"select count(s3) from root.** group by level = 1\"}";
+ String sql = "{\"sql\":\"select count(s3) from root.sg25 group by level = 1\"}";
Map map = queryMetaDataV2(httpClient, sql);
List<String> columnNamesResult = (List<String>) map.get("expressions");
List<List<Object>> valuesResult = (List<List<Object>>) map.get("values");
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
index 14d298e31bd..8e2728be485 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
@@ -263,7 +263,7 @@ public class IoTDBRestartIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.turbine1.**")) {
assertNotNull(resultSet);
int cnt = 0;
assertEquals(3, resultSet.getMetaData().getColumnCount());
@@ -291,7 +291,7 @@ public class IoTDBRestartIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.turbine1.**")) {
assertNotNull(resultSet);
int cnt = 0;
assertEquals(2, resultSet.getMetaData().getColumnCount());
@@ -358,7 +358,7 @@ public class IoTDBRestartIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.turbine1.**")) {
assertNotNull(resultSet);
int cnt = 0;
while (resultSet.next()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartRatisIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartRatisIT.java
index d871df91def..22f5234ee92 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartRatisIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartRatisIT.java
@@ -261,7 +261,7 @@ public class IoTDBRestartRatisIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.turbine1.**")) {
assertNotNull(resultSet);
int cnt = 0;
assertEquals(3, resultSet.getMetaData().getColumnCount());
@@ -289,7 +289,7 @@ public class IoTDBRestartRatisIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.turbine1.**")) {
assertNotNull(resultSet);
int cnt = 0;
assertEquals(2, resultSet.getMetaData().getColumnCount());
@@ -356,7 +356,7 @@ public class IoTDBRestartRatisIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.turbine1.**")) {
assertNotNull(resultSet);
int cnt = 0;
while (resultSet.next()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java
index 21c1f5ae95b..b9732b70222 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java
@@ -96,7 +96,7 @@ public class IoTDBSameMeasurementsDifferentTypesIT {
"1,1,1", "2,2,2", "3,3,3", "4,4,4", "5,5,0", "6,6,1", "7,7,2", "8,8,3", "9,9,4"
};
- String selectSql = "select * from root.**";
+ String selectSql = "select * from root.fans.**";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement1 = connection.createStatement();
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java
index d8bf5466865..f5d3d12c981 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java
@@ -155,7 +155,7 @@ public class IoTDBSetConfigurationIT {
// legal value
statement.execute("set configuration \"default_storage_group_level\"=\"3\"");
statement.execute("INSERT INTO root.a.b.c.d1(timestamp, s1) VALUES (1, 1)");
- ResultSet databases = statement.executeQuery("show databases");
+ ResultSet databases = statement.executeQuery("show databases root.a.**");
databases.next();
Assert.assertEquals("root.a.b.c", databases.getString(1));
assertFalse(databases.next());
@@ -193,7 +193,7 @@ public class IoTDBSetConfigurationIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("INSERT INTO root.a.b.c.d1(timestamp, s1) VALUES (1, 1)");
- ResultSet databases = statement.executeQuery("show databases");
+ ResultSet databases = statement.executeQuery("show databases root.a");
databases.next();
// the default value should take effect
Assert.assertEquals("root.a", databases.getString(1));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
index dfc6a83cbbc..19ca146e2e6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
@@ -104,7 +104,7 @@ public class IoTDBSimpleQueryIT {
}
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.sg1.**")) {
while (resultSet.next()) {
count++;
}
@@ -131,7 +131,7 @@ public class IoTDBSimpleQueryIT {
List<String> expected = Arrays.asList("root.turbine.d1.s1", "root.turbine.d1.s2");
List<String> actual = new ArrayList<>();
- try (ResultSet resultSet = statement.executeQuery("select last ** from root")) {
+ try (ResultSet resultSet = statement.executeQuery("select last ** from root.turbine")) {
while (resultSet.next()) {
actual.add(resultSet.getString(ColumnHeaderConstant.TIMESERIES));
}
@@ -140,7 +140,7 @@ public class IoTDBSimpleQueryIT {
assertEquals(expected, actual);
actual.clear();
- try (ResultSet resultSet = statement.executeQuery("select last * from root")) {
+ try (ResultSet resultSet = statement.executeQuery("select last * from root.turbine")) {
while (resultSet.next()) {
actual.add(resultSet.getString(ColumnHeaderConstant.TIMESERIES));
}
@@ -221,7 +221,7 @@ public class IoTDBSimpleQueryIT {
statement.execute(sql);
statement.execute("flush");
- ResultSet resultSet = statement.executeQuery("select * from root.**");
+ ResultSet resultSet = statement.executeQuery("select * from root.sg1.**");
int count = 0;
String[] timestamps = {"1", "7", "15", "16", "17", "18"};
@@ -264,7 +264,7 @@ public class IoTDBSimpleQueryIT {
statement.execute(sql);
statement.execute("flush");
- ResultSet resultSet = statement.executeQuery("select * from root.**");
+ ResultSet resultSet = statement.executeQuery("select * from root.sg1.**");
int count = 0;
// will not store time = 16 since time distance to last stored time 15 is within compMinTime
@@ -298,7 +298,7 @@ public class IoTDBSimpleQueryIT {
}
statement.execute("flush");
- ResultSet resultSet = statement.executeQuery("select * from root.**");
+ ResultSet resultSet = statement.executeQuery("select * from root.sg1.**");
int count = 0;
String[] timestamps = {"1", "21", "41", "49"};
@@ -449,7 +449,7 @@ public class IoTDBSimpleQueryIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- ResultSet resultSet = statement.executeQuery("select * from root.**");
+ ResultSet resultSet = statement.executeQuery("select * from root.sg1.**");
// has an empty time column
Assert.assertEquals(1, resultSet.getMetaData().getColumnCount());
try {
@@ -473,7 +473,7 @@ public class IoTDBSimpleQueryIT {
fail();
}
- resultSet = statement.executeQuery("select * from root.** align by device");
+ resultSet = statement.executeQuery("select * from root.sg1.** align by device");
// has time and device columns
Assert.assertEquals(1, resultSet.getMetaData().getColumnCount());
while (resultSet.next()) {
@@ -527,7 +527,7 @@ public class IoTDBSimpleQueryIT {
int cur = 0;
try (ResultSet resultSet =
- statement.executeQuery("select * from root.** order by time desc")) {
+ statement.executeQuery("select * from root.sg1.** order by time desc")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIME)
@@ -562,7 +562,7 @@ public class IoTDBSimpleQueryIT {
statement.execute("flush");
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.sg1.**")) {
while (resultSet.next()) {
count++;
}
@@ -595,7 +595,7 @@ public class IoTDBSimpleQueryIT {
statement.execute("flush");
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.sg1.**")) {
while (resultSet.next()) {
count++;
}
@@ -628,7 +628,7 @@ public class IoTDBSimpleQueryIT {
statement.execute("flush");
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.sg1.**")) {
while (resultSet.next()) {
count++;
}
@@ -877,7 +877,7 @@ public class IoTDBSimpleQueryIT {
long count = 0;
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.sg1.**")) {
while (resultSet.next()) {
count++;
}
@@ -1051,7 +1051,8 @@ public class IoTDBSimpleQueryIT {
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
- try (final ResultSet resultSet = statement.executeQuery("SHOW DATABASES DETAILS")) {
+ try (final ResultSet resultSet =
+ statement.executeQuery("SHOW DATABASES DETAILS root.group_with_hyphen")) {
while (resultSet.next()) {
Assert.assertEquals("root.group_with_hyphen", resultSet.getString(1));
}
@@ -1149,7 +1150,7 @@ public class IoTDBSimpleQueryIT {
i, LocalDate.of(2024, 5, i % 31 + 1), i, "X'cafebabe'", i));
}
- try (ResultSet resultSet = statement.executeQuery("select * from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select * from root.sg1.**")) {
final ResultSetMetaData metaData = resultSet.getMetaData();
final int columnCount = metaData.getColumnCount();
assertEquals(5, columnCount);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
index 57074cb13aa..8be33862554 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
@@ -47,6 +47,7 @@ import static org.junit.Assert.fail;
public class IoTDBSyntaxConventionIdentifierIT {
@Before
public void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
}
@@ -115,7 +116,7 @@ public class IoTDBSyntaxConventionIdentifierIT {
statement.execute(insertSql);
}
- try (ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES root.sg1.**")) {
Set<String> expectedResult = new HashSet<>(Arrays.asList(resultTimeseries));
while (resultSet.next()) {
@@ -273,7 +274,7 @@ public class IoTDBSyntaxConventionIdentifierIT {
statement.execute(insertSql);
}
- try (ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES root.sg1.**")) {
Set<String> expectedResult = new HashSet<>(Arrays.asList(resultTimeseries));
while (resultSet.next()) {
@@ -609,7 +610,7 @@ public class IoTDBSyntaxConventionIdentifierIT {
String[] resultNames =
new String[] {"root", "userid", "userid0", "user_id", "user0id", "a22233"};
- String createUsersSql = "create user %s 'pwd123' ";
+ String createUsersSql = "create user %s 'pwd123123456' ";
for (String userName : userNames) {
statement.execute(String.format(createUsersSql, userName));
}
@@ -630,31 +631,31 @@ public class IoTDBSyntaxConventionIdentifierIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
try {
- statement.execute("create user `abcd`` 'pwd123'");
+ statement.execute("create user `abcd`` 'pwd123123456'");
fail();
} catch (Exception ignored) {
}
try {
- statement.execute("create user `abcd 'pwd123'");
+ statement.execute("create user `abcd 'pwd123123456'");
fail();
} catch (Exception ignored) {
}
try {
- statement.execute("create user 12345 'pwd123'");
+ statement.execute("create user 12345 'pwd123123456'");
fail();
} catch (Exception ignored) {
}
try {
- statement.execute("create user a.b.c 'pwd123'");
+ statement.execute("create user a.b.c 'pwd123123456'");
fail();
} catch (Exception ignored) {
}
try {
- statement.execute("create user a!@bc 'pwd123'");
+ statement.execute("create user a!@bc 'pwd123123456'");
fail();
} catch (Exception ignored) {
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java
index 8de2d3c7e00..6da6a3b1803 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java
@@ -51,6 +51,7 @@ public class IoTDBSyntaxConventionStringLiteralIT {
@Before
public void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
}
@@ -283,12 +284,12 @@ public class IoTDBSyntaxConventionStringLiteralIT {
String errorMsg =
TSStatusCode.SQL_PARSE_ERROR.getStatusCode()
+ ": Error occurred while parsing SQL to physical plan: "
- + "line 1:18 mismatched input 'test' expecting STRING_LITERAL";
+ + "line 1:18 mismatched input 'test123456789' expecting STRING_LITERAL";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- statement.execute("CREATE USER test1 'test'");
+ statement.execute("CREATE USER test1 'test123456789'");
// password should be STRING_LITERAL
- statement.execute("CREATE USER test1 test");
+ statement.execute("CREATE USER test1 test123456789");
fail();
} catch (SQLException e) {
Assert.assertEquals(errorMsg, e.getMessage());
@@ -297,12 +298,12 @@ public class IoTDBSyntaxConventionStringLiteralIT {
String errorMsg1 =
TSStatusCode.SQL_PARSE_ERROR.getStatusCode()
+ ": Error occurred while parsing SQL to physical plan: "
- + "line 1:17 mismatched input '`test`' expecting STRING_LITERAL";
+ + "line 1:17 mismatched input '`test123456789`' expecting STRING_LITERAL";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- statement.execute("CREATE USER test \"test\"");
+ statement.execute("CREATE USER test \"test123456789\"");
// password should be STRING_LITERAL
- statement.execute("CREATE USER test `test`");
+ statement.execute("CREATE USER test `test123456789`");
fail();
} catch (SQLException e) {
Assert.assertEquals(errorMsg1, e.getMessage());
@@ -422,7 +423,7 @@ public class IoTDBSyntaxConventionStringLiteralIT {
statement.execute(
"create timeseries root.vehicle.d1.s6 "
+ "with datatype=INT64, encoding=PLAIN, compression=SNAPPY, `max_point_number` = `5`");
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.vehicle.**")) {
int cnt = 0;
while (resultSet.next()) {
cnt++;
@@ -471,7 +472,7 @@ public class IoTDBSyntaxConventionStringLiteralIT {
"create timeseries root.vehicle.d1.s8 "
+ "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+ "tags(tag1=v1)");
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.vehicle.**")) {
int cnt = 0;
while (resultSet.next()) {
cnt++;
@@ -505,7 +506,7 @@ public class IoTDBSyntaxConventionStringLiteralIT {
"create timeseries root.vehicle.d1.s4 "
+ "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+ "attributes('attr1'=v1, attr2=v2)");
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.vehicle.**")) {
int cnt = 0;
while (resultSet.next()) {
cnt++;
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java
index 6db3845a586..f27e833761c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java
@@ -126,7 +126,7 @@ public class IoTDBTimeZoneIT {
statement.execute(String.format(insertSQLTemplate, "2018-1-1T13:00:09+08:00", "12"));
statement.execute(String.format(insertSQLTemplate, "2018-1-1T12:00:10+07:00", "13"));
- ResultSet resultSet = statement.executeQuery("select * from root.**");
+ ResultSet resultSet = statement.executeQuery("select * from root.timezone");
int cnt = 0;
try {
while (resultSet.next()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java
index 19c76c7c4f2..222988de43d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java
@@ -685,7 +685,7 @@ public class IoTDBAggregationByLevelIT {
try (ResultSet resultSet =
statement.executeQuery(
- "select count(status),count(status) from root.** GROUP BY level=0")) {
+ "select count(status),count(status) from root.sg*.** GROUP BY level=0")) {
ResultSetMetaData metaData = resultSet.getMetaData();
Assert.assertEquals(metaData.getColumnName(1), metaData.getColumnName(2));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java
index 7ed236411df..9c4e5ddae1d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java
@@ -671,7 +671,7 @@ public class IoTDBAggregationSmallDataIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.vehicle.**")) {
int cnt = 0;
while (resultSet.next()) {
String ans =
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTimeDurationIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTimeDurationIT.java
index 056797e204a..75743994b20 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTimeDurationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTimeDurationIT.java
@@ -160,7 +160,7 @@ public class IoTDBTimeDurationIT {
expectedHeader = new String[] {"time_duration(root.db1.*.s1),time_duration(root.db.*.s1)"};
retArray = new String[] {"8,8,"};
resultSetEqualTest(
- "select time_duration(s1) from root.** where time < 10 group by level=1",
+ "select time_duration(s1) from root.db1.**,root.db.** where time < 10 group by level=1",
expectedHeader,
retArray);
@@ -224,23 +224,25 @@ public class IoTDBTimeDurationIT {
"1677570931,1677570938,1677570933,1677570933,1677570932,1677570938,1677570933,1677570933,"
};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.**", expectedHeader, retArray);
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.**",
+ expectedHeader,
+ retArray);
// order by time desc
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** order by time desc",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** order by time desc",
expectedHeader,
retArray);
// order by time asc
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** order by time asc",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** order by time asc",
expectedHeader,
retArray);
// limit
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** limit 3",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** limit 3",
expectedHeader,
retArray);
@@ -254,7 +256,7 @@ public class IoTDBTimeDurationIT {
"root.db1.d2,1677570938,1677570938,"
};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** align by device",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** align by device",
expectedHeader,
retArray);
@@ -268,7 +270,7 @@ public class IoTDBTimeDurationIT {
"1677570931,1677570938,1677570933,1677570933,1677570932,1677570938,1677570933,1677570933,"
};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** align by time",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** align by time",
expectedHeader,
retArray);
@@ -279,7 +281,7 @@ public class IoTDBTimeDurationIT {
};
retArray = new String[] {"1677570938,1677570933,1677570938,1677570933,"};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** group by level=1",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** group by level=1",
expectedHeader,
retArray);
@@ -302,7 +304,7 @@ public class IoTDBTimeDurationIT {
retArray = new String[] {"1,7,9,9,9,8,9,9,9,", "1677570934,0,0,0,0,0,0,0,0,"};
// ignore = true
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** group by session(100ms)",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** group by session(100ms)",
expectedHeader,
retArray);
@@ -324,7 +326,7 @@ public class IoTDBTimeDurationIT {
"1677570934,0,null,0,0,0,null,0,0,"
};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** group by variation(root.db.d1.s1)",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** group by variation(root.db.d1.s1)",
expectedHeader,
retArray);
@@ -336,7 +338,7 @@ public class IoTDBTimeDurationIT {
retArray =
new String[] {"1,1677570931,9,1677570933,1677570933,1677570931,9,1677570933,1677570933,"};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** group by condition(root.db.d2.s1 > 10,KEEP>=1,ignoreNull=true)",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** group by condition(root.db.d2.s1 > 10,KEEP>=1,ignoreNull=true)",
expectedHeader,
retArray);
@@ -344,7 +346,9 @@ public class IoTDBTimeDurationIT {
expectedHeader = new String[] {"city", "time_duration(s1)"};
retArray = new String[] {"Beijing,1677570933,", "Nanjing,1677570938,"};
resultSetEqualTest(
- "select time_duration(s1) from root.** group by tags(city)", expectedHeader, retArray);
+ "select time_duration(s1) from root.db1.**,root.db.** group by tags(city)",
+ expectedHeader,
+ retArray);
// group by time
expectedHeader =
@@ -353,7 +357,7 @@ public class IoTDBTimeDurationIT {
};
retArray = new String[] {"1,1,3,3,3,3,4,4,4,", "6,3,2,3,3,3,3,3,3,"};
resultSetEqualTest(
- "select time_duration(s1),time_duration(s2) from root.** group by time([1,10),5ms)",
+ "select time_duration(s1),time_duration(s2) from root.db1.**,root.db.** group by time([1,10),5ms)",
expectedHeader,
retArray);
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
index aee8215f284..1ac466653f6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
@@ -357,7 +357,7 @@ public class IoTDBInsertAlignedValuesIT {
Statement statement = connection.createStatement()) {
statement.execute("insert into root.sg_device(time, status) aligned values (4000, true)");
- try (ResultSet resultSet = statement.executeQuery("select ** from root")) {
+ try (ResultSet resultSet = statement.executeQuery("select ** from root.sg_device")) {
assertTrue(resultSet.next());
assertTrue(resultSet.getBoolean(2));
assertFalse(resultSet.next());
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java
index f88c47bbe2e..017ccdad7e8 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.it.auth;
import org.apache.iotdb.commons.auth.entity.PrivilegeType;
import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
+import org.apache.iotdb.commons.utils.AuthUtils;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
@@ -31,10 +32,7 @@ import org.apache.iotdb.jdbc.IoTDBSQLException;
import org.apache.iotdb.rpc.TSStatusCode;
import com.google.common.collect.ImmutableList;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.*;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
@@ -60,12 +58,14 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/** This is an example for integration test. */
+@SuppressWarnings("EmptyTryBlock")
@RunWith(IoTDBTestRunner.class)
@Category({LocalStandaloneIT.class, ClusterIT.class})
public class IoTDBAuthIT {
@Before
public void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
}
@@ -78,9 +78,9 @@ public class IoTDBAuthIT {
public void allPrivilegesTest() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
// 1. tempuser doesn't have any privilege
Assert.assertThrows(SQLException.class, () -> userStmt.execute("CREATE DATABASE root.a"));
@@ -165,7 +165,7 @@ public class IoTDBAuthIT {
() -> userStmt.execute("GRANT USER tempuser PRIVILEGES WRITE_SCHEMA ON root.a"));
adminStmt.execute("GRANT ALL ON root.** TO USER tempuser WITH GRANT OPTION");
- userStmt.execute("CREATE USER testuser 'password'");
+ userStmt.execute("CREATE USER testuser 'password123456'");
userStmt.execute("GRANT ALL ON root.** TO USER testuser WITH GRANT OPTION");
ResultSet dataSet = userStmt.executeQuery("LIST PRIVILEGES OF USER testuser");
@@ -195,9 +195,9 @@ public class IoTDBAuthIT {
public void testSetDeleteSG() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER sgtest 'sgtest'");
+ adminStmt.execute("CREATE USER sgtest 'sgtest123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("sgtest", "sgtest");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("sgtest", "sgtest123456");
Statement userStmt = userCon.createStatement()) {
Assert.assertThrows(
@@ -220,7 +220,7 @@ public class IoTDBAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
Assert.assertThrows(
- SQLException.class, () -> adminStmt.execute("CREATE USER tempuser 'temppw '"));
+ SQLException.class, () -> adminStmt.execute("CREATE USER tempuser 'temppw 123456'"));
}
try (Connection adminCon = EnvFactory.getEnv().getConnection();
@@ -233,15 +233,15 @@ public class IoTDBAuthIT {
public void updatePasswordTest() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
- Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
+ Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
userCon.close();
- adminStmt.execute("ALTER USER tempuser SET PASSWORD 'newpw'");
+ adminStmt.execute("ALTER USER tempuser SET PASSWORD 'newpw1234567'");
boolean caught = false;
try {
- userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw1234567");
} catch (SQLException e) {
caught = true;
} finally {
@@ -249,7 +249,7 @@ public class IoTDBAuthIT {
}
assertTrue(caught);
- userCon = EnvFactory.getEnv().getConnection("tempuser", "newpw");
+ userCon = EnvFactory.getEnv().getConnection("tempuser", "newpw1234567");
userCon.close();
}
@@ -259,9 +259,9 @@ public class IoTDBAuthIT {
public void illegalGrantRevokeUserTest() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
// grant a non-existing user
@@ -320,9 +320,9 @@ public class IoTDBAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
// grant and revoke the user the privilege to create time series
@@ -357,8 +357,8 @@ public class IoTDBAuthIT {
public void templateQueryTest() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
adminStmt.execute(
"GRANT READ_DATA ON root.sg.aligned_template.temperature TO USER tempuser");
@@ -386,9 +386,9 @@ public class IoTDBAuthIT {
public void insertQueryTest() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
adminStmt.execute("GRANT MANAGE_DATABASE ON root.** TO USER tempuser");
@@ -433,8 +433,8 @@ public class IoTDBAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
Assert.assertThrows(SQLException.class, () -> userStmt.execute("CREATE ROLE admin"));
@@ -454,7 +454,7 @@ public class IoTDBAuthIT {
userStmt.execute("CREATE TIMESERIES root.a.c WITH DATATYPE=INT32,ENCODING=PLAIN");
userStmt.execute("INSERT INTO root.a(timestamp,b,c) VALUES (1,100,1000)");
// userStmt.execute("DELETE FROM root.a.b WHERE TIME <= 1000000000");
- ResultSet resultSet = userStmt.executeQuery("SELECT * FROM root.**");
+ ResultSet resultSet = userStmt.executeQuery("SELECT * FROM root.a");
validateResultSet(resultSet, "1,100,1000,\n");
resultSet.close();
@@ -484,7 +484,7 @@ public class IoTDBAuthIT {
validateResultSet(resultSet, ans);
for (int i = 0; i < 10; i++) {
- adminStmt.execute("CREATE USER user" + i + " 'password" + i + "'");
+ adminStmt.execute("CREATE USER user" + i + " 'password" + i + "123456'");
}
resultSet = adminStmt.executeQuery("LIST USER");
ans =
@@ -568,8 +568,8 @@ public class IoTDBAuthIT {
Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement();
try {
- adminStmt.execute("CREATE USER user1 'password'");
- adminStmt.execute("CREATE USER user2 'password'");
+ adminStmt.execute("CREATE USER user1 'password123456'");
+ adminStmt.execute("CREATE USER user2 'password123456'");
adminStmt.execute("CREATE ROLE role1");
adminStmt.execute("CREATE ROLE role2");
adminStmt.execute("GRANT ROLE role1 TO user1");
@@ -581,7 +581,7 @@ public class IoTDBAuthIT {
// user2 : role1, role2;
ResultSet resultSet;
String ans;
- Connection userCon = EnvFactory.getEnv().getConnection("user1", "password");
+ Connection userCon = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement userStmt = userCon.createStatement();
try {
resultSet = userStmt.executeQuery("LIST ROLE OF USER user1");
@@ -598,7 +598,7 @@ public class IoTDBAuthIT {
userCon.close();
}
- Connection user2Con = EnvFactory.getEnv().getConnection("user2", "password");
+ Connection user2Con = EnvFactory.getEnv().getConnection("user2", "password123456");
Statement user2Stmt = user2Con.createStatement();
try {
Assert.assertThrows(SQLException.class, () -> user2Stmt.execute("LIST ROLE OF USER user1"));
@@ -622,7 +622,7 @@ public class IoTDBAuthIT {
Statement adminStmt = adminCon.createStatement();
try {
- adminStmt.execute("CREATE USER user1 'password1'");
+ adminStmt.execute("CREATE USER user1 'password123456'");
adminStmt.execute("GRANT READ_SCHEMA ON root.a.b TO USER user1");
adminStmt.execute("CREATE ROLE role1");
adminStmt.execute("GRANT READ_SCHEMA,WRITE_DATA ON root.a.b.c TO ROLE role1");
@@ -712,7 +712,7 @@ public class IoTDBAuthIT {
Statement adminStmt = adminCon.createStatement();
try {
- adminStmt.execute("CREATE USER chenduxiu 'orange'");
+ adminStmt.execute("CREATE USER chenduxiu 'orange123456'");
adminStmt.execute("CREATE ROLE xijing");
adminStmt.execute("CREATE ROLE dalao");
@@ -774,10 +774,10 @@ public class IoTDBAuthIT {
};
for (int i = 0; i < members.length - 1; i++) {
- adminStmt.execute("CREATE USER " + members[i] + " 'a666666'");
+ adminStmt.execute("CREATE USER " + members[i] + " 'a666666123456'");
adminStmt.execute("GRANT ROLE dalao TO " + members[i]);
}
- adminStmt.execute("CREATE USER RiverSky 'a2333333'");
+ adminStmt.execute("CREATE USER RiverSky 'a2333333123456'");
adminStmt.execute("GRANT ROLE zhazha TO RiverSky");
ResultSet resultSet = adminStmt.executeQuery("LIST USER OF ROLE dalao");
@@ -847,12 +847,12 @@ public class IoTDBAuthIT {
Statement adminStmt = adminCon.createStatement();
for (int i = 0; i < 10; i++) {
- adminStmt.execute("CREATE USER user" + i + " 'password" + i + "'");
+ adminStmt.execute("CREATE USER user" + i + " 'password" + i + "123456'");
}
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
try {
Assert.assertThrows(SQLException.class, () -> userStmt.execute("LIST USER"));
@@ -883,10 +883,10 @@ public class IoTDBAuthIT {
@Test
public void testExecuteBatchWithPrivilege() throws SQLException {
- try (Connection adminCon = EnvFactory.getEnv().getConnection("root", "root");
+ try (Connection adminCon = EnvFactory.getEnv().getConnection("root", "IoTDB@2011");
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStatement = userCon.createStatement()) {
userStatement.addBatch("CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT64");
userStatement.addBatch("CREATE TIMESERIES root.sg2.d1.s1 WITH DATATYPE=INT64");
@@ -899,12 +899,12 @@ public class IoTDBAuthIT {
public void testExecuteBatchWithPrivilege1() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
adminStmt.execute("GRANT WRITE_DATA on root.sg1.** TO USER tempuser");
adminStmt.execute("GRANT WRITE_SCHEMA on root.sg1.** TO USER tempuser");
adminStmt.execute("GRANT MANAGE_DATABASE on root.** TO USER tempuser");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStatement = userCon.createStatement()) {
userStatement.addBatch("insert into root.sg1.d1(timestamp,s1) values (1,1)");
userStatement.addBatch("insert into root.sg1.d1(timestamp,s2) values (3,1)");
@@ -937,7 +937,7 @@ public class IoTDBAuthIT {
public void testSelectUDTF() throws SQLException {
try (Connection adminConnection = EnvFactory.getEnv().getConnection();
Statement adminStatement = adminConnection.createStatement()) {
- adminStatement.execute("CREATE USER a_application 'a_application'");
+ adminStatement.execute("CREATE USER a_application 'a_application123456'");
adminStatement.execute("CREATE ROLE application_role");
adminStatement.execute("GRANT READ_DATA ON root.test.** TO ROLE application_role");
adminStatement.execute("GRANT ROLE application_role TO a_application");
@@ -946,7 +946,7 @@ public class IoTDBAuthIT {
}
try (Connection userConnection =
- EnvFactory.getEnv().getConnection("a_application", "a_application");
+ EnvFactory.getEnv().getConnection("a_application", "a_application123456");
Statement userStatement = userConnection.createStatement();
ResultSet resultSet =
userStatement.executeQuery(
@@ -960,15 +960,15 @@ public class IoTDBAuthIT {
public void testGrantUserRole() throws SQLException {
try (Connection adminConnection = EnvFactory.getEnv().getConnection();
Statement adminStatement = adminConnection.createStatement()) {
- adminStatement.execute("CREATE USER user01 'pass1234'");
- adminStatement.execute("CREATE USER user02 'pass1234'");
+ adminStatement.execute("CREATE USER user01 'pass1234123456'");
+ adminStatement.execute("CREATE USER user02 'pass1234123456'");
adminStatement.execute("CREATE ROLE manager");
adminStatement.execute("GRANT MANAGE_ROLE on root.** TO USER user01");
Assert.assertThrows(
SQLException.class, () -> adminStatement.execute("GRANT role manager to `root`"));
}
- try (Connection userCon = EnvFactory.getEnv().getConnection("user01", "pass1234");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user01", "pass1234123456");
Statement userStatement = userCon.createStatement()) {
try {
userStatement.execute("grant role manager to user02");
@@ -983,9 +983,9 @@ public class IoTDBAuthIT {
// 1. CREATE USER1, USER2, USER3, testRole
Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement();
- adminStmt.execute("CREATE USER user1 'password'");
- adminStmt.execute("CREATE USER user2 'password'");
- adminStmt.execute("CREATE USER user3 'password'");
+ adminStmt.execute("CREATE USER user1 'password123456'");
+ adminStmt.execute("CREATE USER user2 'password123456'");
+ adminStmt.execute("CREATE USER user3 'password123456'");
adminStmt.execute("CREATE ROLE testRole");
adminStmt.execute("GRANT manage_database ON root.** TO ROLE testRole WITH GRANT OPTION");
adminStmt.execute("GRANT READ_DATA ON root.t1.** TO ROLE testRole");
@@ -1049,7 +1049,7 @@ public class IoTDBAuthIT {
// 5. Login user1 to list user2 privileges will success
// user1 cannot grant any privilegs to user3
- try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement userStmt = userCon.createStatement()) {
try {
resultSet = userStmt.executeQuery("LIST PRIVILEGES OF USER user1");
@@ -1080,7 +1080,7 @@ public class IoTDBAuthIT {
}
}
// 6.Login user2 grant and revoke will success.
- try (Connection userCon = EnvFactory.getEnv().getConnection("user2", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user2", "password123456");
Statement userStmt = userCon.createStatement()) {
try {
resultSet = userStmt.executeQuery("LIST PRIVILEGES OF USER user1");
@@ -1118,7 +1118,7 @@ public class IoTDBAuthIT {
// 3. READ_DATA on root.t1.**
// 4. READ_SCHEMA on root.t3.t2.**
- try (Connection userCon = EnvFactory.getEnv().getConnection("user3", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user3", "password123456");
Statement userStmt = userCon.createStatement()) {
try {
// because role's privilege
@@ -1143,8 +1143,8 @@ public class IoTDBAuthIT {
// 1. revoke from user/role
Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement();
- adminStmt.execute("CREATE USER user1 'password'");
- adminStmt.execute("CREATE USER user2 'password'");
+ adminStmt.execute("CREATE USER user1 'password123456'");
+ adminStmt.execute("CREATE USER user2 'password123456'");
// 2. user1 has all privileges with grant option on root.**
// user2 has all privileges without grant option on root.**
@@ -1161,7 +1161,7 @@ public class IoTDBAuthIT {
sql = "GRANT %s on root.** to USER user2";
adminStmt.execute(String.format(sql, item));
}
- Connection user1Con = EnvFactory.getEnv().getConnection("user1", "password");
+ Connection user1Con = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement user1Stmt = user1Con.createStatement();
ResultSet resultSet;
String ans = "";
@@ -1195,7 +1195,7 @@ public class IoTDBAuthIT {
// 1. revoke from user/role
Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement();
- adminStmt.execute("CREATE USER user1 'password'");
+ adminStmt.execute("CREATE USER user1 'password123456'");
adminStmt.execute("GRANT READ_DATA ON root.sg.d1.** TO USER user1 with grant option;");
adminStmt.execute("GRANT READ_DATA ON root.sg.aligned_template.temperature TO USER user1;");
adminStmt.execute("CREATE DATABASE root.sg;");
@@ -1206,7 +1206,7 @@ public class IoTDBAuthIT {
adminStmt.execute("insert into root.sg.d2(time,s1,s2) values(1,1,1)");
adminStmt.execute(
"insert into root.sg.aligned_template(time,temperature,status) values(1,20,true)");
- try (ResultSet resultSet = adminStmt.executeQuery("select * from root.**;")) {
+ try (ResultSet resultSet = adminStmt.executeQuery("select * from root.sg.**;")) {
Set<String> standards =
new HashSet<>(
Arrays.asList(
@@ -1223,7 +1223,7 @@ public class IoTDBAuthIT {
}
Assert.assertTrue(standards.isEmpty());
}
- Connection user1Con = EnvFactory.getEnv().getConnection("user1", "password");
+ Connection user1Con = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement user1Stmt = user1Con.createStatement();
try (ResultSet resultSet = user1Stmt.executeQuery("select * from root.**;")) {
Set<String> standards =
@@ -1245,9 +1245,9 @@ public class IoTDBAuthIT {
public void insertWithTemplateTest() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser 'temppw'");
+ adminStmt.execute("CREATE USER tempuser 'temppw123456'");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456");
Statement userStmt = userCon.createStatement()) {
adminStmt.execute("CREATE DATABASE root.a");
@@ -1281,9 +1281,9 @@ public class IoTDBAuthIT {
Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement();
adminStmt.execute("create role head");
- adminStmt.execute("create user head 'password'");
+ adminStmt.execute("create user head 'password123456'");
adminStmt.execute("create role tail");
- adminStmt.execute("create user tail 'password'");
+ adminStmt.execute("create user tail 'password123456'");
}
@Test
@@ -1317,9 +1317,9 @@ public class IoTDBAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER Jack 'temppw'");
+ adminStmt.execute("CREATE USER Jack 'temppw123456'");
- try (Connection JackConnection = EnvFactory.getEnv().getConnection("Jack", "temppw");
+ try (Connection JackConnection = EnvFactory.getEnv().getConnection("Jack", "temppw123456");
Statement Jack = JackConnection.createStatement()) {
testClusterManagementSqlImpl(
clusterManagementSQLList,
@@ -1353,10 +1353,10 @@ public class IoTDBAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getTableConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER Jack 'temppw'");
+ adminStmt.execute("CREATE USER Jack 'temppw123456'");
try (Connection JackConnection =
- EnvFactory.getEnv().getConnection("Jack", "temppw", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv().getConnection("Jack", "temppw123456", BaseEnv.TABLE_SQL_DIALECT);
Statement Jack = JackConnection.createStatement()) {
// Jack has no authority to execute these SQLs
for (String sql : clusterManagementSQLList) {
@@ -1415,12 +1415,183 @@ public class IoTDBAuthIT {
@Test
public void noNeedPrivilegeTest() {
- createUser("tempuser", "temppw");
+ createUser("tempuser", "temppw123456");
String[] expectedHeader = new String[] {"CurrentUser"};
String[] retArray =
new String[] {
"tempuser,",
};
- resultSetEqualTest("show current_user", expectedHeader, retArray, "tempuser", "temppw");
+ resultSetEqualTest("show current_user", expectedHeader, retArray, "tempuser", "temppw123456");
+ }
+
+ @Ignore
+ @Test
+ public void testStrongPassword() throws SQLException {
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("SET CONFIGURATION 'enforce_strong_password'='true'");
+ } catch (SQLException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA 'NO_LOWER_CASE_123'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one lowercase letter.", e.getMessage());
+ }
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("alter user root set password 'NO_LOWER_CASE_123'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one lowercase letter.", e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA 'no_upper_case_123'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one uppercase letter.", e.getMessage());
+ }
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("alter user root set password 'no_upper_case_123'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one uppercase letter.", e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA 'noooooo_DIGIT'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals("820: Invalid password, must contain at least one digit.", e.getMessage());
+ }
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("alter user root set password 'noooooo_DIGIT'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals("820: Invalid password, must contain at least one digit.", e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA 'noSpecial123'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one special character.", e.getMessage());
+ }
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("alter user root set password 'noSpecial123'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one special character.", e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA '1234567891011'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one lowercase letter, one uppercase letter, one special character.",
+ e.getMessage());
+ }
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("alter user root set password '1234567891011'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals(
+ "820: Invalid password, must contain at least one lowercase letter, one uppercase letter, one special character.",
+ e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA123456789 'userA123456789'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals("820: Password cannot be the same as user name", e.getMessage());
+ }
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("alter user root set password 'root'");
+ fail();
+ } catch (SQLException e) {
+ assertEquals("820: Password cannot be the same as user name", e.getMessage());
+ }
+
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("create user userA 'strongPassword#1234'");
+
+ statement.execute("SET CONFIGURATION 'enforce_strong_password'='false'");
+
+ statement.execute("create user userB '123412345678'");
+ statement.execute("alter user root set password 'root12345678'");
+ }
+ }
+
+ @Test
+ public void testPasswordHistory() {
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ testPasswordHistoryCreate(statement);
+ testPasswordHistoryAlter(statement);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+ public void testPasswordHistoryCreate(Statement statement) throws SQLException {
+ statement.execute("create user userA 'abcdef123456'");
+
+ try (ResultSet resultSet =
+ statement.executeQuery(
+ "select last password from root.__system.password_history.`_userA`")) {
+ if (!resultSet.next()) {
+ fail("Password history not found");
+ }
+ assertEquals(AuthUtils.encryptPassword("abcdef123456"), resultSet.getString("Value"));
+ }
+ }
+
+ public void testPasswordHistoryAlter(Statement statement) throws SQLException {
+ statement.execute("alter user userA set password 'abcdef654321'");
+
+ try (ResultSet resultSet =
+ statement.executeQuery(
+ "select last password from root.__system.password_history.`_userA`")) {
+ if (!resultSet.next()) {
+ fail("Password history not found");
+ }
+ assertEquals(AuthUtils.encryptPassword("abcdef654321"), resultSet.getString("Value"));
+ }
+
+ try (ResultSet resultSet =
+ statement.executeQuery(
+ "select oldPassword from root.__system.password_history.`_userA` order by time desc limit 1")) {
+ if (!resultSet.next()) {
+ fail("Password history not found");
+ }
+ assertEquals(
+ AuthUtils.encryptPassword("abcdef123456"),
+ resultSet.getString("root.__system.password_history._userA.oldPassword"));
+ }
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityIT.java
index 6c13036b1e9..cbaa0690114 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityIT.java
@@ -62,6 +62,7 @@ public class IoTDBClusterAuthorityIT {
@Before
public void setUp() throws Exception {
// Init 1C1D environment
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment(1, 1);
}
@@ -145,7 +146,7 @@ public class IoTDBClusterAuthorityIT {
AuthorType.CREATE_USER.ordinal(),
"tempuser0",
"",
- "passwd",
+ "passwd123456",
"",
new HashSet<>(),
false,
@@ -257,7 +258,7 @@ public class IoTDBClusterAuthorityIT {
"tempuser0",
"",
"",
- "newpwd",
+ "newpwd123456",
new HashSet<>(),
false,
AuthUtils.serializePartialPathList(new ArrayList<>()));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityRelationalIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityRelationalIT.java
index 7d1eec7e72c..2b03fd20036 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityRelationalIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBClusterAuthorityRelationalIT.java
@@ -61,6 +61,7 @@ public class IoTDBClusterAuthorityRelationalIT {
@Before
public void setUp() throws Exception {
// Init 1C1D environment
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment(1, 1);
}
@@ -333,7 +334,7 @@ public class IoTDBClusterAuthorityRelationalIT {
try (SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
cleanUserAndRole(client);
- createUserORRoleAndCheck(client, "user1", true, "password");
+ createUserORRoleAndCheck(client, "user1", true, "password123456");
createUserORRoleAndCheck(client, "role1", false, "");
runAndCheck(
client,
@@ -378,7 +379,7 @@ public class IoTDBClusterAuthorityRelationalIT {
// "database2".* create(with grant option);
// check login
- TLoginReq req = new TLoginReq("user1", "password");
+ TLoginReq req = new TLoginReq("user1", "password123456");
expectSuccess(client.login(req));
// check user has role.
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java
index 91efa12273c..249368ac914 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java
@@ -49,6 +49,7 @@ import java.util.Set;
public class IoTDBRelationalAuthIT {
@Before
public void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
}
@@ -62,7 +63,7 @@ public class IoTDBRelationalAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("create user testuser 'password'");
+ adminStmt.execute("create user testuser 'password123456'");
adminStmt.execute("create database testdb");
adminStmt.execute("GRANT MANAGE_USER to user testuser");
Assert.assertThrows(
@@ -126,8 +127,8 @@ public class IoTDBRelationalAuthIT {
public void checkAuthorStatementPrivilegeCheck() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("create user testuser 'password'");
- adminStmt.execute("create user testuser2 'password'");
+ adminStmt.execute("create user testuser 'password123456'");
+ adminStmt.execute("create user testuser2 'password123456'");
adminStmt.execute("create role testrole");
adminStmt.execute("create database testdb");
@@ -177,7 +178,8 @@ public class IoTDBRelationalAuthIT {
}
try (Connection userCon1 =
- EnvFactory.getEnv().getConnection("testuser", "password", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv()
+ .getConnection("testuser", "password123456", BaseEnv.TABLE_SQL_DIALECT);
Statement userStmt = userCon1.createStatement()) {
// 1. user1's privileges
// testdb.TB select
@@ -248,7 +250,8 @@ public class IoTDBRelationalAuthIT {
}
try (Connection userCon1 =
- EnvFactory.getEnv().getConnection("testuser2", "password", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv()
+ .getConnection("testuser2", "password123456", BaseEnv.TABLE_SQL_DIALECT);
Statement userStmt = userCon1.createStatement()) {
// 2. user2's privileges
// MANAGE_USER with grant option
@@ -258,7 +261,7 @@ public class IoTDBRelationalAuthIT {
// any select with grant option
// can create user.
- userStmt.execute("CREATE USER testuser3 'password'");
+ userStmt.execute("CREATE USER testuser3 'password123456'");
// can not create role
Assert.assertThrows(
@@ -314,7 +317,7 @@ public class IoTDBRelationalAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
Statement adminStmt = adminCon.createStatement()) {
adminStmt.execute("create database testdb");
- adminStmt.execute(isUser ? "create user test 'password'" : "create role test");
+ adminStmt.execute(isUser ? "create user test 'password123456'" : "create role test");
adminStmt.execute("use testdb");
// 1. grant all on table tb1 with grant option
@@ -459,8 +462,8 @@ public class IoTDBRelationalAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("create user test 'password'");
- adminStmt.execute("create user test2 'password'");
+ adminStmt.execute("create user test 'password123456'");
+ adminStmt.execute("create user test2 'password123456'");
adminStmt.execute("grant all to user test");
adminStmt.execute("grant all to user test2 with grant option");
adminStmt.execute("revoke SELECT ON ANY from user test");
@@ -492,7 +495,7 @@ public class IoTDBRelationalAuthIT {
}
try (Connection userCon =
- EnvFactory.getEnv().getConnection("test", "password", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv().getConnection("test", "password123456", BaseEnv.TABLE_SQL_DIALECT);
Statement userConStatement = userCon.createStatement()) {
ResultSet resultSet = userConStatement.executeQuery("List privileges of user test");
TestUtils.assertResultSetEqual(
@@ -519,7 +522,8 @@ public class IoTDBRelationalAuthIT {
}
try (Connection userCon =
- EnvFactory.getEnv().getConnection("test2", "password", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv()
+ .getConnection("test2", "password123456", BaseEnv.TABLE_SQL_DIALECT);
Statement userConStatement = userCon.createStatement()) {
// user2 can grant all to user test
userConStatement.execute("GRANT ALL to user test");
@@ -535,7 +539,8 @@ public class IoTDBRelationalAuthIT {
}
try (Connection userCon =
- EnvFactory.getEnv().getConnection("test2", "password", BaseEnv.TABLE_SQL_DIALECT);
+ EnvFactory.getEnv()
+ .getConnection("test2", "password123456", BaseEnv.TABLE_SQL_DIALECT);
Statement userConStatement = userCon.createStatement()) {
// user2 can not grant all to user test
Assert.assertThrows(
@@ -581,9 +586,9 @@ public class IoTDBRelationalAuthIT {
try (Connection adminCon = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
Statement adminStmt = adminCon.createStatement()) {
// normal case
- adminStmt.execute("create user testuser 'password'");
+ adminStmt.execute("create user testuser 'password123456'");
// username abnormal
- adminStmt.execute("create user \"!@#$%^*()_+-=1\" 'password'");
+ adminStmt.execute("create user \"!@#$%^*()_+-=1\" 'password123456'");
// username and password abnormal
adminStmt.execute("create user \"!@#$%^*()_+-=2\" '!@#$%^*()_+-='");
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSeriesPermissionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSeriesPermissionIT.java
index 86cec307a60..4e27ed86393 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSeriesPermissionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSeriesPermissionIT.java
@@ -55,9 +55,10 @@ public class IoTDBSeriesPermissionIT {
@Before
public void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
- createUser("test", "test123");
- createUser("test1", "test123");
+ createUser("test", "test123123456");
+ createUser("test1", "test123123456");
}
@After
@@ -77,32 +78,32 @@ public class IoTDBSeriesPermissionIT {
"create timeseries root.test.d1.s1 with dataType = int32",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"ALTER timeseries root.test.d1.s1 ADD TAGS tag3=v3",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop timeseries root.test.d1.s1",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.test.d1.s1]",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop timeseries root.test.d1.s1, root.test.**",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.test.d1.s1, root.test.**]",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"set TTL to root.test.** 10000",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"unset TTL to root.test.**",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.test.**");
@@ -110,15 +111,16 @@ public class IoTDBSeriesPermissionIT {
"create timeseries root.test.d1.s1 with dataType = int32",
"803: No permissions for this operation, please add privilege MANAGE_DATABASE",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.MANAGE_DATABASE, "root.**");
- executeNonQuery("create timeseries root.test.d1.s1 with dataType = int32", "test", "test123");
- executeNonQuery("ALTER timeseries root.test.d1.s1 ADD TAGS tag3=v3", "test", "test123");
- executeNonQuery("drop timeseries root.test.d1.s1", "test", "test123");
- executeNonQuery("set TTL to root.test.** 10000", "test", "test123");
- executeNonQuery("unset TTL to root.test.**", "test", "test123");
+ executeNonQuery(
+ "create timeseries root.test.d1.s1 with dataType = int32", "test", "test123123456");
+ executeNonQuery("ALTER timeseries root.test.d1.s1 ADD TAGS tag3=v3", "test", "test123123456");
+ executeNonQuery("drop timeseries root.test.d1.s1", "test", "test123123456");
+ executeNonQuery("set TTL to root.test.** 10000", "test", "test123123456");
+ executeNonQuery("unset TTL to root.test.**", "test", "test123123456");
}
private void testReadSchema() {
@@ -136,7 +138,7 @@ public class IoTDBSeriesPermissionIT {
.toArray(String[]::new),
new String[] {},
"test1",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test1", PrivilegeType.READ_SCHEMA, "root.test.**");
resultSetEqualTest(
"show timeseries",
@@ -147,15 +149,15 @@ public class IoTDBSeriesPermissionIT {
"root.test.d1.s1,null,root.test,INT32,TS_2DIFF,LZ4,null,null,null,null,BASE,"
},
"test1",
- "test123");
+ "test123123456");
resultSetEqualTest(
- "count timeseries",
+ "count timeseries root.test.**",
countTimeSeriesColumnHeaders.stream()
.map(ColumnHeader::getColumnName)
.toArray(String[]::new),
new String[] {"1,"},
"test1",
- "test123");
+ "test123123456");
// show/count databases
resultSetEqualTest(
@@ -163,9 +165,9 @@ public class IoTDBSeriesPermissionIT {
showDatabasesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"root.test,1,1,0,604800000,"},
"test1",
- "test123");
+ "test123123456");
resultSetEqualTest(
- "count databases", new String[] {"count"}, new String[] {"1,"}, "test1", "test123");
+ "count databases", new String[] {"count"}, new String[] {"1,"}, "test1", "test123123456");
// show/count devices
resultSetEqualTest(
@@ -173,26 +175,26 @@ public class IoTDBSeriesPermissionIT {
showDevicesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"root.test.d1,false,null,10000,"},
"test1",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test1", PrivilegeType.READ_SCHEMA, "root.test1.d1.**");
resultSetEqualTest(
"show devices",
showDevicesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"root.test.d1,false,null,10000,", "root.test1.d1,false,null,INF,"},
"test1",
- "test123");
+ "test123123456");
resultSetEqualTest(
"count devices",
countDevicesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"2,"},
"test1",
- "test123");
+ "test123123456");
resultSetEqualTest(
"count devices root.test1.**",
countDevicesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"1,"},
"test1",
- "test123");
+ "test123123456");
// show child paths
resultSetEqualTest(
@@ -207,7 +209,7 @@ public class IoTDBSeriesPermissionIT {
"root.test1.d1.s1,TIMESERIES,"
},
"test1",
- "test123");
+ "test123123456");
// show child nodes
resultSetEqualTest(
@@ -217,7 +219,7 @@ public class IoTDBSeriesPermissionIT {
.toArray(String[]::new),
new String[] {"test,", "test1,"},
"test1",
- "test123");
+ "test123123456");
// count nodes level
resultSetEqualTest(
@@ -225,13 +227,13 @@ public class IoTDBSeriesPermissionIT {
countNodesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"2,"},
"test1",
- "test123");
+ "test123123456");
resultSetEqualTest(
"count nodes root.** level=2",
countNodesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"2,"},
"test1",
- "test123");
+ "test123123456");
// TTL
resultSetEqualTest(
@@ -239,7 +241,7 @@ public class IoTDBSeriesPermissionIT {
showTTLColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
new String[] {"root.**,INF,", "root.test,10000,", "root.test.**,10000,"},
"test1",
- "test123");
+ "test123123456");
}
@Test
@@ -255,27 +257,27 @@ public class IoTDBSeriesPermissionIT {
"insert into root.sg.d1(time,s1,s2) values(1,1,1)",
"803: No permissions for this operation, please add privilege WRITE_DATA on [root.sg.d1.s2]",
"test1",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"delete from root.sg.d1.s1, root.sg.d1.s2",
"803: No permissions for this operation, please add privilege WRITE_DATA on [root.sg.d1.s2]",
"test1",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test1", PrivilegeType.WRITE_DATA, "root.sg.d1.s2");
assertNonQueryTestFail(
"insert into root.sg.d1(time,s1,s2) values(1,1,1)",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.sg.d1.s1, root.sg.d1.s2]",
"test1",
- "test123");
- executeNonQuery("delete from root.sg.d1.s1, root.sg.d1.s2", "test1", "test123");
+ "test123123456");
+ executeNonQuery("delete from root.sg.d1.s1, root.sg.d1.s2", "test1", "test123123456");
grantUserSeriesPrivilege("test1", PrivilegeType.WRITE_SCHEMA, "root.sg.d1.**");
assertNonQueryTestFail(
"insert into root.sg.d1(time,s1,s2) values(1,1,1)",
"803: No permissions for this operation, please add privilege MANAGE_DATABASE",
"test1",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test1", PrivilegeType.MANAGE_DATABASE);
- executeNonQuery("insert into root.sg.d1(time,s1,s2) values(1,1,1)", "test1", "test123");
+ executeNonQuery("insert into root.sg.d1(time,s1,s2) values(1,1,1)", "test1", "test123123456");
}
private void testReadData() {
@@ -284,20 +286,24 @@ public class IoTDBSeriesPermissionIT {
executeNonQuery("insert into root.test1.d2(time,s1) values(2,2)");
resultSetEqualTest(
- "select * from root.**", new String[] {TIME}, new String[] {}, "test", "test123");
+ "select * from root.test1.**",
+ new String[] {TIME},
+ new String[] {},
+ "test",
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.READ_DATA, "root.test.**");
resultSetEqualTest(
- "select * from root.**",
+ "select * from root.test.**",
new String[] {TIME, "root.test.d1.s1"},
new String[] {"1,1.0,"},
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.READ_DATA, "root.test1.d1.**");
resultSetEqualTest(
- "select * from root.**",
+ "select * from root.test.**,root.test1.**",
new String[] {TIME, "root.test.d1.s1", "root.test1.d1.s1"},
new String[] {"1,1.0,null,", "2,null,2.0,"},
"test",
- "test123");
+ "test123123456");
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java
index c3ef62aa67e..fca31a877eb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java
@@ -50,8 +50,9 @@ public class IoTDBSystemPermissionIT {
@BeforeClass
public static void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
- createUser("test", "test123");
+ createUser("test", "test123123456");
executeNonQuery("create database root.test1");
}
@@ -62,7 +63,7 @@ public class IoTDBSystemPermissionIT {
@Test
public void showVersionTest() {
- executeQuery("show version", "test", "test123");
+ executeQuery("show version", "test", "test123123456");
}
@Test
@@ -71,17 +72,17 @@ public class IoTDBSystemPermissionIT {
"create database root.test2",
"803: No permissions for this operation, please add privilege MANAGE_DATABASE",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop database root.test1",
"803: No permissions for this operation, please add privilege MANAGE_DATABASE",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.MANAGE_DATABASE);
- executeNonQuery("create database root.test2", "test", "test123");
- executeNonQuery("drop database root.test1, root.test2", "test", "test123");
+ executeNonQuery("create database root.test2", "test", "test123123456");
+ executeNonQuery("drop database root.test1, root.test2", "test", "test123123456");
}
@Test
@@ -92,17 +93,17 @@ public class IoTDBSystemPermissionIT {
TRIGGER_FILE_TIMES_COUNTER, TRIGGER_JAR_PREFIX + "TriggerFireTimesCounter.jar"),
"803: No permissions for this operation, please add privilege USE_TRIGGER",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop trigger testTrigger",
"803: No permissions for this operation, please add privilege USE_TRIGGER",
"test",
- "test123");
+ "test123123456");
assertTestFail(
"show triggers",
"803: No permissions for this operation, please add privilege USE_TRIGGER",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.USE_TRIGGER);
@@ -111,9 +112,9 @@ public class IoTDBSystemPermissionIT {
"create stateless trigger testTrigger before insert on root.test.stateless.* as '%s' using URI '%s'",
TRIGGER_FILE_TIMES_COUNTER, TRIGGER_JAR_PREFIX + "TriggerFireTimesCounter.jar"),
"test",
- "test123");
- executeNonQuery("drop trigger testTrigger", "test", "test123");
- executeQuery("show triggers", "test", "test123");
+ "test123123456");
+ executeNonQuery("drop trigger testTrigger", "test", "test123123456");
+ executeQuery("show triggers", "test", "test123123456");
}
@Test
@@ -122,26 +123,26 @@ public class IoTDBSystemPermissionIT {
"create function counter as 'org.apache.iotdb.db.query.udf.example.Counter'",
"803: No permissions for this operation, please add privilege USE_UDF",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop function counter",
"803: No permissions for this operation, please add privilege USE_UDF",
"test",
- "test123");
+ "test123123456");
assertTestFail(
"show functions",
"803: No permissions for this operation, please add privilege USE_UDF",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.USE_UDF);
executeNonQuery(
"create function counter as 'org.apache.iotdb.db.query.udf.example.Counter'",
"test",
- "test123");
- executeNonQuery("drop function counter", "test", "test123");
- executeQuery("show functions", "test", "test123");
+ "test123123456");
+ executeNonQuery("drop function counter", "test", "test123123456");
+ executeQuery("show functions", "test", "test123123456");
}
@Test
@@ -158,17 +159,17 @@ public class IoTDBSystemPermissionIT {
+ "END",
"803: No permissions for this operation, please add privilege USE_CQ",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop CQ testCQ",
"803: No permissions for this operation, please add privilege USE_CQ",
"test",
- "test123");
+ "test123123456");
assertTestFail(
"show CQs",
"803: No permissions for this operation, please add privilege USE_CQ",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.USE_CQ);
@@ -183,9 +184,9 @@ public class IoTDBSystemPermissionIT {
+ " GROUP BY(10m)\n"
+ "END",
"test",
- "test123");
- executeNonQuery("drop CQ testCQ", "test", "test123");
- executeQuery("show CQs", "test", "test123");
+ "test123123456");
+ executeNonQuery("drop CQ testCQ", "test", "test123123456");
+ executeQuery("show CQs", "test", "test123123456");
}
// We test pipe permission in IoTDBPipeLifeCycleIT because a fake or self receiver
@@ -197,55 +198,58 @@ public class IoTDBSystemPermissionIT {
"show queries",
"803: No permissions for this operation, please add privilege MAINTAIN",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"kill query 'test'",
"803: No permissions for this operation, please add privilege MAINTAIN",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"show cluster",
"803: No permissions for this operation, please add privilege MAINTAIN",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"show cluster details",
"803: No permissions for this operation, please add privilege MAINTAIN",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges("test", PrivilegeType.MAINTAIN);
- executeNonQuery("show queries", "test", "test123");
+ executeNonQuery("show queries", "test", "test123123456");
assertNonQueryTestFail(
"kill query 'test'",
"701: Please ensure your input <queryId> is correct",
"test",
- "test123");
- executeNonQuery("show cluster", "test", "test123");
- executeNonQuery("show cluster details", "test", "test123");
+ "test123123456");
+ executeNonQuery("show cluster", "test", "test123123456");
+ executeNonQuery("show cluster details", "test", "test123123456");
}
@Test
public void adminOperationsTest() {
assertNonQueryTestFail(
- "flush", "803: Only the admin user can perform this operation", "test", "test123");
+ "flush", "803: Only the admin user can perform this operation", "test", "test123123456");
assertNonQueryTestFail(
- "clear cache", "803: Only the admin user can perform this operation", "test", "test123");
+ "clear cache",
+ "803: Only the admin user can perform this operation",
+ "test",
+ "test123123456");
assertNonQueryTestFail(
"set system to readonly",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"set system to running",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"load configuration",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBTemplatePermissionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBTemplatePermissionIT.java
index 52f6e01fc69..9f68b6ffae5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBTemplatePermissionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBTemplatePermissionIT.java
@@ -50,8 +50,9 @@ public class IoTDBTemplatePermissionIT {
@BeforeClass
public static void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().initClusterEnvironment();
- createUser("test", "test123");
+ createUser("test", "test123123456");
executeNonQuery("create database root.test1");
}
@@ -66,42 +67,42 @@ public class IoTDBTemplatePermissionIT {
"create device template t1 (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"drop device template t1",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"alter device template t1 add (speed FLOAT encoding=RLE, FLOAT TEXT encoding=PLAIN compression=SNAPPY)",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"show device templates",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"show nodes in device template t1",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"set device template t1 to root.sg1",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"unset device template t1 from root.sg1",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
"show paths set device template t1",
"803: Only the admin user can perform this operation",
"test",
- "test123");
+ "test123123456");
}
@Test
@@ -116,25 +117,27 @@ public class IoTDBTemplatePermissionIT {
"create timeseries using device template on root.sg1.d1",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.sg1.d1.temperature, root.sg1.d1.status]",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.sg1.d1.**");
- executeNonQuery("create timeseries using device template on root.sg1.d1", "test", "test123");
+ executeNonQuery(
+ "create timeseries using device template on root.sg1.d1", "test", "test123123456");
// insert
assertNonQueryTestFail(
"insert into root.sg1.d1(time, s1) values(1,1)",
"803: No permissions for this operation, please add privilege WRITE_DATA on [root.sg1.d1.s1]",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.WRITE_DATA, "root.sg1.**");
- executeNonQuery("insert into root.sg1.d1(time, temperature) values(1,1)", "test", "test123");
+ executeNonQuery(
+ "insert into root.sg1.d1(time, temperature) values(1,1)", "test", "test123123456");
assertNonQueryTestFail(
"insert into root.sg1.d1(time, s1) values(1,1)",
"803: No permissions for this operation, please add privilege EXTEND_TEMPLATE",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.EXTEND_TEMPLATE, "root.**");
- executeNonQuery("insert into root.sg1.d1(time, s1) values(1,1)", "test", "test123");
+ executeNonQuery("insert into root.sg1.d1(time, s1) values(1,1)", "test", "test123123456");
// show
executeNonQuery("create database root.sg2");
@@ -146,7 +149,7 @@ public class IoTDBTemplatePermissionIT {
.toArray(String[]::new),
new String[] {"root.sg1.d1,"},
"test",
- "test123");
+ "test123123456");
// deActive
revokeUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.sg1.d1.**");
@@ -154,8 +157,8 @@ public class IoTDBTemplatePermissionIT {
"deactivate device template t1 from root.sg1.d1",
"803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.sg1.d1.temperature, root.sg1.d1.s1, root.sg1.d1.status]",
"test",
- "test123");
+ "test123123456");
grantUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.sg1.d1.**");
- executeNonQuery("deactivate device template t1 from root.sg1.d1", "test", "test123");
+ executeNonQuery("deactivate device template t1 from root.sg1.d1", "test", "test123123456");
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBEncryptionValueQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBEncryptionValueQueryIT.java
index c8225eeced5..45bf938d71f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBEncryptionValueQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBEncryptionValueQueryIT.java
@@ -166,7 +166,8 @@ public class IoTDBEncryptionValueQueryIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- ResultSet resultSet = statement.executeQuery("select * from root.** where time>10");
+ ResultSet resultSet =
+ statement.executeQuery("select * from root.ln.**,root.sgcc.** where time>10");
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
List<Integer> actualIndexToExpectedIndexList =
checkHeader(
@@ -224,7 +225,8 @@ public class IoTDBEncryptionValueQueryIT {
Assert.assertEquals(4, statement.getFetchSize());
ResultSet resultSet =
- statement.executeQuery("select * from root.** where time>10 limit 5 offset 3");
+ statement.executeQuery(
+ "select * from root.ln.**,root.sgcc.** where time>10 limit 5 offset 3");
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
List<Integer> actualIndexToExpectedIndexList =
checkHeader(
@@ -261,7 +263,9 @@ public class IoTDBEncryptionValueQueryIT {
// test 1: fetchSize > limitNumber
statement.setFetchSize(10000);
Assert.assertEquals(10000, statement.getFetchSize());
- resultSet = statement.executeQuery("select * from root.** where time>10 limit 5 offset 3");
+ resultSet =
+ statement.executeQuery(
+ "select * from root.ln.**,root.sgcc.** where time>10 limit 5 offset 3");
resultSetMetaData = resultSet.getMetaData();
actualIndexToExpectedIndexList =
@@ -321,7 +325,7 @@ public class IoTDBEncryptionValueQueryIT {
Assert.assertEquals(4, statement.getFetchSize());
ResultSet resultSet =
statement.executeQuery(
- "select * from root.** where time in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
+ "select * from root.ln.**,root.sgcc.** where time in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
List<Integer> actualIndexToExpectedIndexList =
checkHeader(
@@ -365,7 +369,7 @@ public class IoTDBEncryptionValueQueryIT {
};
resultSet =
statement.executeQuery(
- "select * from root.** where time not in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
+ "select * from root.ln.**,root.sgcc.** where time not in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
resultSetMetaData = resultSet.getMetaData();
actualIndexToExpectedIndexList =
@@ -409,7 +413,7 @@ public class IoTDBEncryptionValueQueryIT {
resultSet =
statement.executeQuery(
- "select * from root.** where root.ln.wf01.wt01.temperature in (20.18, 20.71, 22.58)");
+ "select * from root.ln.**,root.sgcc.** where root.ln.wf01.wt01.temperature in (20.18, 20.71, 22.58)");
resultSetMetaData = resultSet.getMetaData();
actualIndexToExpectedIndexList =
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java
index 2397e49c1dc..198ea449dcc 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java
@@ -166,7 +166,8 @@ public class IoTDBQueryDemoIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- ResultSet resultSet = statement.executeQuery("select * from root.** where time>10");
+ ResultSet resultSet =
+ statement.executeQuery("select * from root.ln.**,root.sgcc.** where time>10");
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
List<Integer> actualIndexToExpectedIndexList =
checkHeader(
@@ -224,7 +225,8 @@ public class IoTDBQueryDemoIT {
Assert.assertEquals(4, statement.getFetchSize());
ResultSet resultSet =
- statement.executeQuery("select * from root.** where time>10 limit 5 offset 3");
+ statement.executeQuery(
+ "select * from root.ln.**,root.sgcc.** where time>10 limit 5 offset 3");
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
List<Integer> actualIndexToExpectedIndexList =
checkHeader(
@@ -261,7 +263,9 @@ public class IoTDBQueryDemoIT {
// test 1: fetchSize > limitNumber
statement.setFetchSize(10000);
Assert.assertEquals(10000, statement.getFetchSize());
- resultSet = statement.executeQuery("select * from root.** where time>10 limit 5 offset 3");
+ resultSet =
+ statement.executeQuery(
+ "select * from root.ln.**,root.sgcc.** where time>10 limit 5 offset 3");
resultSetMetaData = resultSet.getMetaData();
actualIndexToExpectedIndexList =
@@ -321,7 +325,7 @@ public class IoTDBQueryDemoIT {
Assert.assertEquals(4, statement.getFetchSize());
ResultSet resultSet =
statement.executeQuery(
- "select * from root.** where time in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
+ "select * from root.ln.**,root.sgcc.** where time in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
List<Integer> actualIndexToExpectedIndexList =
checkHeader(
@@ -365,7 +369,7 @@ public class IoTDBQueryDemoIT {
};
resultSet =
statement.executeQuery(
- "select * from root.** where time not in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
+ "select * from root.ln.**,root.sgcc.** where time not in (1509465780000, 1509465840000, 1509465900000, 1509465960000, 1509466020000)");
resultSetMetaData = resultSet.getMetaData();
actualIndexToExpectedIndexList =
@@ -409,7 +413,7 @@ public class IoTDBQueryDemoIT {
resultSet =
statement.executeQuery(
- "select * from root.** where root.ln.wf01.wt01.temperature in (20.18, 20.71, 22.58)");
+ "select * from root.ln.**,root.sgcc.** where root.ln.wf01.wt01.temperature in (20.18, 20.71, 22.58)");
resultSetMetaData = resultSet.getMetaData();
actualIndexToExpectedIndexList =
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
index 7fdeff084c3..bd470cfdb4d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
@@ -125,7 +125,7 @@ public class IoTDBCreateAlignedTimeseriesIT extends AbstractSchemaIT {
int count = 0;
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement();
- ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES")) {
+ ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES root.sg1.**")) {
while (resultSet.next()) {
String ActualResult =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateDatabaseIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateDatabaseIT.java
index 63e0efd2f3c..8681878d254 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateDatabaseIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateDatabaseIT.java
@@ -95,7 +95,7 @@ public class IoTDBCreateDatabaseIT extends AbstractSchemaIT {
throws SQLException {
List<String> resultList = new ArrayList<>();
- try (final ResultSet resultSet = statement.executeQuery("SHOW DATABASES")) {
+ try (final ResultSet resultSet = statement.executeQuery("SHOW DATABASES root.sg*")) {
while (resultSet.next()) {
final String databasePath = resultSet.getString(ColumnHeaderConstant.DATABASE);
resultList.add(databasePath);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
index 7a3ea9f72f5..eb02ca1d7ee 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
@@ -184,7 +184,7 @@ public class IoTDBDeactivateTemplateIT extends AbstractSchemaIT {
String[] retArray =
new String[] {"1,1,1.0,1,1.0,", "2,2,2.0,2,2.0,", "3,3,3.0,3,3.0,", "4,4,4.0,4,4.0,"};
int cnt = 0;
- try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.sg1.**,root.sg2.**")) {
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
Assert.assertEquals(5, resultSetMetaData.getColumnCount());
while (resultSet.next()) {
@@ -199,7 +199,7 @@ public class IoTDBDeactivateTemplateIT extends AbstractSchemaIT {
}
statement.execute("DEACTIVATE DEVICE TEMPLATE FROM root.**, root.sg1.*");
- try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.sg1.**,root.sg2.**")) {
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
Assert.assertEquals(1, resultSetMetaData.getColumnCount());
Assert.assertFalse(resultSet.next());
@@ -267,7 +267,7 @@ public class IoTDBDeactivateTemplateIT extends AbstractSchemaIT {
}
statement.execute("DEACTIVATE DEVICE TEMPLATE FROM root.**");
- try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("SELECT * FROM root.sg1.**,root.sg2.**")) {
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
Assert.assertEquals(1, resultSetMetaData.getColumnCount());
Assert.assertFalse(resultSet.next());
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java
index 7af1fbfee3e..2ade000fbb6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java
@@ -161,7 +161,7 @@ public class IoTDBDeleteAlignedTimeseriesIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("INSERT INTO root.sg3.d1(timestamp,s1,s2) ALIGNED VALUES(1,1,2)");
- try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES root.sg3.**")) {
while (resultSet.next()) {
Assert.assertEquals("true", resultSet.getString(ColumnHeaderConstant.IS_ALIGNED));
}
@@ -170,7 +170,7 @@ public class IoTDBDeleteAlignedTimeseriesIT extends AbstractSchemaIT {
statement.execute("DELETE timeseries root.sg3.d1.s1");
statement.execute("DELETE timeseries root.sg3.d1.s2");
statement.execute("INSERT INTO root.sg3.d1(timestamp,s1,s2) VALUES(1,1,2)");
- try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES root.sg3.**")) {
while (resultSet.next()) {
Assert.assertEquals("false", resultSet.getString(ColumnHeaderConstant.IS_ALIGNED));
}
@@ -191,7 +191,7 @@ public class IoTDBDeleteAlignedTimeseriesIT extends AbstractSchemaIT {
statement.execute("DELETE timeseries root.sg3.d1.s1");
statement.execute("DELETE timeseries root.sg3.d1.s2");
statement.execute("INSERT INTO root.sg3.d1(timestamp,s1,s2) ALIGNED VALUES(1,1,2)");
- try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES root.sg3.**")) {
while (resultSet.next()) {
Assert.assertEquals("true", resultSet.getString(ColumnHeaderConstant.IS_ALIGNED));
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteDatabaseIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteDatabaseIT.java
index adde61a697c..c1a08c2fd82 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteDatabaseIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteDatabaseIT.java
@@ -79,7 +79,7 @@ public class IoTDBDeleteDatabaseIT extends AbstractSchemaIT {
List<String> expectedList = new ArrayList<>();
Collections.addAll(expectedList, expected);
List<String> result = new ArrayList<>();
- try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES root.ln.**")) {
while (resultSet.next()) {
result.add(resultSet.getString(1));
}
@@ -102,7 +102,7 @@ public class IoTDBDeleteDatabaseIT extends AbstractSchemaIT {
List<String> expectedList = new ArrayList<>();
Collections.addAll(expectedList, expected);
List<String> result = new ArrayList<>();
- try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES root.ln1.**")) {
while (resultSet.next()) {
result.add(resultSet.getString(1));
}
@@ -134,7 +134,7 @@ public class IoTDBDeleteDatabaseIT extends AbstractSchemaIT {
List<String> expectedList = new ArrayList<>();
Collections.addAll(expectedList, expected);
List<String> result = new ArrayList<>();
- try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES root.ln3.**")) {
while (resultSet.next()) {
result.add(resultSet.getString(1));
}
@@ -169,12 +169,12 @@ public class IoTDBDeleteDatabaseIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
statement.execute("insert into root.sg1.d1(time,s1) values(1,1);");
statement.execute("flush");
- statement.execute("select count(*) from root.**;");
+ statement.execute("select count(*) from root.sg1.**;");
statement.execute("delete database root.sg1");
statement.execute("insert into root.sg1.sdhkajhd(time,s1) values(1,1);");
statement.execute("flush");
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("select count(*) from root.**")) {
+ try (ResultSet resultSet = statement.executeQuery("select count(*) from root.sg1.**")) {
while (resultSet.next()) {
count++;
assertEquals(1, resultSet.getLong("count(root.sg1.sdhkajhd.s1)"));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java
index 4d7a07dcebb..c278fd89f0a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java
@@ -422,14 +422,14 @@ public class IoTDBDeleteTimeSeriesIT extends AbstractSchemaIT {
statement.execute("SET DEVICE TEMPLATE t1 to root.db");
statement.execute("CREATE TIMESERIES USING DEVICE TEMPLATE ON root.db.d1");
try {
- statement.execute("DELETE TIMESERIES root.**");
+ statement.execute("DELETE TIMESERIES root.db.**");
Assert.fail();
} catch (SQLException e) {
Assert.assertTrue(
e.getMessage()
.contains(
TSStatusCode.PATH_NOT_EXIST.getStatusCode()
- + ": Timeseries [root.**] does not exist or is represented by device template"));
+ + ": Timeseries [root.db.**] does not exist or is represented by device template"));
}
try {
statement.execute("DELETE TIMESERIES root.db.**");
@@ -449,14 +449,14 @@ public class IoTDBDeleteTimeSeriesIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
try {
- statement.execute("delete timeseries root.**");
+ statement.execute("delete timeseries root.db.**");
Assert.fail();
} catch (SQLException e) {
Assert.assertTrue(
e.getMessage()
.contains(
TSStatusCode.PATH_NOT_EXIST.getStatusCode()
- + ": Timeseries [root.**] does not exist or is represented by device template"));
+ + ": Timeseries [root.db.**] does not exist or is represented by device template"));
}
String[] retArray1 = new String[] {"4,4,4,4"};
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDisableAutoCreateSchemaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDisableAutoCreateSchemaIT.java
index cac1691cfdb..b120e17525b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDisableAutoCreateSchemaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDisableAutoCreateSchemaIT.java
@@ -60,10 +60,10 @@ public class IoTDBDisableAutoCreateSchemaIT {
Assert.assertTrue(e.getMessage().contains("because enable_auto_create_schema is FALSE."));
}
try {
- ResultSet databaseResultSet = statement.executeQuery("count databases");
+ ResultSet databaseResultSet = statement.executeQuery("count databases root.db");
databaseResultSet.next();
Assert.assertEquals(0, databaseResultSet.getInt("count"));
- ResultSet timeseriesResultSet = statement.executeQuery("count timeseries");
+ ResultSet timeseriesResultSet = statement.executeQuery("count timeseries root.db.**");
timeseriesResultSet.next();
Assert.assertEquals(0, timeseriesResultSet.getInt("count(timeseries)"));
} catch (SQLException e) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBExtendTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBExtendTemplateIT.java
index f3d53c3a461..4f7eeb2e949 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBExtendTemplateIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBExtendTemplateIT.java
@@ -95,7 +95,7 @@ public class IoTDBExtendTemplateIT extends AbstractSchemaIT {
String[] sqls =
new String[] {
- "show timeseries",
+ "show timeseries root.db.**",
};
Set<String>[] standards =
new Set[] {
@@ -153,7 +153,7 @@ public class IoTDBExtendTemplateIT extends AbstractSchemaIT {
String[] sqls =
new String[] {
- "show timeseries",
+ "show timeseries root.db*.**",
};
Set<String>[] standards =
new Set[] {
@@ -216,7 +216,7 @@ public class IoTDBExtendTemplateIT extends AbstractSchemaIT {
String[] sqls =
new String[] {
- "show timeseries",
+ "show timeseries root.db.**",
};
Set<String>[] standards =
new Set[] {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
index 000395bb480..cb2d1ff3d47 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
@@ -117,9 +117,9 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
"show timeseries root.ln.wf01.wt01.status", // full seriesPath
"show timeseries root.ln.**", // prefix seriesPath
"show timeseries root.ln.*.wt01.*", // seriesPath with stars
- "show timeseries", // the same as root
+ "show timeseries root.ln*.**", // the same as root
"show timeseries root.a.b", // nonexistent timeseries, thus returning ""
- "show timeseries root.** where timeseries contains 'tat'",
+ "show timeseries root.ln*.** where timeseries contains 'tat'",
"show timeseries root.ln.** where timeseries contains 'wf01.wt01'",
"show timeseries root.ln.** where dataType=BOOLEAN"
};
@@ -191,7 +191,7 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
final Statement statement = connection.createStatement()) {
final String[] sqls =
new String[] {
- "show databases",
+ "show databases root.ln*.**",
"show databases root.ln.wf01.**",
"show databases root.ln.wf01.wt01.status"
};
@@ -471,7 +471,7 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
public void showCountTimeSeries() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- String[] sqls = new String[] {"COUNT TIMESERIES root.ln.**", "COUNT TIMESERIES"};
+ String[] sqls = new String[] {"COUNT TIMESERIES root.ln.**", "COUNT TIMESERIES root.ln*.**"};
String[] standards = new String[] {"4,\n", "8,\n"};
for (int n = 0; n < sqls.length; n++) {
String sql = sqls[n];
@@ -566,7 +566,7 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
String[] sqls =
new String[] {
"COUNT DEVICES root.ln.**",
- "COUNT DEVICES",
+ "COUNT DEVICES root.ln*.**",
"COUNT DEVICES root.ln.wf01.wt01.temperature"
};
String[] standards = new String[] {"2,\n", "4,\n", "0,\n"};
@@ -598,7 +598,7 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
String[] sqls =
new String[] {
"count databases root.ln.**",
- "count databases",
+ "count databases root.ln*.**",
"count databases root.ln.wf01.wt01.status"
};
String[] standards = new String[] {"2,\n", "4,\n", "0,\n"};
@@ -629,10 +629,10 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
String[] sqls =
new String[] {
- "COUNT TIMESERIES root.** group by level=1",
- "COUNT TIMESERIES root.** group by level=3",
- "COUNT TIMESERIES root.**.status group by level=2",
- "COUNT TIMESERIES root.** group by level=5"
+ "COUNT TIMESERIES root.ln*.** group by level=1",
+ "COUNT TIMESERIES root.ln*.** group by level=3",
+ "COUNT TIMESERIES root.ln*.**.status group by level=2",
+ "COUNT TIMESERIES root.ln*.** group by level=5"
};
Set<String>[] standards =
new Set[] {
@@ -740,7 +740,7 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
String[] sqls =
new String[] {
- "COUNT NODES root.** level=1",
+ "COUNT NODES root.ln*.** level=1",
"COUNT NODES root.ln level=1",
"COUNT NODES root.ln.wf01.** level=1",
"COUNT NODES root.ln.wf01.* level=2",
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java
index 1f4445ddb46..822cca2e78c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java
@@ -177,7 +177,7 @@ public class IoTDBSchemaTemplateIT extends AbstractSchemaIT {
expectedResult =
new HashSet<>(Arrays.asList("root.sg1.d1,false", "root.sg1.d2,true", "root.sg1.d3,true"));
- try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES root.sg1.**")) {
while (resultSet.next()) {
String actualResult =
resultSet.getString(ColumnHeaderConstant.DEVICE)
@@ -258,7 +258,7 @@ public class IoTDBSchemaTemplateIT extends AbstractSchemaIT {
expectedResult = new HashSet<>(Arrays.asList("root.sg1.d1,false", "root.sg1.d2,true"));
- try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES")) {
+ try (ResultSet resultSet = statement.executeQuery("SHOW DEVICES root.sg1.**")) {
while (resultSet.next()) {
String actualResult =
resultSet.getString(ColumnHeaderConstant.DEVICE)
@@ -556,7 +556,7 @@ public class IoTDBSchemaTemplateIT extends AbstractSchemaIT {
// created
statement.execute("INSERT INTO root.sg1.d1(time,s1,s2,s3) VALUES (2,1,1,1)");
- try (ResultSet resultSet = statement.executeQuery("count timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("count timeseries root.sg1.**")) {
Assert.assertTrue(resultSet.next());
long resultRecord = resultSet.getLong(1);
Assert.assertEquals(3, resultRecord);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java
index 8c70e76c1fc..39338d71bd5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java
@@ -33,6 +33,7 @@ import org.junit.runners.Parameterized;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -127,58 +128,60 @@ public class IoTDBSortedShowTimeseriesIT extends AbstractSchemaIT {
public void showTimeseriesOrderByHeatTest1() {
List<String> retArray1 =
- Arrays.asList(
- "root.turbine.d0.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\""
- + "turbine this is a test1\",\"unit\":\"f\"},{\"H_Alarm\":\"100\",\"M_Alarm\":\"50\"}",
- "root.turbine.d0.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine "
- + "this is a test2\",\"unit\":\"kw\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s2,cpu,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
- + "is a cpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s3,gpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
- + "is a gpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s4,tpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
- + "is a tpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d1.s0,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine this "
- + "is a test3\"},{\"H_Alarm\":\"9\",\"M_Alarm\":\"5\"}",
- "root.turbine.d2.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine"
- + " d2 this is a test1\",\"unit\":\"f\"},{\"MinValue\":\"1\",\"MaxValue\":\"100\"}",
- "root.turbine.d2.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 this"
- + " is a test2\",\"unit\":\"kw\"},{\"MinValue\":\"44.4\",\"MaxValue\":\"99.9\"}",
- "root.turbine.d2.s3,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine d2"
- + " this is a test3\"},{\"MinValue\":\"5\",\"MaxValue\":\"9\"}",
- "root.ln.d0.s0,temperature,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a "
- + "test1\",\"unit\":\"c\"},{\"H_Alarm\":\"1000\",\"M_Alarm\":\"500\"}",
- "root.ln.d0.s1,power,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a test2\",\""
- + "unit\":\"w\"},{\"H_Alarm\":\"9.9\",\"M_Alarm\":\"4.4\"}",
- "root.ln.d1.s0,status,root.ln,INT32,RLE,LZ4,{\"description\":\"ln this is a test3\"},"
- + "{\"H_Alarm\":\"90\",\"M_Alarm\":\"50\"}");
+ new ArrayList<>(
+ Arrays.asList(
+ "root.turbine.d0.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\""
+ + "turbine this is a test1\",\"unit\":\"f\"},{\"H_Alarm\":\"100\",\"M_Alarm\":\"50\"}",
+ "root.turbine.d0.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine "
+ + "this is a test2\",\"unit\":\"kw\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s2,cpu,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
+ + "is a cpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s3,gpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
+ + "is a gpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s4,tpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
+ + "is a tpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d1.s0,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine this "
+ + "is a test3\"},{\"H_Alarm\":\"9\",\"M_Alarm\":\"5\"}",
+ "root.turbine.d2.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine"
+ + " d2 this is a test1\",\"unit\":\"f\"},{\"MinValue\":\"1\",\"MaxValue\":\"100\"}",
+ "root.turbine.d2.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 this"
+ + " is a test2\",\"unit\":\"kw\"},{\"MinValue\":\"44.4\",\"MaxValue\":\"99.9\"}",
+ "root.turbine.d2.s3,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine d2"
+ + " this is a test3\"},{\"MinValue\":\"5\",\"MaxValue\":\"9\"}",
+ "root.ln.d0.s0,temperature,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a "
+ + "test1\",\"unit\":\"c\"},{\"H_Alarm\":\"1000\",\"M_Alarm\":\"500\"}",
+ "root.ln.d0.s1,power,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a test2\",\""
+ + "unit\":\"w\"},{\"H_Alarm\":\"9.9\",\"M_Alarm\":\"4.4\"}",
+ "root.ln.d1.s0,status,root.ln,INT32,RLE,LZ4,{\"description\":\"ln this is a test3\"},"
+ + "{\"H_Alarm\":\"90\",\"M_Alarm\":\"50\"}"));
List<String> retArray2 =
- Arrays.asList(
- "root.turbine.d2.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 "
- + "this is a test1\",\"unit\":\"f\"},{\"MinValue\":\"1\",\"MaxValue\":\"100\"}",
- "root.turbine.d2.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 this "
- + "is a test2\",\"unit\":\"kw\"},{\"MinValue\":\"44.4\",\"MaxValue\":\"99.9\"}",
- "root.turbine.d2.s3,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine d2 this "
- + "is a test3\"},{\"MinValue\":\"5\",\"MaxValue\":\"9\"}",
- "root.turbine.d0.s4,tpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a"
- + " tpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s3,gpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a"
- + " gpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s2,cpu,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a "
- + "cpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a "
- + "test2\",\"unit\":\"kw\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d0.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine"
- + " this is a test1\",\"unit\":\"f\"},{\"H_Alarm\":\"100\",\"M_Alarm\":\"50\"}",
- "root.turbine.d1.s0,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine this is a "
- + "test3\"},{\"H_Alarm\":\"9\",\"M_Alarm\":\"5\"}",
- "root.ln.d0.s0,temperature,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a test1\""
- + ",\"unit\":\"c\"},{\"H_Alarm\":\"1000\",\"M_Alarm\":\"500\"}",
- "root.ln.d0.s1,power,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a test2\",\""
- + "unit\":\"w\"},{\"H_Alarm\":\"9.9\",\"M_Alarm\":\"4.4\"}",
- "root.ln.d1.s0,status,root.ln,INT32,RLE,LZ4,{\"description\":\"ln this is a test3\"},"
- + "{\"H_Alarm\":\"90\",\"M_Alarm\":\"50\"}");
+ new ArrayList<>(
+ Arrays.asList(
+ "root.turbine.d2.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 "
+ + "this is a test1\",\"unit\":\"f\"},{\"MinValue\":\"1\",\"MaxValue\":\"100\"}",
+ "root.turbine.d2.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 this "
+ + "is a test2\",\"unit\":\"kw\"},{\"MinValue\":\"44.4\",\"MaxValue\":\"99.9\"}",
+ "root.turbine.d2.s3,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine d2 this "
+ + "is a test3\"},{\"MinValue\":\"5\",\"MaxValue\":\"9\"}",
+ "root.turbine.d0.s4,tpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a"
+ + " tpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s3,gpu0,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a"
+ + " gpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s2,cpu,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a "
+ + "cpu\",\"unit\":\"cores\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this is a "
+ + "test2\",\"unit\":\"kw\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d0.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine"
+ + " this is a test1\",\"unit\":\"f\"},{\"H_Alarm\":\"100\",\"M_Alarm\":\"50\"}",
+ "root.turbine.d1.s0,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine this is a "
+ + "test3\"},{\"H_Alarm\":\"9\",\"M_Alarm\":\"5\"}",
+ "root.ln.d0.s0,temperature,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a test1\""
+ + ",\"unit\":\"c\"},{\"H_Alarm\":\"1000\",\"M_Alarm\":\"500\"}",
+ "root.ln.d0.s1,power,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a test2\",\""
+ + "unit\":\"w\"},{\"H_Alarm\":\"9.9\",\"M_Alarm\":\"4.4\"}",
+ "root.ln.d1.s0,status,root.ln,INT32,RLE,LZ4,{\"description\":\"ln this is a test3\"},"
+ + "{\"H_Alarm\":\"90\",\"M_Alarm\":\"50\"}"));
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -203,14 +206,12 @@ public class IoTDBSortedShowTimeseriesIT extends AbstractSchemaIT {
+ ","
+ resultSet.getString(ColumnHeaderConstant.ATTRIBUTES);
- assertTrue(retArray1.contains(ans));
- count++;
+ retArray1.remove(ans);
}
- assertEquals(retArray1.size(), count);
+ assertEquals(0, retArray1.size());
resultSet.close();
resultSet = statement.executeQuery("show LATEST timeseries");
- count = 0;
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
@@ -229,10 +230,9 @@ public class IoTDBSortedShowTimeseriesIT extends AbstractSchemaIT {
+ ","
+ resultSet.getString(ColumnHeaderConstant.ATTRIBUTES);
System.out.println("\"" + ans + "\",");
- assertTrue(retArray2.contains(ans));
- count++;
+ retArray2.remove(ans);
}
- assertEquals(retArray2.size(), count);
+ assertEquals(0, count);
resultSet.close();
} catch (Exception e) {
@@ -261,7 +261,8 @@ public class IoTDBSortedShowTimeseriesIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- ResultSet resultSet = statement.executeQuery("show LATEST timeseries limit 5");
+ ResultSet resultSet =
+ statement.executeQuery("show LATEST timeseries root.turbine.** limit 5");
int count = 0;
while (resultSet.next()) {
String ans =
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java
index feb49793c08..ab3ec875c63 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java
@@ -80,7 +80,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -128,7 +128,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
}
statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME 'tag1' TO 'tagNew1'");
- resultSet = statement.executeQuery("show timeseries");
+ resultSet = statement.executeQuery("show timeseries root.turbine.**");
count = 0;
try {
while (resultSet.next()) {
@@ -178,7 +178,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -216,7 +216,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
}
statement.execute("ALTER timeseries root.turbine.d1.s1 SET 'tag1'='newV1', 'attr2'='newV2'");
- resultSet = statement.executeQuery("show timeseries");
+ resultSet = statement.executeQuery("show timeseries root.turbine.**");
count = 0;
try {
while (resultSet.next()) {
@@ -265,7 +265,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -294,7 +294,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
assertEquals(ret.length, count);
statement.execute("ALTER timeseries root.turbine.d1.s1 DROP attr1,'tag1'");
- resultSet = statement.executeQuery("show timeseries");
+ resultSet = statement.executeQuery("show timeseries root.turbine.**");
count = 0;
try {
while (resultSet.next()) {
@@ -348,7 +348,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -427,7 +427,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -457,7 +457,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
statement.execute(
"ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES 'attr3'='v3', 'attr4'='v4'");
- resultSet = statement.executeQuery("show timeseries");
+ resultSet = statement.executeQuery("show timeseries root.turbine.**");
count = 0;
try {
while (resultSet.next()) {
@@ -511,7 +511,7 @@ public class IoTDBTagAlterIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
index 2dd80c2bba0..8ed8d1ee29a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
@@ -33,6 +33,7 @@ import org.junit.runners.Parameterized;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
@@ -84,7 +85,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(sql);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -137,7 +138,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
statement.execute(sql1);
statement.execute(sql2);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -191,7 +192,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
statement.execute(sql1);
statement.execute(sql2);
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
@@ -426,7 +427,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
statement.execute(sql1);
statement.execute(sql2);
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
@@ -453,7 +454,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
statement.execute("delete timeseries root.turbine.d7.s2");
count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
@@ -509,7 +510,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
statement.execute(sql1);
statement.execute(sql2);
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
@@ -536,7 +537,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
statement.execute("delete timeseries root.turbine.d7.status");
count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
@@ -569,25 +570,26 @@ public class IoTDBTagIT extends AbstractSchemaIT {
@Test
public void queryWithWhereTest1() {
List<String> ret1 =
- Arrays.asList(
- "root.turbine.d0.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine "
- + "this is a test1\",\"unit\":\"f\"},{\"H_Alarm\":\"100\",\"M_Alarm\":\"50\"}",
- "root.turbine.d0.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
- + "is a test2\",\"unit\":\"kw\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
- "root.turbine.d1.s0,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine this "
- + "is a test3\"},{\"H_Alarm\":\"9\",\"M_Alarm\":\"5\"}",
- "root.turbine.d2.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine "
- + "d2 this is a test1\",\"unit\":\"f\"},{\"MinValue\":\"1\",\"MaxValue\":\"100\"}",
- "root.turbine.d2.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 this"
- + " is a test2\",\"unit\":\"kw\"},{\"MinValue\":\"44.4\",\"MaxValue\":\"99.9\"}",
- "root.turbine.d2.s3,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine d2 "
- + "this is a test3\"},{\"MinValue\":\"5\",\"MaxValue\":\"9\"}",
- "root.ln.d0.s0,temperature,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a "
- + "test1\",\"unit\":\"c\"},{\"H_Alarm\":\"1000\",\"M_Alarm\":\"500\"}",
- "root.ln.d0.s1,power,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a "
- + "test2\",\"unit\":\"w\"},{\"H_Alarm\":\"9.9\",\"M_Alarm\":\"4.4\"}",
- "root.ln.d1.s0,status,root.ln,INT32,RLE,LZ4,{\"description\":\"ln this is a test3\"},"
- + "{\"H_Alarm\":\"90\",\"M_Alarm\":\"50\"}");
+ new ArrayList<>(
+ Arrays.asList(
+ "root.turbine.d0.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine "
+ + "this is a test1\",\"unit\":\"f\"},{\"H_Alarm\":\"100\",\"M_Alarm\":\"50\"}",
+ "root.turbine.d0.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine this "
+ + "is a test2\",\"unit\":\"kw\"},{\"H_Alarm\":\"99.9\",\"M_Alarm\":\"44.4\"}",
+ "root.turbine.d1.s0,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine this "
+ + "is a test3\"},{\"H_Alarm\":\"9\",\"M_Alarm\":\"5\"}",
+ "root.turbine.d2.s0,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine "
+ + "d2 this is a test1\",\"unit\":\"f\"},{\"MinValue\":\"1\",\"MaxValue\":\"100\"}",
+ "root.turbine.d2.s1,power,root.turbine,FLOAT,RLE,SNAPPY,{\"description\":\"turbine d2 this"
+ + " is a test2\",\"unit\":\"kw\"},{\"MinValue\":\"44.4\",\"MaxValue\":\"99.9\"}",
+ "root.turbine.d2.s3,status,root.turbine,INT32,RLE,LZ4,{\"description\":\"turbine d2 "
+ + "this is a test3\"},{\"MinValue\":\"5\",\"MaxValue\":\"9\"}",
+ "root.ln.d0.s0,temperature,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a "
+ + "test1\",\"unit\":\"c\"},{\"H_Alarm\":\"1000\",\"M_Alarm\":\"500\"}",
+ "root.ln.d0.s1,power,root.ln,FLOAT,RLE,SNAPPY,{\"description\":\"ln this is a "
+ + "test2\",\"unit\":\"w\"},{\"H_Alarm\":\"9.9\",\"M_Alarm\":\"4.4\"}",
+ "root.ln.d1.s0,status,root.ln,INT32,RLE,LZ4,{\"description\":\"ln this is a test3\"},"
+ + "{\"H_Alarm\":\"90\",\"M_Alarm\":\"50\"}"));
Set<String> ret2 = new HashSet<>();
ret2.add(
@@ -651,10 +653,9 @@ public class IoTDBTagIT extends AbstractSchemaIT {
+ ","
+ resultSet.getString(ColumnHeaderConstant.ATTRIBUTES);
- assertTrue(ret1.contains(ans));
- count++;
+ ret1.remove(ans);
}
- assertEquals(ret1.size(), count);
+ assertEquals(0, ret1.size());
}
count = 0;
@@ -1086,7 +1087,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
statement.execute(sql);
int count = 0;
- try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIMESERIES)
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java
index 3e2df365d56..47e39489c72 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java
@@ -114,7 +114,7 @@ public class IoTDBTagLimitIT extends AbstractSchemaIT {
Statement statement = connection.createStatement()) {
for (int i = 0; i < sqls.size(); i++) {
statement.execute(sqls.get(i));
- ResultSet resultSet = statement.executeQuery("show timeseries");
+ ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
int count = 0;
try {
while (resultSet.next()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java
index f5c1da1b336..7b4f5ab78b0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java
@@ -258,14 +258,14 @@ public class IoTDBActiveRegionScanIT extends AbstractSchemaIT {
@Test
public void showActiveDeviceTest7() {
- String sql = "show devices where time > 45";
+ String sql = "show devices root.sg.** where time > 45";
String[] retArray = new String[] {};
basicShowActiveDeviceTest(sql, SHOW_DEVICES_COLUMN_NAMES, retArray);
}
@Test
public void showActiveDeviceTest8() {
- String sql = "show devices where time > 44 or time < 4";
+ String sql = "show devices root.sg.** where time > 44 or time < 4";
String[] retArray = new String[] {"root.sg.aligned.d1", "root.sg.unaligned.d2"};
basicShowActiveDeviceTest(sql, SHOW_DEVICES_COLUMN_NAMES, retArray);
}
@@ -398,23 +398,23 @@ public class IoTDBActiveRegionScanIT extends AbstractSchemaIT {
@Test
public void showActiveTimeseriesTest7() {
- String sql = "show timeseries where time > 45";
+ String sql = "show timeseries root.sg.** where time > 45";
String[] retArray = new String[] {};
basicShowActiveDeviceTest(sql, SHOW_TIMESERIES_COLUMN_NAMES, retArray);
- sql = "count timeseries where time > 45";
+ sql = "count timeseries root.sg.** where time > 45";
long value = 0;
basicCountActiveDeviceTest(sql, COUNT_TIMESERIES_COLUMN_NAMES, value);
}
@Test
public void showActiveTimeseriesTest8() {
- String sql = "show timeseries where time > 44 or time < 4";
+ String sql = "show timeseries root.sg.** where time > 44 or time < 4";
String[] retArray =
new String[] {"root.sg.aligned.d1.s1", "root.sg.aligned.d1.s2", "root.sg.unaligned.d2.s1"};
basicShowActiveDeviceTest(sql, SHOW_TIMESERIES_COLUMN_NAMES, retArray);
- sql = "count timeseries where time > 44 or time < 4";
+ sql = "count timeseries root.sg.** where time > 44 or time < 4";
long value = 3;
basicCountActiveDeviceTest(sql, COUNT_TIMESERIES_COLUMN_NAMES, value);
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java
index e0a99b0590a..2f614a4763d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java
@@ -158,7 +158,7 @@ public class IoTDBActiveRegionScanWithModsIT extends AbstractSchemaIT {
@Test
public void showActiveDataWithMods4() {
- String sql = "show devices where time > 40";
+ String sql = "show devices root.sg.** where time > 40";
String[] retArray =
new String[] {
"root.sg.aligned.d1",
@@ -168,11 +168,11 @@ public class IoTDBActiveRegionScanWithModsIT extends AbstractSchemaIT {
};
basicShowActiveDeviceTest(sql, SHOW_DEVICES_COLUMN_NAMES, retArray);
- sql = "count devices where time > 40";
+ sql = "count devices root.sg.** where time > 40";
long value = 4;
basicCountActiveDeviceTest(sql, COUNT_DEVICES_COLUMN_NAMES, value);
- sql = "show timeseries where time > 40";
+ sql = "show timeseries root.sg.** where time > 40";
retArray =
new String[] {
"root.sg.aligned.d1.s1",
@@ -184,7 +184,7 @@ public class IoTDBActiveRegionScanWithModsIT extends AbstractSchemaIT {
};
basicShowActiveDeviceTest(sql, SHOW_TIMESERIES_COLUMN_NAMES, retArray);
- sql = "count timeseries where time > 40";
+ sql = "count timeseries root.sg.** where time > 40";
value = 6;
basicCountActiveDeviceTest(sql, COUNT_TIMESERIES_COLUMN_NAMES, value);
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java
index 775718628f9..124b3732303 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java
@@ -123,7 +123,7 @@ public class IoTDBActiveRegionScanWithTTLIT extends AbstractSchemaIT {
@Test
public void showActiveDataWithMods() {
- final String sql = "show devices where time > 0";
+ final String sql = "show devices root.sg.** where time > 0";
String[] retArray = new String[] {"root.sg.d1", "root.sg.d2"};
basicShowActiveDeviceTest(sql, SHOW_DEVICES_COLUMN_NAMES, retArray);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveSchemaQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveSchemaQueryIT.java
index 853ef3c87ae..c0e7673d7d6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveSchemaQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveSchemaQueryIT.java
@@ -64,6 +64,7 @@ public class IoTDBActiveSchemaQueryIT extends AbstractSchemaIT {
@Parameterized.BeforeParam
public static void before() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
SchemaTestMode schemaTestMode = setUpEnvironment();
if (schemaTestMode.equals(SchemaTestMode.PBTree)) {
allocateMemoryForSchemaRegion(10000);
@@ -198,10 +199,10 @@ public class IoTDBActiveSchemaQueryIT extends AbstractSchemaIT {
"count timeseries root.sg.** where time=1",
new HashSet<>(Collections.singletonList("3,")));
// 3. Check non-root user
- statement.execute("CREATE USER user1 'password'");
+ statement.execute("CREATE USER user1 'password123456'");
statement.execute("GRANT READ_SCHEMA ON root.sg.d0.s1 TO USER user1");
statement.execute("GRANT READ_SCHEMA ON root.sg.d3.s1 TO USER user1");
- try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement userStmt = userCon.createStatement()) {
// 3.1 Without read data permission, result set should be empty
try (ResultSet resultSet =
@@ -215,7 +216,7 @@ public class IoTDBActiveSchemaQueryIT extends AbstractSchemaIT {
}
statement.execute("GRANT READ_DATA ON root.sg.d0.s1 TO USER user1");
statement.execute("GRANT READ_DATA ON root.sg.d3.s1 TO USER user1");
- try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement userStmt = userCon.createStatement()) {
// 3.2 With read data permission, result set should not be empty
expected =
@@ -308,10 +309,10 @@ public class IoTDBActiveSchemaQueryIT extends AbstractSchemaIT {
"count devices root.sg.* where time=1",
new HashSet<>(Collections.singletonList("1,")));
// 3. Check non-root user
- statement.execute("CREATE USER user1 'password'");
+ statement.execute("CREATE USER user1 'password123456'");
statement.execute("GRANT READ_SCHEMA ON root.sg.d0.s1 TO USER user1");
statement.execute("GRANT READ_SCHEMA ON root.sg.d3.s1 TO USER user1");
- try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement userStmt = userCon.createStatement()) {
// 3.1 Without read data permission, result set should be empty
try (ResultSet resultSet = userStmt.executeQuery("show devices root.sg.* where time>0")) {
@@ -324,7 +325,7 @@ public class IoTDBActiveSchemaQueryIT extends AbstractSchemaIT {
}
statement.execute("GRANT READ_DATA ON root.sg.d0.s1 TO USER user1");
statement.execute("GRANT READ_DATA ON root.sg.d3.s1 TO USER user1");
- try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("user1", "password123456");
Statement userStmt = userCon.createStatement()) {
// 3.2 With read data permission, result set should not be empty
expected =
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java
index 136cbb7263a..c8f2bd579f7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java
@@ -37,6 +37,7 @@ public class IoTDBSelectInto2IT extends IoTDBSelectIntoIT {
@BeforeClass
public static void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv()
.getConfig()
.getCommonConfig()
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java
index 25faa5b1b0d..88832ce8c40 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java
@@ -37,6 +37,7 @@ public class IoTDBSelectInto3IT extends IoTDBSelectIntoIT {
@BeforeClass
public static void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv()
.getConfig()
.getCommonConfig()
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java
index b92176d182d..620e2718b04 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java
@@ -151,6 +151,7 @@ public class IoTDBSelectIntoIT {
@BeforeClass
public static void setUp() throws Exception {
+ EnvFactory.getEnv().getConfig().getCommonConfig().setEnforceStrongPassword(false);
EnvFactory.getEnv().getConfig().getCommonConfig().setQueryThreadCount(1);
// if we don't change this configuration, we may get an error like: Cannot reserve XXXX bytes of
// direct buffer memory
@@ -597,11 +598,11 @@ public class IoTDBSelectIntoIT {
public void testPermission1() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser1 'temppw1'");
+ adminStmt.execute("CREATE USER tempuser1 'temppw1123456'");
adminStmt.execute("GRANT WRITE_DATA on root.sg_bk.** TO USER tempuser1;");
ResultSet resultSet;
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser1", "temppw1");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser1", "temppw1123456");
Statement userStmt = userCon.createStatement()) {
userStmt.executeQuery(
"select s1, s2 into root.sg_bk.new_d(t1, t2, t3, t4) from root.sg.*;");
@@ -620,10 +621,10 @@ public class IoTDBSelectIntoIT {
public void testPermission2() throws SQLException {
try (Connection adminCon = EnvFactory.getEnv().getConnection();
Statement adminStmt = adminCon.createStatement()) {
- adminStmt.execute("CREATE USER tempuser2 'temppw2'");
+ adminStmt.execute("CREATE USER tempuser2 'temppw2123456'");
adminStmt.execute("GRANT WRITE_DATA on root.sg.** TO USER tempuser2;");
- try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser2", "temppw2");
+ try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser2", "temppw2123456");
Statement userStmt = userCon.createStatement()) {
userStmt.executeQuery(
"select s1, s2 into root.sg_bk.new_d(t1, t2, t3, t4) from root.sg.*;");
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java b/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
index 7e4d69f9b1b..d9abff18f67 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java
@@ -652,7 +652,8 @@ public class TestUtils {
public static void assertResultSetEqual(
final ResultSet actualResultSet,
final String expectedHeader,
- final Collection<String> expectedResult) {
+ final Collection<String> expectedResult,
+ final boolean printResult) {
try {
final ResultSetMetaData resultSetMetaData = actualResultSet.getMetaData();
final StringBuilder header = new StringBuilder();
@@ -660,16 +661,36 @@ public class TestUtils {
header.append(resultSetMetaData.getColumnName(i)).append(",");
}
assertEquals(expectedHeader, header.toString());
+ if (printResult) {
+ System.out.println(header);
+ }
final Collection<String> actualRetSet =
expectedResult instanceof Set ? new HashSet<>() : new ArrayList<>();
+ int rowCount = 0;
while (actualResultSet.next()) {
+ if (printResult) {
+ System.out.println("Row " + rowCount++);
+ }
StringBuilder builder = new StringBuilder();
for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
builder.append(actualResultSet.getString(i)).append(",");
+ if (printResult) {
+ System.out.println(
+ "Column "
+ + i
+ + "("
+ + resultSetMetaData.getColumnName(i)
+ + ")"
+ + ": "
+ + actualResultSet.getString(i));
+ }
}
actualRetSet.add(builder.toString());
+ if (printResult) {
+ System.out.println(builder);
+ }
}
assertEquals(expectedResult, actualRetSet);
} catch (final Exception e) {
@@ -678,6 +699,13 @@ public class TestUtils {
}
}
+ public static void assertResultSetEqual(
+ final ResultSet actualResultSet,
+ final String expectedHeader,
+ final Collection<String> expectedResult) {
+ assertResultSetEqual(actualResultSet, expectedHeader, expectedResult, false);
+ }
+
public static void assertResultSetEqual(
ResultSet actualResultSet,
String expectedHeader,
@@ -846,25 +874,32 @@ public class TestUtils {
}
}
- public static boolean tryExecuteNonQueryWithRetry(BaseEnv env, String sql) {
+ public static boolean tryExecuteNonQueryWithRetry(
+ BaseEnv env, String sql, Connection defaultConnection) {
return tryExecuteNonQueryWithRetry(
- env, sql, SessionConfig.DEFAULT_USER, SessionConfig.DEFAULT_PASSWORD);
+ env, sql, SessionConfig.DEFAULT_USER, SessionConfig.DEFAULT_PASSWORD, defaultConnection);
}
public static boolean tryExecuteNonQueryWithRetry(
- String dataBaseName, String sqlDialect, BaseEnv env, String sql) {
+ String dataBaseName,
+ String sqlDialect,
+ BaseEnv env,
+ String sql,
+ Connection defaultConnection) {
return tryExecuteNonQueryWithRetry(
env,
sql,
SessionConfig.DEFAULT_USER,
SessionConfig.DEFAULT_PASSWORD,
dataBaseName,
- sqlDialect);
+ sqlDialect,
+ defaultConnection);
}
public static boolean tryExecuteNonQueryWithRetry(
- BaseEnv env, String sql, String userName, String password) {
- return tryExecuteNonQueriesWithRetry(env, Collections.singletonList(sql), userName, password);
+ BaseEnv env, String sql, String userName, String password, Connection defaultConnection) {
+ return tryExecuteNonQueriesWithRetry(
+ env, Collections.singletonList(sql), userName, password, defaultConnection);
}
public static boolean tryExecuteNonQueryWithRetry(
@@ -873,37 +908,56 @@ public class TestUtils {
String userName,
String password,
String dataBaseName,
- String sqlDialect) {
+ String sqlDialect,
+ Connection defaultConnection) {
return tryExecuteNonQueriesWithRetry(
- env, Collections.singletonList(sql), userName, password, dataBaseName, sqlDialect);
+ env,
+ Collections.singletonList(sql),
+ userName,
+ password,
+ dataBaseName,
+ sqlDialect,
+ defaultConnection);
}
- public static boolean tryExecuteNonQueriesWithRetry(BaseEnv env, List<String> sqlList) {
+ public static boolean tryExecuteNonQueriesWithRetry(
+ BaseEnv env, List<String> sqlList, Connection defaultConnection) {
return tryExecuteNonQueriesWithRetry(
env,
sqlList,
SessionConfig.DEFAULT_USER,
SessionConfig.DEFAULT_PASSWORD,
null,
- TREE_SQL_DIALECT);
+ TREE_SQL_DIALECT,
+ defaultConnection);
}
public static boolean tryExecuteNonQueriesWithRetry(
- String dataBase, String sqlDialect, BaseEnv env, List<String> sqlList) {
+ String dataBase,
+ String sqlDialect,
+ BaseEnv env,
+ List<String> sqlList,
+ Connection defaultConnection) {
return tryExecuteNonQueriesWithRetry(
env,
sqlList,
SessionConfig.DEFAULT_USER,
SessionConfig.DEFAULT_PASSWORD,
dataBase,
- sqlDialect);
+ sqlDialect,
+ defaultConnection);
}
// This method will not throw failure given that a failure is encountered.
// Instead, it returns a flag to indicate the result of the execution.
public static boolean tryExecuteNonQueriesWithRetry(
- BaseEnv env, List<String> sqlList, String userName, String password) {
- return tryExecuteNonQueriesWithRetry(env, sqlList, userName, password, null, TREE_SQL_DIALECT);
+ BaseEnv env,
+ List<String> sqlList,
+ String userName,
+ String password,
+ Connection defaultConnection) {
+ return tryExecuteNonQueriesWithRetry(
+ env, sqlList, userName, password, null, TREE_SQL_DIALECT, defaultConnection);
}
public static boolean tryExecuteNonQueriesWithRetry(
@@ -912,17 +966,28 @@ public class TestUtils {
String userName,
String password,
String dataBase,
- String sqlDialect) {
+ String sqlDialect,
+ Connection defaultConnection) {
int lastIndex = 0;
+ Connection localConnection = null;
+ Connection connectionToUse = defaultConnection;
+ Statement statement = null;
for (int retryCountLeft = 10; retryCountLeft >= 0; retryCountLeft--) {
- try (Connection connection =
+ try {
+ // create a new connection if default is not provided or the previous is broken
+ if (connectionToUse == null) {
+ localConnection =
env.getConnection(
userName,
password,
BaseEnv.TABLE_SQL_DIALECT.equals(sqlDialect)
? BaseEnv.TABLE_SQL_DIALECT
: TREE_SQL_DIALECT);
- Statement statement = connection.createStatement()) {
+ connectionToUse = localConnection;
+ }
+ if (statement == null) {
+ statement = connectionToUse.createStatement();
+ }
if (BaseEnv.TABLE_SQL_DIALECT.equals(sqlDialect) && dataBase != null) {
statement.execute("use " + dataBase);
}
@@ -932,6 +997,18 @@ public class TestUtils {
}
return true;
} catch (SQLException e) {
+ // the default connection should be closed by the upper level
+ // while the local connection should be closed here
+ if (connectionToUse == localConnection && localConnection != null) {
+ try {
+ localConnection.close();
+ localConnection = null;
+ } catch (SQLException ex) {
+ // ignore
+ }
+ }
+ connectionToUse = null;
+
if (retryCountLeft > 0) {
try {
Thread.sleep(10000);
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/TableModelUtils.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/TableModelUtils.java
index 635dbcd97bd..d772e4a41f6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/TableModelUtils.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/TableModelUtils.java
@@ -113,7 +113,7 @@ public class TableModelUtils {
}
list.add("flush");
return TestUtils.tryExecuteNonQueriesWithRetry(
- dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list);
+ dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list, null);
}
public static boolean insertData(
@@ -164,7 +164,7 @@ public class TableModelUtils {
i));
}
return TestUtils.tryExecuteNonQueriesWithRetry(
- dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list);
+ dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list, null);
}
public static boolean insertDataNotThrowError(
@@ -181,7 +181,7 @@ public class TableModelUtils {
tableName, i, i, i, i, i, i, i, i, i, i, getDateStr(i), i, i));
}
return TestUtils.tryExecuteNonQueriesWithRetry(
- dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list);
+ dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list, null);
}
public static boolean insertData(
@@ -247,7 +247,7 @@ public class TableModelUtils {
list.add(
String.format("delete from %s where time >= %s and time <= %s", tableName, start, end));
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list)) {
+ dataBaseName, BaseEnv.TABLE_SQL_DIALECT, baseEnv, list, null)) {
fail();
}
}
@@ -811,6 +811,9 @@ public class TableModelUtils {
final ResultSet resultSet = statement.executeQuery("show pipes");
int count = 0;
while (resultSet.next()) {
+ if (resultSet.getString("ID").startsWith("__consensus")) {
+ continue;
+ }
count++;
}
return count;
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/AbstractPipeTableModelDualManualIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/AbstractPipeTableModelDualManualIT.java
index dd921f33bc7..899c123c56e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/AbstractPipeTableModelDualManualIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/AbstractPipeTableModelDualManualIT.java
@@ -49,6 +49,7 @@ public abstract class AbstractPipeTableModelDualManualIT {
.setAutoCreateSchemaEnabled(true)
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+ .setEnforceStrongPassword(false)
.setIsPipeEnableMemoryCheck(false);
receiverEnv
.getConfig()
@@ -56,11 +57,14 @@ public abstract class AbstractPipeTableModelDualManualIT {
.setAutoCreateSchemaEnabled(true)
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+ .setEnforceStrongPassword(false)
.setIsPipeEnableMemoryCheck(false);
// 10 min, assert that the operations will not time out
senderEnv.getConfig().getCommonConfig().setDnConnectionTimeoutMs(600000);
receiverEnv.getConfig().getCommonConfig().setDnConnectionTimeoutMs(600000);
+
+ senderEnv.getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
}
@After
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeAlterIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeAlterIT.java
index 61b29c30cc2..d85383655a9 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeAlterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeAlterIT.java
@@ -77,6 +77,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -109,6 +110,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -129,6 +131,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -165,6 +168,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -200,6 +204,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -243,6 +248,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -276,6 +282,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -309,6 +316,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -344,6 +352,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -376,6 +385,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeTableModelDualManualIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeDataSinkIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeDataSinkIT.java
index 384caec5c74..6efc15b45b7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeDataSinkIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeDataSinkIT.java
@@ -79,7 +79,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (0, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (0, 1)", "flush"),
+ null)) {
return;
}
@@ -113,13 +114,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("0,1.0,", "1,1.0,"))),
handleFailure);
@@ -167,7 +169,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -203,7 +206,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"),
+ null)) {
return;
}
@@ -211,7 +215,7 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("1,1.0,", "2,1.0,"))),
handleFailure);
@@ -235,7 +239,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.vehicle.d0(time, s1) values (4, 1)",
"insert into root.vehicle.d0(time, s1) values (3, 1), (0, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -246,7 +251,7 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(
new HashSet<>(Arrays.asList("0,1.0,", "1,1.0,", "2,1.0,", "3,1.0,", "4,1.0,"))),
@@ -290,7 +295,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -375,7 +381,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -409,7 +416,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"),
+ null)) {
return;
}
@@ -417,7 +425,7 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("1,1.0,", "2,1.0,"))),
handleFailure);
@@ -427,13 +435,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.vehicle.d0(time, s1) values (4, 1)",
"insert into root.vehicle.d0(time, s1) values (3, 1), (0, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(
new HashSet<>(Arrays.asList("0,1.0,", "1,1.0,", "2,1.0,", "3,1.0,", "4,1.0,"))),
@@ -729,7 +738,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -772,7 +782,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"create timeSeries root.vehicle.d0.s1 int32",
"insert into root.vehicle.d0(time, s1) values (2, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -783,7 +794,7 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("1,1.0,", "2,1.0,"))));
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeLifeCycleIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeLifeCycleIT.java
index af11dd3b31e..bd253933c5c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeLifeCycleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeLifeCycleIT.java
@@ -152,7 +152,8 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
}
// wait for flush to complete
- if (!TestUtils.tryExecuteNonQueriesWithRetry(senderEnv, Collections.singletonList("flush"))) {
+ if (!TestUtils.tryExecuteNonQueriesWithRetry(
+ senderEnv, Collections.singletonList("flush"), null)) {
return;
}
Thread.sleep(10000);
@@ -529,7 +530,7 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
t.join();
client.stopPipe("p1");
client.startPipe("p1");
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
TableModelUtils.assertCountData(
@@ -615,7 +616,7 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
final String receiverIp = receiverDataNode.getIp();
final int receiverPort = receiverDataNode.getPort();
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -651,7 +652,7 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -692,7 +693,7 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", null)) {
return;
}
insertResult = TableModelUtils.insertData("test", "test", 300, 400, receiverEnv);
@@ -719,7 +720,7 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
@Test
public void testPermission() {
- createUser(senderEnv, "test", "test123");
+ createUser(senderEnv, "test", "test123123456");
assertTableNonQueryTestFail(
senderEnv,
@@ -731,35 +732,35 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
+ ")",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableNonQueryTestFail(
senderEnv,
"drop pipe testPipe",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableTestFail(
senderEnv,
"show pipes",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableNonQueryTestFail(
senderEnv,
"start pipe testPipe",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableNonQueryTestFail(
senderEnv,
"stop pipe testPipe",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableNonQueryTestFail(
@@ -767,21 +768,21 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeTableModelDualManualIT {
"create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableNonQueryTestFail(
senderEnv,
"drop pipePlugin TestProcessor",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
assertTableTestFail(
senderEnv,
"show pipe plugins",
"803: Access Denied: No permissions for this operation, only root user is allowed",
"test",
- "test123",
+ "test123123456",
null);
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipePermissionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipePermissionIT.java
index 7a3f90e687a..7f5d63f26fb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipePermissionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipePermissionIT.java
@@ -68,7 +68,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
.setDefaultSchemaRegionGroupNumPerDatabase(1)
.setTimestampPrecision("ms")
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
- .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
+ .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+ .setIsPipeEnableMemoryCheck(false);
receiverEnv
.getConfig()
.getCommonConfig()
@@ -77,6 +78,7 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setDataRegionConsensusProtocolClass(ConsensusFactory.IOT_CONSENSUS)
+ .setIsPipeEnableMemoryCheck(false)
.setSchemaReplicationFactor(3)
.setDataReplicationFactor(2);
@@ -90,7 +92,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
@Test
public void testSourcePermission() {
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "create user `thulab` 'passwd'")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv, "create user `thulab` 'passwD@123456'", null)) {
return;
}
@@ -161,7 +164,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
// Successfully alter
try (final Connection connection = senderEnv.getConnection(BaseEnv.TABLE_SQL_DIALECT);
final Statement statement = connection.createStatement()) {
- statement.execute("alter pipe a2b modify source ('username'='thulab', 'password'='passwd')");
+ statement.execute(
+ "alter pipe a2b modify source ('username'='thulab', 'password'='passwD@123456')");
} catch (final SQLException e) {
e.printStackTrace();
fail("Alter pipe shall not fail if user and password are specified");
@@ -179,7 +183,7 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
// Grant some privilege
if (!TestUtils.tryExecuteNonQueryWithRetry(
- "test", BaseEnv.TABLE_SQL_DIALECT, senderEnv, "grant INSERT on any to user thulab")) {
+ "test", BaseEnv.TABLE_SQL_DIALECT, senderEnv, "grant INSERT on any to user thulab", null)) {
return;
}
@@ -221,7 +225,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
"test",
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- Arrays.asList("grant SELECT on any to user thulab", "start pipe a2b"))) {
+ Arrays.asList("grant SELECT on any to user thulab", "start pipe a2b"),
+ null)) {
return;
}
@@ -246,7 +251,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "create user testUser 'password'")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv, "create user testUser 'passwD@123456'", null)) {
return;
}
@@ -266,7 +272,7 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
connectorAttributes.put("connector.ip", receiverIp);
connectorAttributes.put("connector.port", Integer.toString(receiverPort));
connectorAttributes.put("connector.user", "testUser");
- connectorAttributes.put("connector.password", "password");
+ connectorAttributes.put("connector.password", "passwD@123456");
final TSStatus status =
client.createPipe(
@@ -299,7 +305,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
"information_schema",
BaseEnv.TABLE_SQL_DIALECT,
receiverEnv,
- "grant insert,create on database test to user testUser")) {
+ "grant insert,create on database test to user testUser",
+ null)) {
return;
}
@@ -338,7 +345,8 @@ public class IoTDBPipePermissionIT extends AbstractPipeTableModelDualManualIT {
"information_schema",
BaseEnv.TABLE_SQL_DIALECT,
receiverEnv,
- "grant insert,create on database test2 to user testUser")) {
+ "grant insert,create on database test2 to user testUser",
+ null)) {
return;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSourceIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSourceIT.java
index 1b43ce561c0..bbb9a26ee91 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSourceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSourceIT.java
@@ -72,6 +72,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
.setEnableSeqSpaceCompaction(false)
.setEnableUnseqSpaceCompaction(false)
.setEnableCrossSpaceCompaction(false);
+ senderEnv.getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
+
receiverEnv
.getConfig()
.getCommonConfig()
@@ -133,7 +135,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.db1.d1 (time, at1) values (1, 10)",
"insert into root.db2.d1 (time, at1) values (1, 20)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -168,7 +171,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.db1.d1 (time, at1) values (2, 11)",
"insert into root.db2.d1 (time, at1) values (2, 21)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -192,7 +196,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db*.**",
"count(root.db1.d1.at1),count(root.db2.d1.at1),",
Collections.singleton("2,2,"),
handleFailure);
@@ -224,7 +228,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
"insert into root.db.d2 (time, at1) values (1, 20)",
"insert into root.db.d3 (time, at1) values (1, 30)",
"insert into root.db.d4 (time, at1) values (1, 40)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -307,7 +312,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
"insert into root.db.d1 (time, at1) values (2, 11)",
"insert into root.db.d2 (time, at1) values (2, 21)",
"insert into root.db.d3 (time, at1) values (2, 31)",
- "insert into root.db.d4 (time, at1) values (2, 41), (3, 51)"))) {
+ "insert into root.db.d4 (time, at1) values (2, 41), (3, 51)"),
+ null)) {
return;
}
@@ -325,13 +331,13 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.** where time <= 1",
+ "select count(*) from root.db.** where time <= 1",
"count(root.db.d4.at1),count(root.db.d2.at1),count(root.db.d3.at1),",
Collections.singleton("1,0,1,"),
handleFailure);
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.** where time >= 2",
+ "select count(*) from root.db.** where time >= 2",
"count(root.db.d4.at1),count(root.db.d2.at1),count(root.db.d3.at1),",
Collections.singleton("2,1,0,"),
handleFailure);
@@ -368,7 +374,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
+ " values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)",
"insert into root.db.d2 (time, at1)"
+ " values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -384,7 +391,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
}
// wait for flush to complete
- if (!TestUtils.tryExecuteNonQueriesWithRetry(senderEnv, Collections.singletonList("flush"))) {
+ if (!TestUtils.tryExecuteNonQueriesWithRetry(
+ senderEnv, Collections.singletonList("flush"), null)) {
return;
}
Thread.sleep(10000);
@@ -421,7 +429,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),",
Collections.singleton("2,"),
handleFailure);
@@ -439,7 +447,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d2.at1),",
Collections.singleton("2,2,"),
handleFailure);
@@ -473,7 +481,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
+ " values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)",
"insert into root.db.d2 (time, at1)"
+ " values (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -512,7 +521,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),",
Collections.singleton("3,"),
handleFailure);
@@ -525,7 +534,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.db.d3 (time, at1)"
+ " values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TableModelUtils.createDataBaseAndTable(senderEnv, "test3", "test");
@@ -535,7 +545,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d3.at1),",
Collections.singleton("3,3,"),
handleFailure);
@@ -549,7 +559,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.db.d4 (time, at1)"
+ " values (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -560,7 +571,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
}
TestUtils.assertDataAlwaysOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d3.at1),",
Collections.singleton("3,3,"),
600,
@@ -593,7 +604,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
+ " values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)",
"insert into root.db.d2 (time, at1)"
+ " values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -638,7 +650,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),",
Collections.singleton("3,"),
handleFailure);
@@ -658,7 +670,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d2.at1),",
Collections.singleton("3,3,"),
handleFailure);
@@ -702,7 +714,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
"insert into root.db.d1 (time, at1, at2)" + " values (1, 1, 2), (2, 3, 4)",
// TsFile 2, not extracted because pattern not overlapped
"insert into root.db1.d1 (time, at1, at2)" + " values (1, 1, 2), (2, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -710,8 +723,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
senderEnv,
Arrays.asList(
// TsFile 3, not extracted because time range not overlapped
- "insert into root.db.d1 (time, at1, at2)" + " values (3, 1, 2), (4, 3, 4)",
- "flush"))) {
+ "insert into root.db.d1 (time, at1, at2)" + " values (3, 1, 2), (4, 3, 4)", "flush"),
+ null)) {
return;
}
@@ -721,7 +734,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
}
// wait for flush to complete
- if (!TestUtils.tryExecuteNonQueriesWithRetry(senderEnv, Collections.singletonList("flush"))) {
+ if (!TestUtils.tryExecuteNonQueriesWithRetry(
+ senderEnv, Collections.singletonList("flush"), null)) {
return;
}
Thread.sleep(10000);
@@ -756,7 +770,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.** group by level=0",
+ "select count(*) from root.db.** group by level=0",
"count(root.*.*.*),",
Collections.singleton("4,"),
handleFailure);
@@ -816,8 +830,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
Arrays.asList(
- "insert into root.db.d1 (time, at1, at2)" + " values (1, 1, 2), (3, 3, 4)",
- "flush"))) {
+ "insert into root.db.d1 (time, at1, at2)" + " values (1, 1, 2), (3, 3, 4)", "flush"),
+ null)) {
return;
}
@@ -830,7 +844,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
Arrays.asList(
"insert into root.db.d1 (time, at1)" + " values (5, 1), (16, 3)",
"insert into root.db.d1 (time, at1, at2)" + " values (5, 1, 2), (6, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -980,6 +995,9 @@ public class IoTDBPipeSourceIT extends AbstractPipeTableModelDualManualIT {
private void assertTimeseriesCountOnReceiver(BaseEnv receiverEnv, int count) {
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton(count + ","));
+ receiverEnv,
+ "count timeseries root.db.**",
+ "count(timeseries),",
+ Collections.singleton(count + ","));
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSwitchStatusIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSwitchStatusIT.java
index 50fb130a812..599325593c6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSwitchStatusIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSwitchStatusIT.java
@@ -103,6 +103,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertTrue(
@@ -118,6 +119,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p3").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertTrue(
@@ -130,6 +132,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p2").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p2")));
@@ -138,6 +141,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
}
}
@@ -179,6 +183,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
@@ -190,17 +195,20 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), status.getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
@@ -208,6 +216,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
@@ -259,12 +268,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(
0,
showPipeResult.stream()
@@ -278,6 +289,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
.setProcessorAttributes(processorAttributes));
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
}
}
@@ -326,12 +338,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("*").getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
@@ -344,12 +358,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("*").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
@@ -362,12 +378,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeTableModelDualManualIT
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.dropPipe("*").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSyntaxIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSyntaxIT.java
index b7202a9d0d1..6c0d09aac70 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSyntaxIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeSyntaxIT.java
@@ -100,6 +100,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
for (final String pipeName : expectedPipeNames) {
Assert.assertTrue(
showPipeResult.stream()
@@ -117,6 +118,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
}
showPipeResult = client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -189,6 +191,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -262,6 +265,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(2, showPipeResult.size());
}
}
@@ -329,6 +333,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
}
}
@@ -537,6 +542,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(2, showPipeResult.size());
}
}
@@ -596,10 +602,12 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(3, showPipeResult.size());
showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true).setPipeName("p1")).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p2")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p3")));
@@ -610,6 +618,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
client.showPipe(
new TShowPipeReq().setIsTableModel(true).setPipeName("p1").setWhereClause(true))
.pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
Assert.assertTrue(showPipeResult.stream().anyMatch((o) -> o.id.equals("p2")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p3")));
@@ -700,6 +709,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeTableModelDualManualIT {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeWithLoadIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeWithLoadIT.java
index bc4e7f02053..8ca7d59225e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeWithLoadIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeWithLoadIT.java
@@ -69,13 +69,15 @@ public class IoTDBPipeWithLoadIT extends AbstractPipeTableModelDualManualIT {
// Disable sender compaction to test mods
.setEnableSeqSpaceCompaction(false)
.setEnableUnseqSpaceCompaction(false)
- .setEnableCrossSpaceCompaction(false);
+ .setEnableCrossSpaceCompaction(false)
+ .setEnforceStrongPassword(false);
receiverEnv
.getConfig()
.getCommonConfig()
.setAutoCreateSchemaEnabled(true)
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
- .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
+ .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+ .setEnforceStrongPassword(false);
// 10 min, assert that the operations will not time out
senderEnv.getConfig().getCommonConfig().setDnConnectionTimeoutMs(600000);
@@ -448,13 +450,13 @@ public class IoTDBPipeWithLoadIT extends AbstractPipeTableModelDualManualIT {
connectorAttributes.put("connector.ip", receiverIp);
connectorAttributes.put("connector.port", Integer.toString(receiverPort));
connectorAttributes.put("connector.user", "user01");
- connectorAttributes.put("connector.password", "1234");
+ connectorAttributes.put("connector.password", "1234123456789");
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
try (final Connection connection = receiverEnv.getConnection(BaseEnv.TABLE_SQL_DIALECT);
final Statement statement = connection.createStatement()) {
- statement.execute("create user user01 '1234'");
+ statement.execute("create user user01 '1234123456789'");
statement.execute("grant create on any to user user01");
} catch (final Exception e) {
fail(e.getMessage());
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeClusterIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeClusterIT.java
index 985bfe752b6..7b11f882544 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeClusterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeClusterIT.java
@@ -208,7 +208,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeTableModelDualManualIT {
connectorAttributes.put("connector.ip", receiverIp);
connectorAttributes.put("connector.port", Integer.toString(receiverPort));
connectorAttributes.put("connector.user", "root");
- connectorAttributes.put("connector.password", "root");
+ connectorAttributes.put("connector.password", "IoTDB@2011");
final TSStatus status =
client.createPipe(
@@ -591,6 +591,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeTableModelDualManualIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(30, showPipeResult.size());
}
}
@@ -664,7 +665,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeTableModelDualManualIT {
return;
}
t.join();
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -802,7 +803,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeTableModelDualManualIT {
succeedNum++;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -905,6 +906,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeTableModelDualManualIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -982,9 +984,11 @@ public class IoTDBPipeClusterIT extends AbstractPipeTableModelDualManualIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(successCount.get(), showPipeResult.size());
showPipeResult =
client.showPipe(new TShowPipeReq().setPipeName("p1").setWhereClause(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(successCount.get(), showPipeResult.size());
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeDoubleLivingIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeDoubleLivingIT.java
index 70c7e1605de..93d9697e941 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeDoubleLivingIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeDoubleLivingIT.java
@@ -111,6 +111,7 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -131,18 +132,23 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
};
// insertion on sender
- for (int i = 0; i < 100; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ try (Connection conn = senderEnv.getConnection()) {
+ for (int i = 0; i < 100; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i), conn)) {
+ return;
+ }
}
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
}
+
TableModelUtils.createDataBaseAndTable(senderEnv, "test", "test");
insertResult = TableModelUtils.insertData("test", "test", 0, 100, senderEnv);
if (!insertResult) {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -165,19 +171,26 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
fail(e.getMessage());
}
- // insertion on sender
- for (int i = 100; i < 200; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ try (Connection conn = senderEnv.getConnection()) {
+ // insertion on sender
+ for (int i = 100; i < 200; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i), conn)) {
+ return;
+ }
}
- }
- for (int i = 200; i < 300; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ for (int i = 200; i < 300; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ conn)) {
+ return;
+ }
}
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
}
+
insertResult = TableModelUtils.insertData("test", "test", 100, 200, senderEnv);
if (!insertResult) {
return;
@@ -186,7 +199,7 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
if (!insertResult) {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -209,18 +222,25 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
fail(e.getMessage());
}
- // insertion on receiver
- for (int i = 300; i < 400; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ try (Connection conn = receiverEnv.getConnection()) {
+ // insertion on receiver
+ for (int i = 300; i < 400; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ conn)) {
+ return;
+ }
}
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
}
+
insertResult = TableModelUtils.insertData("test", "test", 300, 400, receiverEnv);
if (!insertResult) {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", null)) {
return;
}
@@ -230,9 +250,9 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
expectedResSet.add(i + ",1.0,");
}
TestUtils.assertDataEventuallyOnEnv(
- senderEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ senderEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TableModelUtils.assertData("test", "test", 0, 400, senderEnv, handleFailure);
TableModelUtils.assertData("test", "test", 0, 400, receiverEnv, handleFailure);
@@ -245,18 +265,25 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
return;
}
- // insertion on receiver
- for (int i = 400; i < 500; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ try (Connection conn = receiverEnv.getConnection()) {
+ // insertion on receiver
+ for (int i = 400; i < 500; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ conn)) {
+ return;
+ }
}
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
}
+
insertResult = TableModelUtils.insertData("test", "test", 400, 500, receiverEnv);
if (!insertResult) {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", null)) {
return;
}
@@ -265,9 +292,9 @@ public class IoTDBPipeDoubleLivingIT extends AbstractPipeTableModelDualManualIT
expectedResSet.add(i + ",1.0,");
}
TestUtils.assertDataEventuallyOnEnv(
- senderEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ senderEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TableModelUtils.assertData("test", "test", 0, 500, senderEnv, handleFailure);
TableModelUtils.assertData("test", "test", 0, 500, receiverEnv, handleFailure);
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeIdempotentIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeIdempotentIT.java
index 1e02ad9963c..0bfd89c9963 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeIdempotentIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeIdempotentIT.java
@@ -133,13 +133,13 @@ public class IoTDBPipeIdempotentIT extends AbstractPipeTableModelDualManualIT {
@Test
public void testTableCreateUserIdempotent() throws Exception {
- testTableConfigIdempotent(Collections.emptyList(), "create user newUser 'password'");
+ testTableConfigIdempotent(Collections.emptyList(), "create user newUser 'password123456'");
}
@Test
public void testTableDropUserIdempotent() throws Exception {
testTableConfigIdempotent(
- Collections.singletonList("create user newUser 'password'"), "drop user newUser");
+ Collections.singletonList("create user newUser 'password123456'"), "drop user newUser");
}
@Test
@@ -156,14 +156,14 @@ public class IoTDBPipeIdempotentIT extends AbstractPipeTableModelDualManualIT {
@Test
public void testTableAlterUserIdempotent3() throws Exception {
testTableConfigIdempotent(
- Collections.singletonList("create user newUser 'password'"),
- "alter user newUser set password 'passwd'");
+ Collections.singletonList("create user newUser 'password123456'"),
+ "alter user newUser set password 'passwd123456789'");
}
@Test
public void testTableGrantRoleToUserIdempotent() throws Exception {
testTableConfigIdempotent(
- Arrays.asList("create user newUser 'password'", "create role newRole"),
+ Arrays.asList("create user newUser 'password123456'", "create role newRole"),
"grant role newRole to newUser");
}
@@ -171,7 +171,7 @@ public class IoTDBPipeIdempotentIT extends AbstractPipeTableModelDualManualIT {
public void testTableRevokeRoleFromUserIdempotent() throws Exception {
testTableConfigIdempotent(
Arrays.asList(
- "create user newUser 'password'",
+ "create user newUser 'password123456'",
"create role newRole",
"grant role newRole to newUser"),
"revoke role newRole from newUser");
@@ -180,7 +180,7 @@ public class IoTDBPipeIdempotentIT extends AbstractPipeTableModelDualManualIT {
@Test
public void testTableGrantIdempotent() throws Exception {
testTableConfigIdempotent(
- Collections.singletonList("create user newUser 'password'"),
+ Collections.singletonList("create user newUser 'password123456'"),
"grant all to user newUser with grant option");
}
@@ -188,7 +188,7 @@ public class IoTDBPipeIdempotentIT extends AbstractPipeTableModelDualManualIT {
public void testTableRevokeIdempotent() throws Exception {
testTableConfigIdempotent(
Arrays.asList(
- "create user newUser 'password'", "grant all to user newUser with grant option"),
+ "create user newUser 'password123456'", "grant all to user newUser with grant option"),
"revoke all from user newUser");
}
@@ -243,18 +243,18 @@ public class IoTDBPipeIdempotentIT extends AbstractPipeTableModelDualManualIT {
}
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- database, BaseEnv.TABLE_SQL_DIALECT, senderEnv, beforeSqlList)) {
+ database, BaseEnv.TABLE_SQL_DIALECT, senderEnv, beforeSqlList, null)) {
return;
}
if (!TestUtils.tryExecuteNonQueryWithRetry(
- database, BaseEnv.TABLE_SQL_DIALECT, receiverEnv, testSql)) {
+ database, BaseEnv.TABLE_SQL_DIALECT, receiverEnv, testSql, null)) {
return;
}
// Create an idempotent conflict
if (!TestUtils.tryExecuteNonQueryWithRetry(
- database, BaseEnv.TABLE_SQL_DIALECT, senderEnv, testSql)) {
+ database, BaseEnv.TABLE_SQL_DIALECT, senderEnv, testSql, null)) {
return;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeMetaIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeMetaIT.java
index 49e48df4938..355c36db2aa 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeMetaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeMetaIT.java
@@ -104,7 +104,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
"alter table table1 drop column c",
"alter table table1 set properties ttl=default",
"insert into table1 (a, b, d) values(1, 1, 1)",
- "create table noTransferTable(a id, b attribute, c int32) with (ttl=3000)"))) {
+ "create table noTransferTable(a id, b attribute, c int32) with (ttl=3000)"),
+ null)) {
return;
}
@@ -122,7 +123,11 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
receiverEnv, "show devices from table1", "a,b,", Collections.singleton("1,1,"), dbName);
if (!TestUtils.tryExecuteNonQueryWithRetry(
- dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "insert into table1 (a, b) values(1, 2)")) {
+ dbName,
+ BaseEnv.TABLE_SQL_DIALECT,
+ senderEnv,
+ "insert into table1 (a, b) values(1, 2)",
+ null)) {
return;
}
@@ -130,7 +135,7 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
receiverEnv, "show devices from table1", "a,b,", Collections.singleton("1,2,"), dbName);
if (!TestUtils.tryExecuteNonQueryWithRetry(
- dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "update table1 set b = '3'")) {
+ dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "update table1 set b = '3'", null)) {
return;
}
@@ -138,7 +143,7 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
receiverEnv, "show devices from table1", "a,b,", Collections.singleton("1,3,"), dbName);
if (!TestUtils.tryExecuteNonQueryWithRetry(
- dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "delete from table1")) {
+ dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "delete from table1", null)) {
return;
}
@@ -149,7 +154,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
dbName,
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- "delete devices from table1 where a = '1'")) {
+ "delete devices from table1 where a = '1'",
+ null)) {
return;
}
@@ -177,7 +183,7 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
dbName);
if (!TestUtils.tryExecuteNonQueryWithRetry(
- dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "drop table table1")) {
+ dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "drop table table1", null)) {
return;
}
@@ -189,7 +195,7 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
dbName);
if (!TestUtils.tryExecuteNonQueryWithRetry(
- dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "drop database test")) {
+ dbName, BaseEnv.TABLE_SQL_DIALECT, senderEnv, "drop database test", null)) {
return;
}
@@ -239,7 +245,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
"create database root.test",
"alter database root.test with schema_region_group_num=2, data_region_group_num=3",
"create timeSeries root.test.d1.s1 int32",
- "insert into root.test.d1 (s1) values (1)"))) {
+ "insert into root.test.d1 (s1) values (1)"),
+ null)) {
return;
}
@@ -296,7 +303,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
"create table table1(a id, b attribute, c int32) with (ttl=3000)",
"alter table table1 add column d int64",
"alter table table1 drop column b",
- "alter table table1 set properties ttl=default"))) {
+ "alter table table1 set properties ttl=default"),
+ null)) {
return;
}
@@ -321,8 +329,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList(
- "create user testUser 'password'", "grant all on root.** to user testUser"))) {
+ Arrays.asList("create user testUser 'password'", "grant all on root.** to user testUser"),
+ null)) {
return;
}
@@ -333,7 +341,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
senderEnv,
Arrays.asList(
"grant create on db.tb to user testUser",
- "grant drop on database test to user testUser"))) {
+ "grant drop on database test to user testUser"),
+ null)) {
return;
}
@@ -367,7 +376,8 @@ public class IoTDBPipeMetaIT extends AbstractPipeTableModelDualManualIT {
dbName,
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- "grant alter on any to user testUser with grant option")) {
+ "grant alter on any to user testUser with grant option",
+ null)) {
return;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkCompressionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkCompressionIT.java
index 6747b3016e1..b5ff0363cde 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkCompressionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkCompressionIT.java
@@ -72,6 +72,7 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
.setAutoCreateSchemaEnabled(true)
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
+ senderEnv.getConfig().getDataNodeConfig().setDataNodeMemoryProportion("3:3:1:1:3:1");
receiverEnv
.getConfig()
.getCommonConfig()
@@ -145,7 +146,8 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
Arrays.asList(
"insert into root.db.d1(time, s1) values (2010-01-01T10:00:00+08:00, 1)",
"insert into root.db.d1(time, s1) values (2010-01-02T10:00:00+08:00, 2)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
final Map<String, String> extractorAttributes = new HashMap<>();
@@ -165,7 +167,7 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
connectorAttributes.put("connector.ip", receiverIp);
connectorAttributes.put("connector.port", Integer.toString(receiverPort));
connectorAttributes.put("connector.user", "root");
- connectorAttributes.put("connector.password", "root");
+ connectorAttributes.put("connector.password", "IoTDB@2011");
connectorAttributes.put("connector.compressor", compressionTypes);
final TSStatus status =
@@ -180,7 +182,7 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"),
handleFailure);
@@ -194,7 +196,8 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
"insert into root.db.d1(time, s1) values (6, 6)",
"insert into root.db.d1(time, s1) values (7, 7)",
"insert into root.db.d1(time, s1) values (8, 8)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -202,7 +205,7 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("8,"),
handleFailure);
@@ -234,7 +237,8 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
"insert into root.db.d1(time, s3) values (1, 1)",
"insert into root.db.d1(time, s4) values (1, 1)",
"insert into root.db.d1(time, s5) values (1, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -329,6 +333,7 @@ public class IoTDBPipeSinkCompressionIT extends AbstractPipeTableModelDualManual
}
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(
3,
showPipeResult.stream()
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkParallelIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkParallelIT.java
index 889985312a2..f90d0344eca 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkParallelIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeSinkParallelIT.java
@@ -100,7 +100,8 @@ public class IoTDBPipeSinkParallelIT extends AbstractPipeTableModelDualManualIT
"insert into root.sg1.d1(time, s1) values (1, 2)",
"insert into root.sg1.d1(time, s1) values (2, 3)",
"insert into root.sg1.d1(time, s1) values (3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TableModelUtils.insertData("test", "test", 100, 200, senderEnv);
@@ -110,7 +111,7 @@ public class IoTDBPipeSinkParallelIT extends AbstractPipeTableModelDualManualIT
expectedResSet.add("3,4.0,");
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.sg1.**",
"Time,root.sg1.d1.s1,",
expectedResSet,
handleFailure);
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionISessionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionISessionIT.java
index 5ffa8fadfbf..f4dfca32c4c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionISessionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionISessionIT.java
@@ -187,7 +187,8 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeTableModelDua
null,
"table",
env,
- Arrays.asList("create database if not exists test", "use test", tableCreation));
+ Arrays.asList("create database if not exists test", "use test", tableCreation),
+ null);
}
private void createDataPipe(boolean isTSFile) {
@@ -202,7 +203,7 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeTableModelDua
receiverEnv.getPort(),
isTSFile ? "tsfile" : "tablet");
TestUtils.tryExecuteNonQueriesWithRetry(
- null, BaseEnv.TABLE_SQL_DIALECT, senderEnv, Collections.singletonList(sql));
+ null, BaseEnv.TABLE_SQL_DIALECT, senderEnv, Collections.singletonList(sql), null);
}
private void validateResultSet(
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionIT.java
index 23297555d9c..744f1e25135 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeTypeConversionIT.java
@@ -251,7 +251,8 @@ public class IoTDBPipeTypeConversionIT extends AbstractPipeTableModelDualManualI
null,
BaseEnv.TABLE_SQL_DIALECT,
env,
- Arrays.asList("create database if not exists test", "use test", timeSeriesCreationQuery));
+ Arrays.asList("create database if not exists test", "use test", timeSeriesCreationQuery),
+ null);
}
private void createDataPipe() {
@@ -263,7 +264,7 @@ public class IoTDBPipeTypeConversionIT extends AbstractPipeTableModelDualManualI
+ " with sink ('node-urls'='%s:%s','batch.enable'='false','sink.format'='tablet')",
receiverEnv.getIP(), receiverEnv.getPort());
TestUtils.tryExecuteNonQueriesWithRetry(
- null, BaseEnv.TABLE_SQL_DIALECT, senderEnv, Collections.singletonList(sql));
+ null, BaseEnv.TABLE_SQL_DIALECT, senderEnv, Collections.singletonList(sql), null);
}
private List<Pair> createTestDataForType(String sourceType) {
@@ -302,35 +303,40 @@ public class IoTDBPipeTypeConversionIT extends AbstractPipeTableModelDualManualI
"test",
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- createInsertStatementsForString(testData, sourceType.name(), targetType.name()));
+ createInsertStatementsForString(testData, sourceType.name(), targetType.name()),
+ null);
return;
case TIMESTAMP:
TestUtils.tryExecuteNonQueriesWithRetry(
"test",
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- createInsertStatementsForTimestamp(testData, sourceType.name(), targetType.name()));
+ createInsertStatementsForTimestamp(testData, sourceType.name(), targetType.name()),
+ null);
return;
case DATE:
TestUtils.tryExecuteNonQueriesWithRetry(
"test",
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- createInsertStatementsForLocalDate(testData, sourceType.name(), targetType.name()));
+ createInsertStatementsForLocalDate(testData, sourceType.name(), targetType.name()),
+ null);
return;
case BLOB:
TestUtils.tryExecuteNonQueriesWithRetry(
"test",
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- createInsertStatementsForBlob(testData, sourceType.name(), targetType.name()));
+ createInsertStatementsForBlob(testData, sourceType.name(), targetType.name()),
+ null);
return;
default:
TestUtils.tryExecuteNonQueriesWithRetry(
"test",
BaseEnv.TABLE_SQL_DIALECT,
senderEnv,
- createInsertStatementsForNumeric(testData, sourceType.name(), targetType.name()));
+ createInsertStatementsForNumeric(testData, sourceType.name(), targetType.name()),
+ null);
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/AbstractPipeDualTreeModelAutoIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/AbstractPipeDualTreeModelAutoIT.java
index 4aa06e7acf3..7f6063688a0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/AbstractPipeDualTreeModelAutoIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/AbstractPipeDualTreeModelAutoIT.java
@@ -56,13 +56,17 @@ public abstract class AbstractPipeDualTreeModelAutoIT {
.getCommonConfig()
.setAutoCreateSchemaEnabled(true)
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
- .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
+ .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+ .setEnforceStrongPassword(false);
+ senderEnv.getConfig().getDataNodeConfig().setDataNodeMemoryProportion("3:3:1:1:9:1");
receiverEnv
.getConfig()
.getCommonConfig()
.setAutoCreateSchemaEnabled(true)
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
- .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
+ .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+ .setEnforceStrongPassword(false);
+ receiverEnv.getConfig().getDataNodeConfig().setDataNodeMemoryProportion("3:3:1:1:9:1");
// 10 min, assert that the operations will not time out
senderEnv.getConfig().getCommonConfig().setDnConnectionTimeoutMs(600000);
@@ -82,7 +86,7 @@ public abstract class AbstractPipeDualTreeModelAutoIT {
.pollInterval(2, TimeUnit.SECONDS)
.until(
() -> {
- if (!TestUtils.tryExecuteNonQueryWithRetry(env, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(env, "flush", null)) {
return false;
}
return env.getDataNodeWrapperList().stream()
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAlterIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAlterIT.java
index 564bc34aee5..5e2291f3760 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAlterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAlterIT.java
@@ -76,6 +76,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -107,6 +108,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -124,6 +126,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -161,6 +164,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -196,6 +200,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -238,6 +243,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -274,6 +280,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -310,6 +317,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -346,6 +354,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -382,6 +391,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -418,6 +428,7 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -490,7 +501,8 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
senderEnv,
Arrays.asList(
"insert into root.db.d1 (time, at1) values (1000, 1), (1500, 2), (2000, 3), (2500, 4), (3000, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
fail();
}
@@ -517,7 +529,8 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
senderEnv,
Arrays.asList(
"insert into root.db.d2 (time, at1) values (11000, 1), (11500, 2), (12000, 3), (12500, 4), (13000, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
fail();
}
@@ -526,7 +539,8 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
senderEnv,
Arrays.asList(
"insert into root.db.d1 (time, at1) values (11000, 1), (11500, 2), (12000, 3), (12500, 4), (13000, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
fail();
}
@@ -542,12 +556,15 @@ public class IoTDBPipeAlterIT extends AbstractPipeDualTreeModelAutoIT {
// Create database on sender
if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, "create timeSeries root.db.d2.at2 int32")) {
+ senderEnv, "create timeSeries root.db.d2.at2 int32", null)) {
fail();
}
// Check database on receiver
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count timeSeries", "count(timeseries),", Collections.singleton("3,"));
+ receiverEnv,
+ "count timeSeries root.db.**",
+ "count(timeseries),",
+ Collections.singleton("3,"));
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java
index 1dd102f0e59..06d21c85d67 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java
@@ -65,7 +65,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (0, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (0, 1)", "flush"),
+ null)) {
return;
}
@@ -96,13 +97,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("0,1.0,", "1,1.0,"))));
}
@@ -131,7 +133,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -164,13 +167,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("1,1.0,", "2,1.0,"))));
@@ -193,13 +197,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.vehicle.d0(time, s1) values (4, 1)",
"insert into root.vehicle.d0(time, s1) values (3, 1), (0, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(
new HashSet<>(Arrays.asList("0,1.0,", "1,1.0,", "2,1.0,", "3,1.0,", "4,1.0,"))));
@@ -244,13 +249,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (0, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (0, 1)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.singleton("0,1.0,"));
}
@@ -332,7 +338,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.ln.wf01.wt02(time, int32, boolean) values (20000, 123, false)",
// For pattern parse
"insert into root.ln.wf01.wt11(time, redundant_data) values (20000, -1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -384,7 +391,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -416,13 +424,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (2, 1)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("1,1.0,", "2,1.0,"))));
@@ -445,13 +454,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.vehicle.d0(time, s1) values (4, 1)",
"insert into root.vehicle.d0(time, s1) values (3, 1), (0, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(
new HashSet<>(Arrays.asList("0,1.0,", "1,1.0,", "2,1.0,", "3,1.0,", "4,1.0,"))));
@@ -481,7 +491,8 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
// Because the failures will randomly generate due to resource limitation
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"))) {
+ Arrays.asList("insert into root.vehicle.d0(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -517,13 +528,14 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"create timeSeries root.vehicle.d0.s1 int32",
"insert into root.vehicle.d0(time, s1) values (2, 1)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.vehicle.**",
"Time,root.vehicle.d0.s1,",
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("1,1.0,", "2,1.0,"))));
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeLifeCycleIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeLifeCycleIT.java
index 9ee9df2d571..dcf1226de85 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeLifeCycleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeLifeCycleIT.java
@@ -36,6 +36,8 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
+import java.sql.Connection;
+import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -73,7 +75,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -100,34 +104,38 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
final Set<String> expectedResSet = new HashSet<>();
expectedResSet.add("1,1.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
expectedResSet.add("2,2.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataAlwaysOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
expectedResSet.add("3,3.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
}
@@ -142,7 +150,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -180,7 +190,8 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
"create database root.ln",
"create timeseries root.db.d1.s2 with datatype=BOOLEAN,encoding=PLAIN",
"insert into root.db.d1(time, s1) values (2, 2)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -190,9 +201,19 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
"Time,root.db.d1.s1,",
Collections.singleton("2,2.0,"));
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton("2,"));
+ receiverEnv,
+ "count timeseries root.db.**",
+ "count(timeseries),",
+ Collections.singleton("2,"));
+ TestUtils.assertDataEventuallyOnEnv(
+ receiverEnv,
+ "count timeseries root.ln.**",
+ "count(timeseries),",
+ Collections.singleton("0,"));
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count databases", "count,", Collections.singleton("2,"));
+ receiverEnv, "count databases root.db", "count,", Collections.singleton("1,"));
+ TestUtils.assertDataEventuallyOnEnv(
+ receiverEnv, "count databases root.ln", "count,", Collections.singleton("1,"));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
@@ -203,7 +224,8 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
"create database root.ln0",
"create timeseries root.db.d1.s3 with datatype=BOOLEAN,encoding=PLAIN",
"insert into root.db.d1(time, s1) values (3, 3)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -213,9 +235,19 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
"Time,root.db.d1.s1,",
Collections.singleton("2,2.0,"));
TestUtils.assertDataAlwaysOnEnv(
- receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton("2,"));
+ receiverEnv,
+ "count timeseries root.ln0.**",
+ "count(timeseries),",
+ Collections.singleton("1,"));
+ TestUtils.assertDataAlwaysOnEnv(
+ receiverEnv,
+ "count timeseries root.db.**",
+ "count(timeseries),",
+ Collections.singleton("1,"));
TestUtils.assertDataAlwaysOnEnv(
- receiverEnv, "count databases", "count,", Collections.singleton("2,"));
+ receiverEnv, "count databases root.ln0", "count,", Collections.singleton("1,"));
+ TestUtils.assertDataAlwaysOnEnv(
+ receiverEnv, "count databases root.db", "count,", Collections.singleton("1,"));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
@@ -226,9 +258,17 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
"Time,root.db.d1.s1,",
new HashSet<>(Arrays.asList("2,2.0,", "3,3.0,")));
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton("3,"));
+ receiverEnv,
+ "count timeseries root.db.**",
+ "count(timeseries),",
+ Collections.singleton("3,"));
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count databases", "count,", Collections.singleton("3,"));
+ receiverEnv,
+ "count timeseries root.ln0.**",
+ "count(timeseries),",
+ Collections.singleton("0,"));
+ TestUtils.assertDataEventuallyOnEnv(
+ receiverEnv, "count databases", "count,", Collections.singleton("4,"));
}
}
@@ -243,7 +283,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -272,27 +314,31 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
final Set<String> expectedResSet = new HashSet<>();
expectedResSet.add("1,1.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
expectedResSet.add("2,2.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
}
@@ -307,7 +353,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -336,27 +384,31 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
final Set<String> expectedResSet = new HashSet<>();
expectedResSet.add("1,1.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
expectedResSet.add("2,2.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
}
@@ -371,7 +423,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -400,27 +454,31 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
final Set<String> expectedResSet = new HashSet<>();
expectedResSet.add("1,1.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
expectedResSet.add("2,2.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
}
@@ -436,7 +494,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -462,16 +522,18 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
expectedResSet.add("1,1.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
expectedResSet.add("2,2.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
try {
@@ -486,13 +548,15 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
expectedResSet.add("3,3.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
}
@@ -529,11 +593,18 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
final Thread t =
new Thread(
() -> {
+ Connection connection = null;
+ try {
+ connection = senderEnv.getConnection();
+ } catch (SQLException e) {
+ // ignore
+ }
try {
for (int i = 0; i < 100; ++i) {
if (TestUtils.tryExecuteNonQueryWithRetry(
senderEnv,
- String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
succeedNum.incrementAndGet();
}
Thread.sleep(100);
@@ -556,13 +627,13 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
}
t.join();
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton(succeedNum.get() + ","));
}
@@ -578,7 +649,7 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, "insert into root.db.d1(time, s1) values (1, 1)")) {
+ receiverEnv, "insert into root.db.d1(time, s1) values (1, 1)", null)) {
return;
}
@@ -602,13 +673,15 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"));
@@ -616,14 +689,16 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
Thread.sleep(5000);
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"));
}
@@ -642,11 +717,11 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
for (int i = 0; i < 100; ++i) {
if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i), null)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -674,25 +749,33 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
}
- for (int i = 100; i < 200; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 100; i < 200; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
- return;
- }
- for (int i = 200; i < 300; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 200; i < 300; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
- return;
- }
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) receiverEnv.getLeaderConfigNodeConnection()) {
@@ -718,15 +801,19 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
}
- for (int i = 300; i < 400; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 300; i < 400; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
- return;
- }
final Set<String> expectedResSet = new HashSet<>();
for (int i = 0; i < 400; ++i) {
@@ -734,9 +821,9 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
}
TestUtils.assertDataEventuallyOnEnv(
- senderEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ senderEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
try {
TestUtils.restartCluster(senderEnv);
@@ -746,37 +833,46 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
return;
}
- for (int i = 400; i < 500; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 400; i < 500; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
- return;
- }
- for (int i = 500; i < 600; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 500; i < 600; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
- return;
- }
for (int i = 400; i < 600; ++i) {
expectedResSet.add(i + ",1.0,");
}
TestUtils.assertDataEventuallyOnEnv(
- senderEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ senderEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
@Test
public void testPermission() {
- createUser(senderEnv, "test", "test123");
+ createUser(senderEnv, "test", "test123123456");
assertNonQueryTestFail(
senderEnv,
@@ -788,50 +884,50 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
+ ")",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
senderEnv,
"drop pipe testPipe",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertTestFail(
senderEnv,
"show pipes",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
senderEnv,
"start pipe testPipe",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
senderEnv,
"stop pipe testPipe",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
senderEnv,
"create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
senderEnv,
"drop pipePlugin TestProcessor",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
assertTestFail(
senderEnv,
"show pipe plugins",
"803: No permissions for this operation, please add privilege USE_PIPE",
"test",
- "test123");
+ "test123123456");
grantUserSystemPrivileges(senderEnv, "test", PrivilegeType.USE_PIPE);
@@ -842,20 +938,20 @@ public class IoTDBPipeLifeCycleIT extends AbstractPipeDualTreeModelAutoIT {
+ " 'connector'='write-back-connector'\n"
+ ")",
"test",
- "test123");
- executeQueryWithRetry(senderEnv, "show pipes", "test", "test123");
+ "test123123456");
+ executeQueryWithRetry(senderEnv, "show pipes", "test", "test123123456");
executeNonQueriesWithRetry(
senderEnv,
Arrays.asList("start pipe testPipe", "stop pipe testPipe", "drop pipe testPipe"),
"test",
- "test123");
+ "test123123456");
assertNonQueryTestFail(
senderEnv,
"create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'",
"701: Untrusted uri xxx",
"test",
- "test123");
- executeQueryWithRetry(senderEnv, "show pipe plugins", "test", "test123");
+ "test123123456");
+ executeQueryWithRetry(senderEnv, "show pipe plugins", "test", "test123123456");
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProcessorIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProcessorIT.java
index 9c755c1b0bf..bfa5581d290 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProcessorIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProcessorIT.java
@@ -97,7 +97,8 @@ public class IoTDBPipeProcessorIT extends AbstractPipeDualTreeModelAutoIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
Arrays.asList(
- "insert into root.vehicle.d0(time, s1) values (0, 1)", "delete from root.**"))) {
+ "insert into root.vehicle.d0(time, s1) values (0, 1)", "delete from root.**"),
+ null)) {
return;
}
@@ -136,7 +137,8 @@ public class IoTDBPipeProcessorIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.vehicle.d0(time, s1) values (20000, 4)",
"insert into root.vehicle.d0(time, s1) values (20001, 5)",
"insert into root.vehicle.d0(time, s1) values (45000, 6)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -147,7 +149,7 @@ public class IoTDBPipeProcessorIT extends AbstractPipeDualTreeModelAutoIT {
expectedResSet.add("45000,6.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.vehicle.d0.s1,", expectedResSet);
+ receiverEnv, "select * from root.vehicle.**", "Time,root.vehicle.d0.s1,", expectedResSet);
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProtocolIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProtocolIT.java
index 4358bc2a203..a823a3e2972 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProtocolIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeProtocolIT.java
@@ -198,7 +198,7 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, "insert into root.db.d1(time, s1) values (1, 1)")) {
+ senderEnv, "insert into root.db.d1(time, s1) values (1, 1)", null)) {
return;
}
@@ -223,7 +223,7 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("1,"));
@@ -238,7 +238,7 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) receiverEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, "insert into root.db.d1(time, s1) values (2, 2)")) {
+ receiverEnv, "insert into root.db.d1(time, s1) values (2, 2)", null)) {
return;
}
@@ -263,7 +263,7 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
senderEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"));
}
@@ -279,7 +279,7 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, "insert into root.db.d1(time, s1) values (1, 1)")) {
+ senderEnv, "insert into root.db.d1(time, s1) values (1, 1)", null)) {
return;
}
@@ -304,18 +304,20 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("1,"));
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"));
@@ -323,14 +325,16 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
Thread.sleep(5000);
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"));
}
@@ -407,7 +411,8 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.db.d1(time, s1) values (1, 1)",
"insert into root.db.d1(time, s1) values (3, 1)",
"flush",
- "delete from root.db.d1.s1 where time > 2"))) {
+ "delete from root.db.d1.s1 where time > 2"),
+ null)) {
return;
}
@@ -437,12 +442,14 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("1,"));
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (2, 2)", "flush"),
+ null)) {
return;
}
@@ -457,15 +464,16 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
senderEnv,
Arrays.asList(
"create timeseries root.db.d1.s2 with datatype=BOOLEAN,encoding=PLAIN",
- "create database root.test1"))) {
+ "create database root.test1"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton("2,"));
+ receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton("4,"));
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count databases", "count,", Collections.singleton("2,"));
+ receiverEnv, "count databases", "count,", Collections.singleton("3,"));
// Test file mode
extractorAttributes.put("source.inclusion", "data");
@@ -482,7 +490,9 @@ public class IoTDBPipeProtocolIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p2").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (3, 3)", "flush"),
+ null)) {
return;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSinkParallelIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSinkParallelIT.java
index fcb40dcbae2..9297d1bdc5b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSinkParallelIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSinkParallelIT.java
@@ -89,7 +89,8 @@ public class IoTDBPipeSinkParallelIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.sg1.d1(time, s1) values (1, 2)",
"insert into root.sg1.d1(time, s1) values (2, 3)",
"insert into root.sg1.d1(time, s1) values (3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -98,7 +99,7 @@ public class IoTDBPipeSinkParallelIT extends AbstractPipeDualTreeModelAutoIT {
expectedResSet.add("2,3.0,");
expectedResSet.add("3,4.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.sg1.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.sg1.**", "Time,root.sg1.d1.s1,", expectedResSet);
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSourceIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSourceIT.java
index 060f96f36a9..32aa520ddf2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSourceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSourceIT.java
@@ -74,6 +74,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
.setEnableUnseqSpaceCompaction(false)
.setEnableCrossSpaceCompaction(false)
.setIsPipeEnableMemoryCheck(false);
+ senderEnv.getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
receiverEnv
.getConfig()
.getCommonConfig()
@@ -81,6 +82,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setIsPipeEnableMemoryCheck(false);
+ receiverEnv.getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
// 10 min, assert that the operations will not time out
senderEnv.getConfig().getCommonConfig().setDnConnectionTimeoutMs(600000);
@@ -441,7 +443,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.aligned.`1(TS)` (time, s_float) aligned values (now(), 0.5)",
"insert into root.aligned.6TS.`6` ("
+ "time, `s_float(1)`, `s_int(1)`, `s_double(1)`, `s_long(1)`, `s_text(1)`, `s_bool(1)`) "
- + "aligned values (now(), 0.5, 1, 1.5, 2, \"text1\", true)"))) {
+ + "aligned values (now(), 0.5, 1, 1.5, 2, \"text1\", true)"),
+ null)) {
return;
}
@@ -491,7 +494,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
// and is skipped flush when the pipe starts. In this case, the "waitForTsFileClose()"
// may not return until a flush is executed, namely the data transfer relies
// on a flush operation.
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
assertTimeseriesCountOnReceiver(receiverEnv, expectedTimeseriesCount.get(i));
@@ -499,7 +502,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "show devices",
+ "show devices root.nonAligned.**",
"Device,IsAligned,Template,TTL(ms),",
new HashSet<>(
Arrays.asList(
@@ -507,7 +510,13 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
"root.nonAligned.100TS,false,null,INF,",
"root.nonAligned.1000TS,false,null,INF,",
"root.nonAligned.`1(TS)`,false,null,INF,",
- "root.nonAligned.6TS.`6`,false,null,INF,",
+ "root.nonAligned.6TS.`6`,false,null,INF,")));
+ TestUtils.assertDataEventuallyOnEnv(
+ receiverEnv,
+ "show devices root.aligned.**",
+ "Device,IsAligned,Template,TTL(ms),",
+ new HashSet<>(
+ Arrays.asList(
"root.aligned.1TS,true,null,INF,",
"root.aligned.100TS,true,null,INF,",
"root.aligned.1000TS,true,null,INF,",
@@ -552,7 +561,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db1.d1 (time, at1) values (1, 10)",
"insert into root.db2.d1 (time, at1) values (1, 20)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -577,7 +587,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db1.d1 (time, at1) values (2, 11)",
"insert into root.db2.d1 (time, at1) values (2, 21)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -593,7 +604,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db*.**",
"count(root.db1.d1.at1),count(root.db2.d1.at1),",
Collections.singleton("2,2,"));
}
@@ -615,7 +626,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.db.d2 (time, at1) values (1, 20)",
"insert into root.db.d3 (time, at1) values (1, 30)",
"insert into root.db.d4 (time, at1) values (1, 40)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -671,18 +683,19 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.db.d1 (time, at1) values (2, 11)",
"insert into root.db.d2 (time, at1) values (2, 21)",
"insert into root.db.d3 (time, at1) values (2, 31)",
- "insert into root.db.d4 (time, at1) values (2, 41), (3, 51)"))) {
+ "insert into root.db.d4 (time, at1) values (2, 41), (3, 51)"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.** where time <= 1",
+ "select count(*) from root.db.** where time <= 1",
"count(root.db.d4.at1),count(root.db.d2.at1),count(root.db.d3.at1),",
Collections.singleton("1,0,1,"));
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.** where time >= 2",
+ "select count(*) from root.db.** where time >= 2",
"count(root.db.d4.at1),count(root.db.d2.at1),count(root.db.d3.at1),",
Collections.singleton("2,1,0,"));
}
@@ -704,7 +717,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
+ " values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)",
"insert into root.db.d2 (time, at1)"
+ " values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -735,7 +749,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),",
Collections.singleton("3,"));
@@ -751,7 +765,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d2.at1),",
Collections.singleton("3,3,"));
}
@@ -774,7 +788,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
+ " values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)",
"insert into root.db.d2 (time, at1)"
+ " values (6000, 6), (7000, 7), (8000, 8), (9000, 9), (10000, 10)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -800,7 +815,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),",
Collections.singleton("3,"));
@@ -810,13 +825,14 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d3 (time, at1)"
+ " values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d3.at1),",
Collections.singleton("3,3,"));
@@ -826,13 +842,14 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d4 (time, at1)"
+ " values (6000, 6), (7000, 7), (8000, 8), (9000, 9), (10000, 10)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
TestUtils.assertDataAlwaysOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d3.at1),",
Collections.singleton("3,3,"));
}
@@ -854,7 +871,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
+ " values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)",
"insert into root.db.d2 (time, at1)"
+ " values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -884,7 +902,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),",
Collections.singleton("3,"));
@@ -900,7 +918,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.at1),count(root.db.d2.at1),",
Collections.singleton("3,3,"));
}
@@ -922,7 +940,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.db.d1 (time, at1, at2)" + " values (1000, 1, 2), (2000, 3, 4)",
// TsFile 2, not extracted because pattern not overlapped
"insert into root.db1.d1 (time, at1, at2)" + " values (1000, 1, 2), (2000, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -931,7 +950,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
// TsFile 3, not extracted because time range not overlapped
"insert into root.db.d1 (time, at1, at2)" + " values (3000, 1, 2), (4000, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -961,7 +981,7 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.** group by level=0",
+ "select count(*) from root.db.** group by level=0",
"count(root.*.*.*),",
Collections.singleton("4,"));
}
@@ -1004,7 +1024,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
senderEnv,
Arrays.asList(
"insert into root.db.d1 (time, at1, at2)" + " values (1000, 1, 2), (3000, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -1012,7 +1033,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
senderEnv,
Arrays.asList(
"insert into root.db1.d1 (time, at1, at2)" + " values (1000, 1, 2), (3000, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -1021,7 +1043,8 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d1 (time, at1)" + " values (5000, 1), (16000, 3)",
"insert into root.db.d1 (time, at1, at2)" + " values (5001, 1, 2), (6001, 3, 4)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -1037,14 +1060,20 @@ public class IoTDBPipeSourceIT extends AbstractPipeDualTreeModelAutoIT {
}
private void assertTimeseriesCountOnReceiver(BaseEnv receiverEnv, int count) {
+ // for system password history
+ count += 2;
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count timeseries", "count(timeseries),", Collections.singleton(count + ","));
+ receiverEnv,
+ "count timeseries root.**",
+ "count(timeseries),",
+ Collections.singleton(count + ","));
}
private void assertPipeCount(int count) throws Exception {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(count, showPipeResult.size());
// for (TShowPipeInfo showPipeInfo : showPipeResult) {
// System.out.println(showPipeInfo);
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSwitchStatusIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSwitchStatusIT.java
index d015e4641b7..64f6cb30c53 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSwitchStatusIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSwitchStatusIT.java
@@ -92,6 +92,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertTrue(
@@ -107,6 +108,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p3").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertTrue(
@@ -119,6 +121,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p2").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p2")));
@@ -127,6 +130,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
}
}
@@ -157,6 +161,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
@@ -168,17 +173,20 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), status.getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
@@ -186,6 +194,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
@@ -202,7 +211,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, "insert into root.db.d1(time, s1) values (1, 1)")) {
+ senderEnv, "insert into root.db.d1(time, s1) values (1, 1)", null)) {
return;
}
@@ -224,16 +233,18 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "drop database root.**")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "drop database root.**", null)) {
return;
}
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(
0,
showPipeResult.stream()
@@ -247,6 +258,7 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
.setProcessorAttributes(processorAttributes));
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.stream().filter((o) -> o.id.equals("p1")).count());
}
}
@@ -284,12 +296,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("*").getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
@@ -302,12 +316,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("*").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.stopPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
@@ -320,12 +336,14 @@ public class IoTDBPipeSwitchStatusIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.dropPipe("*").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("STOPPED")));
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.dropPipe("p1").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
index 8d5d7097810..37b4ad5c73e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
@@ -89,6 +89,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
for (final String pipeName : expectedPipeNames) {
Assert.assertTrue(
showPipeResult.stream()
@@ -106,6 +107,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -165,6 +167,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -237,6 +240,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(2, showPipeResult.size());
}
}
@@ -320,6 +324,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
}
}
@@ -578,6 +583,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(9, showPipeResult.size());
}
}
@@ -624,9 +630,11 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(3, showPipeResult.size());
showPipeResult = client.showPipe(new TShowPipeReq().setPipeName("p1")).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p2")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p3")));
@@ -635,6 +643,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
// p1 and p2 share the same connector parameters, so they have the same connector.
showPipeResult =
client.showPipe(new TShowPipeReq().setPipeName("p1").setWhereClause(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertTrue(showPipeResult.stream().anyMatch((o) -> o.id.equals("p1")));
Assert.assertTrue(showPipeResult.stream().anyMatch((o) -> o.id.equals("p2")));
Assert.assertFalse(showPipeResult.stream().anyMatch((o) -> o.id.equals("p3")));
@@ -724,6 +733,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java
index 608aae2b4ae..446478c5758 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java
@@ -66,7 +66,8 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d1(time, s, s1, t) values (1, 1, 1, 1)",
"insert into root.db.d2(time, s) values (1, 1)",
- "insert into root.db2.d1(time, s) values (1, 1)"))) {
+ "insert into root.db2.d1(time, s) values (1, 1)"),
+ null)) {
return;
}
awaitUntilFlush(senderEnv);
@@ -97,7 +98,10 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
final Set<String> expectedResSet = new HashSet<>();
expectedResSet.add("1,1.0,1.0,");
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s,root.db.d1.s1,", expectedResSet);
+ receiverEnv,
+ "select * from root.db.**",
+ "Time,root.db.d1.s,root.db.d1.s1,",
+ expectedResSet);
}
}
@@ -116,7 +120,8 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d1(time, s, s1, t) values (1, 1, 1, 1)",
"insert into root.db.d2(time, s) values (1, 1)",
- "insert into root.db2.d1(time, s) values (1, 1)"))) {
+ "insert into root.db2.d1(time, s) values (1, 1)"),
+ null)) {
return;
}
awaitUntilFlush(senderEnv);
@@ -150,7 +155,7 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
expectedResSet.add("1,1.0,1.0,1.0,");
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.db2.**,root.db.**",
"Time,root.db2.d1.s,root.db.d1.s,root.db.d1.s1,",
expectedResSet);
}
@@ -171,7 +176,8 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d1(time, s, s1, t) values (1, 1, 1, 1)",
"insert into root.db.d2(time, s) values (1, 1)",
- "insert into root.db2.d1(time, s) values (1, 1)"))) {
+ "insert into root.db2.d1(time, s) values (1, 1)"),
+ null)) {
return;
}
awaitUntilFlush(senderEnv);
@@ -204,7 +210,7 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
expectedResSet.add("1,1.0,1.0,1.0,");
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select * from root.**",
+ "select * from root.db2.**,root.db.**",
"Time,root.db2.d1.s,root.db.d1.s,root.db.d1.s1,",
expectedResSet);
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoConflictIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoConflictIT.java
index ac70fc47349..cecbdadeb45 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoConflictIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoConflictIT.java
@@ -37,6 +37,7 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
+import java.sql.Connection;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -91,15 +92,19 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
final String receiverIp = receiverDataNode.getIp();
final int receiverPort = receiverDataNode.getPort();
- for (int i = 0; i < 100; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 0; i < 100; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
- return;
- }
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
@@ -127,25 +132,34 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
}
- for (int i = 100; i < 200; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 100; i < 200; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
- return;
- }
- for (int i = 200; i < 300; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 200; i < 300; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
- return;
- }
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) receiverEnv.getLeaderConfigNodeConnection()) {
@@ -173,15 +187,19 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
}
- for (int i = 300; i < 400; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 300; i < 400; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
- return;
- }
final Set<String> expectedResSet = new HashSet<>();
for (int i = 0; i < 400; ++i) {
@@ -189,9 +207,9 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
}
TestUtils.assertDataEventuallyOnEnv(
- senderEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ senderEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
try {
TestUtils.restartCluster(senderEnv);
@@ -201,32 +219,42 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
return;
}
- for (int i = 400; i < 500; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 400; i < 500; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
- return;
- }
- for (int i = 500; i < 600; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 500; i < 600; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
+ }
+
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", connection)) {
return;
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
- return;
- }
for (int i = 400; i < 600; ++i) {
expectedResSet.add(i + ",1.0,");
}
TestUtils.assertDataEventuallyOnEnv(
- senderEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ senderEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "select * from root.**", "Time,root.db.d1.s1,", expectedResSet);
+ receiverEnv, "select * from root.db.**", "Time,root.db.d1.s1,", expectedResSet);
}
@Test
@@ -297,29 +325,38 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
// Auto extend s1
"create schema template t1 (s2 INT64 encoding=RLE, s3 INT64 encoding=RLE compression=SNAPPY)",
"create database root.db",
- "set device template t1 to root.db"))) {
+ "set device template t1 to root.db"),
+ null)) {
return;
}
- for (int i = 0; i < 200; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 0; i < 200; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
}
}
- for (int i = 200; i < 400; ++i) {
- if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- return;
+ try (Connection connection = receiverEnv.getConnection()) {
+ for (int i = 200; i < 400; ++i) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(
+ receiverEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ return;
+ }
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(receiverEnv, "flush", null)) {
return;
}
@@ -365,19 +402,20 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("testPipe").getCode());
if (!TestUtils.tryExecuteNonQueryWithRetry(
- receiverEnv, "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN")) {
+ receiverEnv, "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN", null)) {
return;
}
if (!TestUtils.tryExecuteNonQueryWithRetry(
senderEnv,
- "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN tags (tag3=v3) attributes (attr4=v4)")) {
+ "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN tags (tag3=v3) attributes (attr4=v4)",
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "show timeSeries",
+ "show timeSeries root.ln.**",
"Timeseries,Alias,Database,DataType,Encoding,Compression,Tags,Attributes,Deadband,DeadbandParameters,ViewType,",
Collections.singleton(
"root.ln.wf01.wt01.status,null,root.ln,BOOLEAN,RLE,LZ4,{\"tag3\":\"v3\"},{\"attr4\":\"v4\"},null,null,BASE,"));
@@ -405,7 +443,8 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5) values (1706659200,1706659200,10,20.245,25.24555,true,''),(1706662800,null,1706662800,20.241,25.24111,false,'2'),(1706666400,3,null,20.242,25.24222,true,'3'),(1706670000,4,40,null,35.5474,true,'4'),(1706670600,5,1706670600000,20.246,null,false,'5'),(1706671200,6,60,20.248,25.24888,null,'6'),(1706671800,7,1706671800,20.249,25.24999,false,null),(1706672400,8,80,1245.392,75.51234,false,'8'),(1706672600, [...]
"insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5) values (-1,1,10,5.39,5.51234,false,'negative')",
"insert into root.sg_aligned.device_aligned.d11(time, s0, s1, s2,s3,s4,s5) values (-1,-11,-110,-5.39,-5.51234,false,'activate:1')",
- "insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5,s6) values(1706678800,1,1706678800,5.39,5.51234,false,'add:s6',32);"))) {
+ "insert into root.sg_aligned.device_aligned.d10(time, s0, s1, s2,s3,s4,s5,s6) values(1706678800,1,1706678800,5.39,5.51234,false,'add:s6',32);"),
+ null)) {
return;
}
@@ -431,7 +470,10 @@ public class IoTDBPipeAutoConflictIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("testPipe").getCode());
TestUtils.assertDataEventuallyOnEnv(
- receiverEnv, "count devices", "count(devices),", Collections.singleton("3,"));
+ receiverEnv,
+ "count devices root.sg_aligned.**",
+ "count(devices),",
+ Collections.singleton("3,"));
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java
index 493a991ae1b..30404f3adfa 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java
@@ -69,7 +69,9 @@ public class IoTDBPipeAutoDropIT extends AbstractPipeDualTreeModelAutoIT {
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Collections.singletonList("insert into root.db.d1(time, s1) values (1, 1)"))) {
+ senderEnv,
+ Collections.singletonList("insert into root.db.d1(time, s1) values (1, 1)"),
+ null)) {
return;
}
awaitUntilFlush(senderEnv);
@@ -97,7 +99,7 @@ public class IoTDBPipeAutoDropIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("1,"));
@@ -142,7 +144,8 @@ public class IoTDBPipeAutoDropIT extends AbstractPipeDualTreeModelAutoIT {
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
Collections.singletonList(
- "insert into root.db.d1(time, s1) values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)"))) {
+ "insert into root.db.d1(time, s1) values (1000, 1), (2000, 2), (3000, 3), (4000, 4), (5000, 5)"),
+ null)) {
return;
}
awaitUntilFlush(senderEnv);
@@ -172,7 +175,7 @@ public class IoTDBPipeAutoDropIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("3,"));
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeClusterIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeClusterIT.java
index afde95f701b..516f9dbec8f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeClusterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeClusterIT.java
@@ -48,6 +48,8 @@ import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -78,6 +80,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
.setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
.setDataRegionConsensusProtocolClass(ConsensusFactory.IOT_CONSENSUS)
.setIsPipeEnableMemoryCheck(false);
+ senderEnv.getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
receiverEnv
.getConfig()
@@ -126,7 +129,8 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d1(time, s1) values (2010-01-01T10:00:00+08:00, 1)",
"insert into root.db.d1(time, s1) values (2010-01-02T10:00:00+08:00, 2)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
@@ -162,14 +166,15 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
nodeWrapper,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"),
600);
}
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.db.d1(time, s1) values (now(), 3)", "flush"))) {
+ Arrays.asList("insert into root.db.d1(time, s1) values (now(), 3)", "flush"),
+ null)) {
return;
}
@@ -185,7 +190,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
nodeWrapper,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("3,"),
600);
@@ -221,7 +226,8 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
Arrays.asList(
"insert into root.db.d1(time, s1) values (2010-01-01T10:00:00+08:00, 1)",
"insert into root.db.d1(time, s1) values (2010-01-02T10:00:00+08:00, 2)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
final Map<String, String> extractorAttributes = new HashMap<>();
@@ -243,7 +249,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
connectorAttributes.put("connector.ip", receiverIp);
connectorAttributes.put("connector.port", Integer.toString(receiverPort));
connectorAttributes.put("connector.user", "root");
- connectorAttributes.put("connector.password", "root");
+ connectorAttributes.put("connector.password", "IoTDB@2011");
final TSStatus status =
client.createPipe(
@@ -257,19 +263,20 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("1,"));
if (!TestUtils.tryExecuteNonQueriesWithRetry(
senderEnv,
- Arrays.asList("insert into root.db.d1(time, s1) values (now(), 3)", "flush"))) {
+ Arrays.asList("insert into root.db.d1(time, s1) values (now(), 3)", "flush"),
+ null)) {
return;
}
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("2,"));
}
@@ -306,7 +313,9 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -395,7 +404,9 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p2").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d2(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d2(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -438,7 +449,9 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d1(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -496,7 +509,9 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p2").getCode());
if (!TestUtils.tryExecuteNonQueriesWithRetry(
- senderEnv, Arrays.asList("insert into root.db.d2(time, s1) values (1, 1)", "flush"))) {
+ senderEnv,
+ Arrays.asList("insert into root.db.d2(time, s1) values (1, 1)", "flush"),
+ null)) {
return;
}
@@ -560,6 +575,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(30, showPipeResult.size());
}
}
@@ -593,19 +609,42 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
final AtomicInteger succeedNum = new AtomicInteger(0);
+
+ // ensure at least one insert happens before adding node so that the time series can be
+ // created
+ if (TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", 0), null)) {
+ succeedNum.incrementAndGet();
+ }
final Thread t =
new Thread(
() -> {
+ Connection connection = null;
try {
- for (int i = 0; i < 100; ++i) {
+ connection = senderEnv.getConnection();
+ } catch (SQLException e) {
+ // ignore
+ }
+ try {
+
+ for (int i = 1; i < 100; ++i) {
if (TestUtils.tryExecuteNonQueryWithRetry(
senderEnv,
- String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
succeedNum.incrementAndGet();
}
Thread.sleep(100);
}
} catch (final InterruptedException ignored) {
+ } finally {
+ if (connection != null) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+ // ignore
+ }
+ }
}
});
t.start();
@@ -616,7 +655,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
return;
}
t.join();
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -664,10 +703,14 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
int succeedNum = 0;
- for (int i = 0; i < 100; ++i) {
- if (TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i))) {
- succeedNum++;
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 0; i < 100; ++i) {
+ if (TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i),
+ connection)) {
+ succeedNum++;
+ }
}
}
@@ -678,7 +721,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -731,11 +774,14 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
int succeedNum = 0;
- for (int i = 0; i < 100; ++i) {
- if (TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv,
- String.format("insert into root.db.d1(time, s1) values (%s, 1)", i * 1000))) {
- succeedNum++;
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 0; i < 100; ++i) {
+ if (TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i * 1000),
+ connection)) {
+ succeedNum++;
+ }
}
}
@@ -750,7 +796,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
return;
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -761,6 +807,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
Collections.singleton(succeedNum + ","));
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(1, showPipeResult.size());
}
}
@@ -796,13 +843,18 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
}
int succeedNum = 0;
- for (int i = 0; i < 100; ++i) {
- if (TestUtils.tryExecuteNonQueryWithRetry(
- senderEnv, String.format("insert into root.db.d1(time, s1) values (%s, 1)", i * 1000))) {
- succeedNum++;
+ try (Connection connection = senderEnv.getConnection()) {
+ for (int i = 0; i < 100; ++i) {
+ if (TestUtils.tryExecuteNonQueryWithRetry(
+ senderEnv,
+ String.format("insert into root.db.d1(time, s1) values (%s, 1)", i * 1000),
+ connection)) {
+ succeedNum++;
+ }
}
}
- if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush")) {
+
+ if (!TestUtils.tryExecuteNonQueryWithRetry(senderEnv, "flush", null)) {
return;
}
@@ -815,7 +867,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton(succeedNum + ","));
}
@@ -904,6 +956,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(0, showPipeResult.size());
}
}
@@ -976,9 +1029,11 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(successCount.get(), showPipeResult.size());
showPipeResult =
client.showPipe(new TShowPipeReq().setPipeName("p1").setWhereClause(true)).pipeInfoList;
+ showPipeResult.removeIf(i -> i.getId().startsWith("__consensus"));
Assert.assertEquals(successCount.get(), showPipeResult.size());
}
}
@@ -998,7 +1053,8 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
"insert into root.db.d1(time, s1) values (0, 1)",
"insert into root.db.d1(time, s1) values (-1, 2)",
"insert into root.db.d1(time, s1) values (1960-01-02T10:00:00+08:00, 2)",
- "flush"))) {
+ "flush"),
+ null)) {
return;
}
final Map<String, String> extractorAttributes = new HashMap<>();
@@ -1025,7 +1081,7 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
TestUtils.assertDataEventuallyOnEnv(
receiverEnv,
- "select count(*) from root.**",
+ "select count(*) from root.db.**",
"count(root.db.d1.s1),",
Collections.singleton("3,"));
@@ -1035,13 +1091,14 @@ public class IoTDBPipeClusterIT extends AbstractPipeDualTreeModelAutoIT {
... 5633 lines suppressed ...