You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yo...@apache.org on 2023/01/17 15:52:36 UTC
[iotdb] branch Fix-configuration-error updated: spotless
This is an automated email from the ASF dual-hosted git repository.
yongzao pushed a commit to branch Fix-configuration-error
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/Fix-configuration-error by this push:
new e98e97390b spotless
e98e97390b is described below
commit e98e97390bb418f97ed1edfdf67748be96f481e8
Author: YongzaoDan <53...@qq.com>
AuthorDate: Tue Jan 17 23:52:28 2023 +0800
spotless
---
.../apache/iotdb/commons/conf/CommonConfig.java | 44 +-
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 164 ++++----
.../mpp/execution/exchange/SourceHandleTest.java | 458 ++++++++++-----------
3 files changed, 333 insertions(+), 333 deletions(-)
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 44e3fe410b..5fcf500672 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -39,11 +39,11 @@ public class CommonConfig {
// the authorizer provider class which extends BasicAuthorizer
private String authorizerProvider =
- "org.apache.iotdb.commons.auth.authorizer.LocalFileAuthorizer";
+ "org.apache.iotdb.commons.auth.authorizer.LocalFileAuthorizer";
/** Encryption provider class */
private String encryptDecryptProvider =
- "org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt";
+ "org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt";
/** Encryption provided class parameter */
private String encryptDecryptProviderParameter;
@@ -53,29 +53,29 @@ public class CommonConfig {
private String adminPassword = "root";
private String userFolder =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + "users";
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + "users";
private String roleFolder =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + "roles";
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + "roles";
private String procedureWalFolder =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + "procedure";
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + "procedure";
/** Sync directory, including the log and hardlink tsfiles */
private String syncDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYNC_FOLDER_NAME;
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYNC_FOLDER_NAME;
/** WAL directories */
private String[] walDirs = {
@@ -110,7 +110,7 @@ public class CommonConfig {
/** What will the system do when unrecoverable error occurs. */
private HandleSystemErrorStrategy handleSystemErrorStrategy =
- HandleSystemErrorStrategy.CHANGE_TO_READ_ONLY;
+ HandleSystemErrorStrategy.CHANGE_TO_READ_ONLY;
/** Status of current system. */
private volatile NodeStatus status = NodeStatus.Running;
@@ -328,12 +328,12 @@ public class CommonConfig {
switch (newStatus) {
case ReadOnly:
logger.error(
- "Change system status to ReadOnly! Only query statements are permitted!",
- new RuntimeException("System mode is set to READ_ONLY"));
+ "Change system status to ReadOnly! Only query statements are permitted!",
+ new RuntimeException("System mode is set to READ_ONLY"));
break;
case Removing:
logger.info(
- "Change system status to Removing! The current Node is being removed from cluster!");
+ "Change system status to Removing! The current Node is being removed from cluster!");
break;
default:
break;
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index d2b5205d98..e5092a0b1f 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -70,7 +70,7 @@ public class IoTDBConfig {
public static final String CONFIG_NAME = "iotdb-datanode.properties";
private static final Logger logger = LoggerFactory.getLogger(IoTDBConfig.class);
private static final String MULTI_DIR_STRATEGY_PREFIX =
- "org.apache.iotdb.db.conf.directories.strategy.";
+ "org.apache.iotdb.db.conf.directories.strategy.";
private static final String DEFAULT_MULTI_DIR_STRATEGY = "MaxDiskUsableSpaceFirstStrategy";
private static final String STORAGE_GROUP_MATCHER = "([a-zA-Z0-9`_.\\-\\u2E80-\\u9FFF]+)";
@@ -83,7 +83,7 @@ public class IoTDBConfig {
private static final String PARTIAL_NODE_MATCHER = "[" + PATH_SEPARATOR + "]" + NODE_NAME_MATCHER;
private static final String NODE_MATCHER =
- "([" + PATH_SEPARATOR + "])?" + NODE_NAME_MATCHER + "(" + PARTIAL_NODE_MATCHER + ")*";
+ "([" + PATH_SEPARATOR + "])?" + NODE_NAME_MATCHER + "(" + PARTIAL_NODE_MATCHER + ")*";
public static final Pattern NODE_PATTERN = Pattern.compile(NODE_MATCHER);
@@ -241,45 +241,45 @@ public class IoTDBConfig {
/** System directory, including version file for each database and metadata */
private String systemDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
/** Schema directory, including storage set of values. */
private String schemaDir =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + IoTDBConstant.SCHEMA_FOLDER_NAME;
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + IoTDBConstant.SCHEMA_FOLDER_NAME;
/** Query directory, stores temporary files of query */
private String queryDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.QUERY_FOLDER_NAME;
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.QUERY_FOLDER_NAME;
/** External lib directory, stores user-uploaded JAR files */
private String extDir = IoTDBConstant.EXT_FOLDER_NAME;
/** External lib directory for UDF, stores user-uploaded JAR files */
private String udfDir =
- IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.UDF_FOLDER_NAME;
+ IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.UDF_FOLDER_NAME;
/** External temporary lib directory for storing downloaded udf JAR files */
private String udfTemporaryLibDir = udfDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
/** External lib directory for trigger, stores user-uploaded JAR files */
private String triggerDir =
- IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.TRIGGER_FOLDER_NAME;
+ IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.TRIGGER_FOLDER_NAME;
/** External temporary lib directory for storing downloaded trigger JAR files */
private String triggerTemporaryLibDir =
- triggerDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
+ triggerDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
/** External lib directory for ext Pipe plugins, stores user-defined JAR files */
private String extPipeDir =
- IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.EXT_PIPE_FOLDER_NAME;
+ IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.EXT_PIPE_FOLDER_NAME;
/** External lib directory for MQTT, stores user-uploaded JAR files */
private String mqttDir =
- IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.MQTT_FOLDER_NAME;
+ IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.MQTT_FOLDER_NAME;
/** Data directories. It can be settled as dataDirs = {"data1", "data2", "data3"}; */
private String[] dataDirs = {
@@ -287,17 +287,17 @@ public class IoTDBConfig {
};
private String loadTsFileDir =
- dataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME;
+ dataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME;
/** Strategy of multiple directories. */
private String multiDirStrategyClassName = null;
private String ratisDataRegionSnapshotDir =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.DATA_FOLDER_NAME
- + File.separator
- + IoTDBConstant.SNAPSHOT_FOLDER_NAME;
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.DATA_FOLDER_NAME
+ + File.separator
+ + IoTDBConstant.SNAPSHOT_FOLDER_NAME;
/** Consensus directory. */
private String consensusDir = IoTDBConstant.DEFAULT_BASE_DIR + File.separator + "consensus";
@@ -401,16 +401,16 @@ public class IoTDBConfig {
* SIZE_TIRED_COMPACTION:
*/
private InnerSequenceCompactionSelector innerSequenceCompactionSelector =
- InnerSequenceCompactionSelector.SIZE_TIERED;
+ InnerSequenceCompactionSelector.SIZE_TIERED;
private InnerSeqCompactionPerformer innerSeqCompactionPerformer =
- InnerSeqCompactionPerformer.READ_CHUNK;
+ InnerSeqCompactionPerformer.READ_CHUNK;
private InnerUnsequenceCompactionSelector innerUnsequenceCompactionSelector =
- InnerUnsequenceCompactionSelector.SIZE_TIERED;
+ InnerUnsequenceCompactionSelector.SIZE_TIERED;
private InnerUnseqCompactionPerformer innerUnseqCompactionPerformer =
- InnerUnseqCompactionPerformer.READ_POINT;
+ InnerUnseqCompactionPerformer.READ_POINT;
/**
* The strategy of cross space compaction task. There are just one cross space compaction strategy
@@ -654,7 +654,7 @@ public class IoTDBConfig {
* How many thread will be set up to perform continuous queries. When <= 0, use max(1, CPU core number / 2).
*/
private int continuousQueryThreadNum =
- Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
+ Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
/*
* Minimum every interval to perform continuous query.
@@ -700,7 +700,7 @@ public class IoTDBConfig {
* "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider"
*/
private String dfsClientFailoverProxyProvider =
- "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider";
+ "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider";
/** whether use kerberos to authenticate hdfs */
private boolean useKerberos = false;
@@ -850,7 +850,7 @@ public class IoTDBConfig {
/** Ip and port of config nodes. */
private List<TEndPoint> targetConfigNodeList =
- Collections.singletonList(new TEndPoint("127.0.0.1", 10710));
+ Collections.singletonList(new TEndPoint("127.0.0.1", 10710));
/** The time of data node waiting for the next retry to join into the cluster */
private long joinClusterRetryIntervalMs = TimeUnit.SECONDS.toMillis(5);
@@ -875,7 +875,7 @@ public class IoTDBConfig {
* series partition
*/
private String seriesPartitionExecutorClass =
- "org.apache.iotdb.commons.partition.executor.hash.APHashExecutor";
+ "org.apache.iotdb.commons.partition.executor.hash.APHashExecutor";
/** The number of series partitions in a database */
private int seriesPartitionSlotNum = 10000;
@@ -900,9 +900,9 @@ public class IoTDBConfig {
* clients.
*/
private int selectorNumOfClientManager =
- Runtime.getRuntime().availableProcessors() / 4 > 0
- ? Runtime.getRuntime().availableProcessors() / 4
- : 1;
+ Runtime.getRuntime().availableProcessors() / 4 > 0
+ ? Runtime.getRuntime().availableProcessors() / 4
+ : 1;
/**
* The maximum number of clients that can be idle for a node in a clientManager. When the number
@@ -1033,11 +1033,11 @@ public class IoTDBConfig {
/** Output location of audit logs * */
private List<AuditLogStorage> auditLogStorage =
- Arrays.asList(AuditLogStorage.IOTDB, AuditLogStorage.LOGGER);
+ Arrays.asList(AuditLogStorage.IOTDB, AuditLogStorage.LOGGER);
/** Indicates the category collection of audit logs * */
private List<AuditLogOperation> auditLogOperation =
- Arrays.asList(AuditLogOperation.DML, AuditLogOperation.DDL, AuditLogOperation.QUERY);
+ Arrays.asList(AuditLogOperation.DML, AuditLogOperation.DDL, AuditLogOperation.QUERY);
/** whether the local write api records audit logs * */
private boolean enableAuditLogForNativeInsertApi = true;
@@ -1084,7 +1084,7 @@ public class IoTDBConfig {
}
public void setUdfInitialByteArrayLengthForMemoryControl(
- int udfInitialByteArrayLengthForMemoryControl) {
+ int udfInitialByteArrayLengthForMemoryControl) {
this.udfInitialByteArrayLengthForMemoryControl = udfInitialByteArrayLengthForMemoryControl;
}
@@ -1175,7 +1175,7 @@ public class IoTDBConfig {
for (String oldDir : this.dataDirs) {
if (!newDirs.contains(oldDir)) {
String msg =
- String.format("%s is removed from data_dirs parameter, please add it back.", oldDir);
+ String.format("%s is removed from data_dirs parameter, please add it back.", oldDir);
logger.error(msg);
throw new LoadConfigurationException(msg);
}
@@ -1221,9 +1221,9 @@ public class IoTDBConfig {
Class.forName(multiDirStrategyClassName);
} catch (ClassNotFoundException e) {
logger.warn(
- "Cannot find given directory strategy {}, using the default value",
- getMultiDirStrategyClassName(),
- e);
+ "Cannot find given directory strategy {}, using the default value",
+ getMultiDirStrategyClassName(),
+ e);
setMultiDirStrategyClassName(MULTI_DIR_STRATEGY_PREFIX + DEFAULT_MULTI_DIR_STRATEGY);
}
}
@@ -1247,7 +1247,7 @@ public class IoTDBConfig {
this.dataDirs = dataDirs;
// TODO(szywilliam): rewrite the logic here when ratis supports complete snapshot semantic
setRatisDataRegionSnapshotDir(
- dataDirs[0] + File.separator + IoTDBConstant.SNAPSHOT_FOLDER_NAME);
+ dataDirs[0] + File.separator + IoTDBConstant.SNAPSHOT_FOLDER_NAME);
setLoadTsFileDir(dataDirs[0] + File.separator + IoTDBConstant.LOAD_TSFILE_FOLDER_NAME);
}
@@ -1281,11 +1281,11 @@ public class IoTDBConfig {
public void setTimestampPrecision(String timestampPrecision) {
if (!("ms".equals(timestampPrecision)
- || "us".equals(timestampPrecision)
- || "ns".equals(timestampPrecision))) {
+ || "us".equals(timestampPrecision)
+ || "ns".equals(timestampPrecision))) {
logger.error(
- "Wrong timestamp precision, please set as: ms, us or ns ! Current is: {}",
- timestampPrecision);
+ "Wrong timestamp precision, please set as: ms, us or ns ! Current is: {}",
+ timestampPrecision);
System.exit(-1);
}
this.timestampPrecision = timestampPrecision;
@@ -1425,13 +1425,13 @@ public class IoTDBConfig {
public void checkMultiDirStrategyClassName() {
if (isClusterMode
- && !(multiDirStrategyClassName.equals(DEFAULT_MULTI_DIR_STRATEGY)
- || multiDirStrategyClassName.equals(
- MULTI_DIR_STRATEGY_PREFIX + DEFAULT_MULTI_DIR_STRATEGY))) {
+ && !(multiDirStrategyClassName.equals(DEFAULT_MULTI_DIR_STRATEGY)
+ || multiDirStrategyClassName.equals(
+ MULTI_DIR_STRATEGY_PREFIX + DEFAULT_MULTI_DIR_STRATEGY))) {
String msg =
- String.format(
- "Cannot set multi_dir_strategy to %s, because cluster mode only allows MaxDiskUsableSpaceFirstStrategy.",
- multiDirStrategyClassName);
+ String.format(
+ "Cannot set multi_dir_strategy to %s, because cluster mode only allows MaxDiskUsableSpaceFirstStrategy.",
+ multiDirStrategyClassName);
logger.error(msg);
throw new RuntimeException(msg);
}
@@ -1576,8 +1576,8 @@ public class IoTDBConfig {
public String getIoTDBMajorVersion(String version) {
return "UNKNOWN".equals(version)
- ? "UNKNOWN"
- : version.split("\\.")[0] + "." + version.split("\\.")[1];
+ ? "UNKNOWN"
+ : version.split("\\.")[0] + "." + version.split("\\.")[1];
}
public String getIpWhiteList() {
@@ -1815,9 +1815,9 @@ public class IoTDBConfig {
public long getAllocateMemoryForFree() {
return Runtime.getRuntime().maxMemory()
- - allocateMemoryForStorageEngine
- - allocateMemoryForRead
- - allocateMemoryForSchema;
+ - allocateMemoryForStorageEngine
+ - allocateMemoryForRead
+ - allocateMemoryForSchema;
}
public boolean isEnablePartialInsert() {
@@ -1993,7 +1993,7 @@ public class IoTDBConfig {
}
public void setAllocateMemoryForTimeSeriesMetaDataCache(
- long allocateMemoryForTimeSeriesMetaDataCache) {
+ long allocateMemoryForTimeSeriesMetaDataCache) {
this.allocateMemoryForTimeSeriesMetaDataCache = allocateMemoryForTimeSeriesMetaDataCache;
}
@@ -2169,11 +2169,11 @@ public class IoTDBConfig {
public void setNanStringInferType(TSDataType nanStringInferType) {
if (nanStringInferType != TSDataType.DOUBLE
- && nanStringInferType != TSDataType.FLOAT
- && nanStringInferType != TSDataType.TEXT) {
+ && nanStringInferType != TSDataType.FLOAT
+ && nanStringInferType != TSDataType.TEXT) {
throw new IllegalArgumentException(
- "Config Property nan_string_infer_type can only be FLOAT, DOUBLE or TEXT but is "
- + nanStringInferType);
+ "Config Property nan_string_infer_type can only be FLOAT, DOUBLE or TEXT but is "
+ + nanStringInferType);
}
this.nanStringInferType = nanStringInferType;
}
@@ -2650,7 +2650,7 @@ public class IoTDBConfig {
}
public void setInnerSequenceCompactionSelector(
- InnerSequenceCompactionSelector innerSequenceCompactionSelector) {
+ InnerSequenceCompactionSelector innerSequenceCompactionSelector) {
this.innerSequenceCompactionSelector = innerSequenceCompactionSelector;
}
@@ -2659,7 +2659,7 @@ public class IoTDBConfig {
}
public void setInnerUnsequenceCompactionSelector(
- InnerUnsequenceCompactionSelector innerUnsequenceCompactionSelector) {
+ InnerUnsequenceCompactionSelector innerUnsequenceCompactionSelector) {
this.innerUnsequenceCompactionSelector = innerUnsequenceCompactionSelector;
}
@@ -2668,7 +2668,7 @@ public class IoTDBConfig {
}
public void setInnerSeqCompactionPerformer(
- InnerSeqCompactionPerformer innerSeqCompactionPerformer) {
+ InnerSeqCompactionPerformer innerSeqCompactionPerformer) {
this.innerSeqCompactionPerformer = innerSeqCompactionPerformer;
}
@@ -2677,7 +2677,7 @@ public class IoTDBConfig {
}
public void setInnerUnseqCompactionPerformer(
- InnerUnseqCompactionPerformer innerUnseqCompactionPerformer) {
+ InnerUnseqCompactionPerformer innerUnseqCompactionPerformer) {
this.innerUnseqCompactionPerformer = innerUnseqCompactionPerformer;
}
@@ -3255,7 +3255,7 @@ public class IoTDBConfig {
}
public void setDataRatisConsensusLogAppenderBufferSizeMax(
- long dataRatisConsensusLogAppenderBufferSizeMax) {
+ long dataRatisConsensusLogAppenderBufferSizeMax) {
this.dataRatisConsensusLogAppenderBufferSizeMax = dataRatisConsensusLogAppenderBufferSizeMax;
}
@@ -3297,7 +3297,7 @@ public class IoTDBConfig {
}
public void setDataRatisConsensusSnapshotTriggerThreshold(
- long dataRatisConsensusSnapshotTriggerThreshold) {
+ long dataRatisConsensusSnapshotTriggerThreshold) {
this.dataRatisConsensusSnapshotTriggerThreshold = dataRatisConsensusSnapshotTriggerThreshold;
}
@@ -3306,7 +3306,7 @@ public class IoTDBConfig {
}
public void setDataRatisConsensusLogUnsafeFlushEnable(
- boolean dataRatisConsensusLogUnsafeFlushEnable) {
+ boolean dataRatisConsensusLogUnsafeFlushEnable) {
this.dataRatisConsensusLogUnsafeFlushEnable = dataRatisConsensusLogUnsafeFlushEnable;
}
@@ -3323,7 +3323,7 @@ public class IoTDBConfig {
}
public void setDataRatisConsensusGrpcFlowControlWindow(
- long dataRatisConsensusGrpcFlowControlWindow) {
+ long dataRatisConsensusGrpcFlowControlWindow) {
this.dataRatisConsensusGrpcFlowControlWindow = dataRatisConsensusGrpcFlowControlWindow;
}
@@ -3332,9 +3332,9 @@ public class IoTDBConfig {
}
public void setDataRatisConsensusLeaderElectionTimeoutMinMs(
- long dataRatisConsensusLeaderElectionTimeoutMinMs) {
+ long dataRatisConsensusLeaderElectionTimeoutMinMs) {
this.dataRatisConsensusLeaderElectionTimeoutMinMs =
- dataRatisConsensusLeaderElectionTimeoutMinMs;
+ dataRatisConsensusLeaderElectionTimeoutMinMs;
}
public long getDataRatisConsensusLeaderElectionTimeoutMaxMs() {
@@ -3342,9 +3342,9 @@ public class IoTDBConfig {
}
public void setDataRatisConsensusLeaderElectionTimeoutMaxMs(
- long dataRatisConsensusLeaderElectionTimeoutMaxMs) {
+ long dataRatisConsensusLeaderElectionTimeoutMaxMs) {
this.dataRatisConsensusLeaderElectionTimeoutMaxMs =
- dataRatisConsensusLeaderElectionTimeoutMaxMs;
+ dataRatisConsensusLeaderElectionTimeoutMaxMs;
}
public long getSchemaRatisConsensusLogAppenderBufferSizeMax() {
@@ -3352,9 +3352,9 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusLogAppenderBufferSizeMax(
- long schemaRatisConsensusLogAppenderBufferSizeMax) {
+ long schemaRatisConsensusLogAppenderBufferSizeMax) {
this.schemaRatisConsensusLogAppenderBufferSizeMax =
- schemaRatisConsensusLogAppenderBufferSizeMax;
+ schemaRatisConsensusLogAppenderBufferSizeMax;
}
public long getSchemaRatisConsensusSnapshotTriggerThreshold() {
@@ -3362,9 +3362,9 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusSnapshotTriggerThreshold(
- long schemaRatisConsensusSnapshotTriggerThreshold) {
+ long schemaRatisConsensusSnapshotTriggerThreshold) {
this.schemaRatisConsensusSnapshotTriggerThreshold =
- schemaRatisConsensusSnapshotTriggerThreshold;
+ schemaRatisConsensusSnapshotTriggerThreshold;
}
public boolean isSchemaRatisConsensusLogUnsafeFlushEnable() {
@@ -3372,7 +3372,7 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusLogUnsafeFlushEnable(
- boolean schemaRatisConsensusLogUnsafeFlushEnable) {
+ boolean schemaRatisConsensusLogUnsafeFlushEnable) {
this.schemaRatisConsensusLogUnsafeFlushEnable = schemaRatisConsensusLogUnsafeFlushEnable;
}
@@ -3389,7 +3389,7 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusGrpcFlowControlWindow(
- long schemaRatisConsensusGrpcFlowControlWindow) {
+ long schemaRatisConsensusGrpcFlowControlWindow) {
this.schemaRatisConsensusGrpcFlowControlWindow = schemaRatisConsensusGrpcFlowControlWindow;
}
@@ -3398,9 +3398,9 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusLeaderElectionTimeoutMinMs(
- long schemaRatisConsensusLeaderElectionTimeoutMinMs) {
+ long schemaRatisConsensusLeaderElectionTimeoutMinMs) {
this.schemaRatisConsensusLeaderElectionTimeoutMinMs =
- schemaRatisConsensusLeaderElectionTimeoutMinMs;
+ schemaRatisConsensusLeaderElectionTimeoutMinMs;
}
public long getSchemaRatisConsensusLeaderElectionTimeoutMaxMs() {
@@ -3408,9 +3408,9 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusLeaderElectionTimeoutMaxMs(
- long schemaRatisConsensusLeaderElectionTimeoutMaxMs) {
+ long schemaRatisConsensusLeaderElectionTimeoutMaxMs) {
this.schemaRatisConsensusLeaderElectionTimeoutMaxMs =
- schemaRatisConsensusLeaderElectionTimeoutMaxMs;
+ schemaRatisConsensusLeaderElectionTimeoutMaxMs;
}
public long getCqMinEveryIntervalInMs() {
@@ -3478,7 +3478,7 @@ public class IoTDBConfig {
}
public void setSchemaRatisConsensusInitialSleepTimeMs(
- long schemaRatisConsensusInitialSleepTimeMs) {
+ long schemaRatisConsensusInitialSleepTimeMs) {
this.schemaRatisConsensusInitialSleepTimeMs = schemaRatisConsensusInitialSleepTimeMs;
}
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java
index 2997118326..1a5ad7560f 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/SourceHandleTest.java
@@ -69,7 +69,7 @@ public class SourceHandleTest {
final String queryId = "q0";
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -79,24 +79,24 @@ public class SourceHandleTest {
MemoryPool mockMemoryPool = Utils.createMockNonBlockedMemoryPool();
Mockito.when(mockLocalMemoryManager.getQueryPool()).thenReturn(mockMemoryPool);
IClientManager<TEndPoint, SyncDataNodeMPPDataExchangeServiceClient> mockClientManager =
- Mockito.mock(IClientManager.class);
+ Mockito.mock(IClientManager.class);
// Construct a mock client.
SyncDataNodeMPPDataExchangeServiceClient mockClient =
- Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
+ Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
try {
Mockito.when(mockClientManager.borrowClient(remoteEndpoint)).thenReturn(mockClient);
Mockito.doAnswer(
- invocation -> {
- TGetDataBlockRequest req = invocation.getArgument(0);
- List<ByteBuffer> byteBuffers =
- new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
- for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
- byteBuffers.add(ByteBuffer.allocate(0));
- }
- return new TGetDataBlockResponse(byteBuffers);
- })
- .when(mockClient)
- .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
+ invocation -> {
+ TGetDataBlockRequest req = invocation.getArgument(0);
+ List<ByteBuffer> byteBuffers =
+ new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
+ for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
+ byteBuffers.add(ByteBuffer.allocate(0));
+ }
+ return new TGetDataBlockResponse(byteBuffers);
+ })
+ .when(mockClient)
+ .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
} catch (ClientManagerException | TException e) {
e.printStackTrace();
Assert.fail();
@@ -107,16 +107,16 @@ public class SourceHandleTest {
TsBlockSerde mockTsBlockSerde = Utils.createMockTsBlockSerde(MOCK_TSBLOCK_SIZE);
SourceHandle sourceHandle =
- new SourceHandle(
- remoteEndpoint,
- remoteFragmentInstanceId,
- localFragmentInstanceId,
- localPlanNodeId,
- mockLocalMemoryManager,
- Executors.newSingleThreadExecutor(),
- mockTsBlockSerde,
- mockSourceHandleListener,
- mockClientManager);
+ new SourceHandle(
+ remoteEndpoint,
+ remoteFragmentInstanceId,
+ localFragmentInstanceId,
+ localPlanNodeId,
+ mockLocalMemoryManager,
+ Executors.newSingleThreadExecutor(),
+ mockTsBlockSerde,
+ mockSourceHandleListener,
+ mockClientManager);
Assert.assertFalse(sourceHandle.isBlocked().isDone());
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
@@ -124,25 +124,25 @@ public class SourceHandleTest {
// New data blocks event arrived.
sourceHandle.updatePendingDataBlockInfo(
- 0,
- Stream.generate(() -> MOCK_TSBLOCK_SIZE)
- .limit(numOfMockTsBlock)
- .collect(Collectors.toList()));
+ 0,
+ Stream.generate(() -> MOCK_TSBLOCK_SIZE)
+ .limit(numOfMockTsBlock)
+ .collect(Collectors.toList()));
try {
Mockito.verify(mockClient, Mockito.timeout(10_000).times(1))
- .getDataBlock(
- Mockito.argThat(
- req ->
- remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
- && 0 == req.getStartSequenceId()
- && numOfMockTsBlock == req.getEndSequenceId()));
+ .getDataBlock(
+ Mockito.argThat(
+ req ->
+ remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
+ && 0 == req.getStartSequenceId()
+ && numOfMockTsBlock == req.getEndSequenceId()));
Mockito.verify(mockClient, Mockito.timeout(10_0000).times(1))
- .onAcknowledgeDataBlockEvent(
- Mockito.argThat(
- e ->
- remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
- && 0 == e.getStartSequenceId()
- && numOfMockTsBlock == e.getEndSequenceId()));
+ .onAcknowledgeDataBlockEvent(
+ Mockito.argThat(
+ e ->
+ remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
+ && 0 == e.getStartSequenceId()
+ && numOfMockTsBlock == e.getEndSequenceId()));
} catch (TException e) {
e.printStackTrace();
Assert.fail();
@@ -151,7 +151,7 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(
- numOfMockTsBlock * MOCK_TSBLOCK_SIZE, sourceHandle.getBufferRetainedSizeInBytes());
+ numOfMockTsBlock * MOCK_TSBLOCK_SIZE, sourceHandle.getBufferRetainedSizeInBytes());
// The local fragment instance consumes the data blocks.
for (int i = 0; i < numOfMockTsBlock; i++) {
@@ -164,8 +164,8 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(
- (numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
- sourceHandle.getBufferRetainedSizeInBytes());
+ (numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
+ sourceHandle.getBufferRetainedSizeInBytes());
}
// Receive EndOfDataBlock event from upstream fragment instance.
@@ -175,7 +175,7 @@ public class SourceHandleTest {
Assert.assertTrue(sourceHandle.isFinished());
Assert.assertEquals(0L, sourceHandle.getBufferRetainedSizeInBytes());
Mockito.verify(mockSourceHandleListener, Mockito.timeout(10_0000).times(1))
- .onFinished(sourceHandle);
+ .onFinished(sourceHandle);
}
@Test
@@ -183,7 +183,7 @@ public class SourceHandleTest {
final String queryId = "q0";
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -191,27 +191,27 @@ public class SourceHandleTest {
// Construct a mock LocalMemoryManager with capacity 5 * MOCK_TSBLOCK_SIZE per query.
LocalMemoryManager mockLocalMemoryManager = Mockito.mock(LocalMemoryManager.class);
MemoryPool spyMemoryPool =
- Mockito.spy(new MemoryPool("test", 10 * MOCK_TSBLOCK_SIZE, 5 * MOCK_TSBLOCK_SIZE));
+ Mockito.spy(new MemoryPool("test", 10 * MOCK_TSBLOCK_SIZE, 5 * MOCK_TSBLOCK_SIZE));
Mockito.when(mockLocalMemoryManager.getQueryPool()).thenReturn(spyMemoryPool);
IClientManager<TEndPoint, SyncDataNodeMPPDataExchangeServiceClient> mockClientManager =
- Mockito.mock(IClientManager.class);
+ Mockito.mock(IClientManager.class);
// Construct a mock client.
SyncDataNodeMPPDataExchangeServiceClient mockClient =
- Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
+ Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
try {
Mockito.when(mockClientManager.borrowClient(remoteEndpoint)).thenReturn(mockClient);
Mockito.doAnswer(
- invocation -> {
- TGetDataBlockRequest req = invocation.getArgument(0);
- List<ByteBuffer> byteBuffers =
- new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
- for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
- byteBuffers.add(ByteBuffer.allocate(0));
- }
- return new TGetDataBlockResponse(byteBuffers);
- })
- .when(mockClient)
- .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
+ invocation -> {
+ TGetDataBlockRequest req = invocation.getArgument(0);
+ List<ByteBuffer> byteBuffers =
+ new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
+ for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
+ byteBuffers.add(ByteBuffer.allocate(0));
+ }
+ return new TGetDataBlockResponse(byteBuffers);
+ })
+ .when(mockClient)
+ .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
} catch (ClientManagerException | TException e) {
e.printStackTrace();
Assert.fail();
@@ -222,20 +222,20 @@ public class SourceHandleTest {
TsBlockSerde mockTsBlockSerde = Utils.createMockTsBlockSerde(MOCK_TSBLOCK_SIZE);
SourceHandle sourceHandle =
- new SourceHandle(
- remoteEndpoint,
- remoteFragmentInstanceId,
- localFragmentInstanceId,
- localPlanNodeId,
- mockLocalMemoryManager,
- Executors.newSingleThreadExecutor(),
- mockTsBlockSerde,
- mockSourceHandleListener,
- mockClientManager);
+ new SourceHandle(
+ remoteEndpoint,
+ remoteFragmentInstanceId,
+ localFragmentInstanceId,
+ localPlanNodeId,
+ mockLocalMemoryManager,
+ Executors.newSingleThreadExecutor(),
+ mockTsBlockSerde,
+ mockSourceHandleListener,
+ mockClientManager);
long maxBytesCanReserve =
- Math.min(
- 5 * MOCK_TSBLOCK_SIZE,
- IoTDBDescriptor.getInstance().getConfig().getMaxBytesPerFragmentInstance());
+ Math.min(
+ 5 * MOCK_TSBLOCK_SIZE,
+ IoTDBDescriptor.getInstance().getConfig().getMaxBytesPerFragmentInstance());
sourceHandle.setMaxBytesCanReserve(maxBytesCanReserve);
Assert.assertFalse(sourceHandle.isBlocked().isDone());
Assert.assertFalse(sourceHandle.isAborted());
@@ -244,32 +244,32 @@ public class SourceHandleTest {
// New data blocks event arrived.
sourceHandle.updatePendingDataBlockInfo(
- 0,
- Stream.generate(() -> MOCK_TSBLOCK_SIZE)
- .limit(numOfMockTsBlock)
- .collect(Collectors.toList()));
+ 0,
+ Stream.generate(() -> MOCK_TSBLOCK_SIZE)
+ .limit(numOfMockTsBlock)
+ .collect(Collectors.toList()));
try {
Mockito.verify(spyMemoryPool, Mockito.timeout(10_000).times(6))
- .reserve(
- queryId,
- localFragmentInstanceId.getInstanceId(),
- localPlanNodeId,
- MOCK_TSBLOCK_SIZE,
- maxBytesCanReserve);
+ .reserve(
+ queryId,
+ localFragmentInstanceId.getInstanceId(),
+ localPlanNodeId,
+ MOCK_TSBLOCK_SIZE,
+ maxBytesCanReserve);
Mockito.verify(mockClient, Mockito.timeout(10_0000).times(1))
- .getDataBlock(
- Mockito.argThat(
- req ->
- remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
- && 0 == req.getStartSequenceId()
- && 5 == req.getEndSequenceId()));
+ .getDataBlock(
+ Mockito.argThat(
+ req ->
+ remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
+ && 0 == req.getStartSequenceId()
+ && 5 == req.getEndSequenceId()));
Mockito.verify(mockClient, Mockito.timeout(10_0000).times(1))
- .onAcknowledgeDataBlockEvent(
- Mockito.argThat(
- e ->
- remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
- && 0 == e.getStartSequenceId()
- && 5 == e.getEndSequenceId()));
+ .onAcknowledgeDataBlockEvent(
+ Mockito.argThat(
+ e ->
+ remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
+ && 0 == e.getStartSequenceId()
+ && 5 == e.getEndSequenceId()));
} catch (TException e) {
e.printStackTrace();
Assert.fail();
@@ -282,33 +282,33 @@ public class SourceHandleTest {
// The local fragment instance consumes the data blocks.
for (int i = 0; i < numOfMockTsBlock; i++) {
Mockito.verify(spyMemoryPool, Mockito.timeout(10_0000).times(i))
- .free(
- queryId, localFragmentInstanceId.getInstanceId(), localPlanNodeId, MOCK_TSBLOCK_SIZE);
+ .free(
+ queryId, localFragmentInstanceId.getInstanceId(), localPlanNodeId, MOCK_TSBLOCK_SIZE);
sourceHandle.receive();
try {
if (i < 5) {
Assert.assertEquals(
- i == 4 ? 5 * MOCK_TSBLOCK_SIZE : 6 * MOCK_TSBLOCK_SIZE,
- sourceHandle.getBufferRetainedSizeInBytes());
+ i == 4 ? 5 * MOCK_TSBLOCK_SIZE : 6 * MOCK_TSBLOCK_SIZE,
+ sourceHandle.getBufferRetainedSizeInBytes());
final int startSequenceId = 5 + i;
Mockito.verify(mockClient, Mockito.timeout(10_000).times(1))
- .getDataBlock(
- Mockito.argThat(
- req ->
- remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
- && startSequenceId == req.getStartSequenceId()
- && startSequenceId + 1 == req.getEndSequenceId()));
+ .getDataBlock(
+ Mockito.argThat(
+ req ->
+ remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
+ && startSequenceId == req.getStartSequenceId()
+ && startSequenceId + 1 == req.getEndSequenceId()));
Mockito.verify(mockClient, Mockito.timeout(10_000).times(1))
- .onAcknowledgeDataBlockEvent(
- Mockito.argThat(
- e ->
- remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
- && startSequenceId == e.getStartSequenceId()
- && startSequenceId + 1 == e.getEndSequenceId()));
+ .onAcknowledgeDataBlockEvent(
+ Mockito.argThat(
+ e ->
+ remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
+ && startSequenceId == e.getStartSequenceId()
+ && startSequenceId + 1 == e.getEndSequenceId()));
} else {
Assert.assertEquals(
- (numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
- sourceHandle.getBufferRetainedSizeInBytes());
+ (numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
+ sourceHandle.getBufferRetainedSizeInBytes());
}
} catch (TException e) {
e.printStackTrace();
@@ -330,7 +330,7 @@ public class SourceHandleTest {
Assert.assertTrue(sourceHandle.isFinished());
Assert.assertEquals(0L, sourceHandle.getBufferRetainedSizeInBytes());
Mockito.verify(mockSourceHandleListener, Mockito.timeout(10_0000).times(1))
- .onFinished(sourceHandle);
+ .onFinished(sourceHandle);
}
@Test
@@ -339,7 +339,7 @@ public class SourceHandleTest {
final long MOCK_TSBLOCK_SIZE = 1024L * 1024L;
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -353,40 +353,40 @@ public class SourceHandleTest {
// Construct a mock TsBlockSerde that deserializes any bytebuffer into a mock TsBlock.
TsBlockSerde mockTsBlockSerde = Utils.createMockTsBlockSerde(MOCK_TSBLOCK_SIZE);
IClientManager<TEndPoint, SyncDataNodeMPPDataExchangeServiceClient> mockClientManager =
- Mockito.mock(IClientManager.class);
+ Mockito.mock(IClientManager.class);
// Construct a mock client.
SyncDataNodeMPPDataExchangeServiceClient mockClient =
- Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
+ Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
try {
Mockito.when(mockClientManager.borrowClient(remoteEndpoint)).thenReturn(mockClient);
Mockito.doAnswer(
- invocation -> {
- TGetDataBlockRequest req = invocation.getArgument(0);
- List<ByteBuffer> byteBuffers =
- new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
- for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
- byteBuffers.add(ByteBuffer.allocate(0));
- }
- return new TGetDataBlockResponse(byteBuffers);
- })
- .when(mockClient)
- .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
+ invocation -> {
+ TGetDataBlockRequest req = invocation.getArgument(0);
+ List<ByteBuffer> byteBuffers =
+ new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
+ for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
+ byteBuffers.add(ByteBuffer.allocate(0));
+ }
+ return new TGetDataBlockResponse(byteBuffers);
+ })
+ .when(mockClient)
+ .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
} catch (ClientManagerException | TException e) {
e.printStackTrace();
Assert.fail();
}
SourceHandle sourceHandle =
- new SourceHandle(
- remoteEndpoint,
- remoteFragmentInstanceId,
- localFragmentInstanceId,
- localPlanNodeId,
- mockLocalMemoryManager,
- Executors.newSingleThreadExecutor(),
- mockTsBlockSerde,
- mockSourceHandleListener,
- mockClientManager);
+ new SourceHandle(
+ remoteEndpoint,
+ remoteFragmentInstanceId,
+ localFragmentInstanceId,
+ localPlanNodeId,
+ mockLocalMemoryManager,
+ Executors.newSingleThreadExecutor(),
+ mockTsBlockSerde,
+ mockSourceHandleListener,
+ mockClientManager);
Assert.assertFalse(sourceHandle.isBlocked().isDone());
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
@@ -394,15 +394,15 @@ public class SourceHandleTest {
// New data blocks event arrived in unordered manner.
sourceHandle.updatePendingDataBlockInfo(
- numOfMockTsBlock,
- Stream.generate(() -> MOCK_TSBLOCK_SIZE)
- .limit(numOfMockTsBlock)
- .collect(Collectors.toList()));
+ numOfMockTsBlock,
+ Stream.generate(() -> MOCK_TSBLOCK_SIZE)
+ .limit(numOfMockTsBlock)
+ .collect(Collectors.toList()));
try {
Mockito.verify(mockClient, Mockito.timeout(10_000).times(0))
- .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
+ .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
Mockito.verify(mockClient, Mockito.timeout(10_0000).times(0))
- .onAcknowledgeDataBlockEvent(Mockito.any(TAcknowledgeDataBlockEvent.class));
+ .onAcknowledgeDataBlockEvent(Mockito.any(TAcknowledgeDataBlockEvent.class));
} catch (TException e) {
e.printStackTrace();
Assert.fail();
@@ -413,25 +413,25 @@ public class SourceHandleTest {
Assert.assertEquals(0L, sourceHandle.getBufferRetainedSizeInBytes());
sourceHandle.updatePendingDataBlockInfo(
- 0,
- Stream.generate(() -> MOCK_TSBLOCK_SIZE)
- .limit(numOfMockTsBlock)
- .collect(Collectors.toList()));
+ 0,
+ Stream.generate(() -> MOCK_TSBLOCK_SIZE)
+ .limit(numOfMockTsBlock)
+ .collect(Collectors.toList()));
try {
Mockito.verify(mockClient, Mockito.timeout(10_000).times(1))
- .getDataBlock(
- Mockito.argThat(
- req ->
- remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
- && 0 == req.getStartSequenceId()
- && numOfMockTsBlock * 2 == req.getEndSequenceId()));
+ .getDataBlock(
+ Mockito.argThat(
+ req ->
+ remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
+ && 0 == req.getStartSequenceId()
+ && numOfMockTsBlock * 2 == req.getEndSequenceId()));
Mockito.verify(mockClient, Mockito.timeout(10_0000).times(1))
- .onAcknowledgeDataBlockEvent(
- Mockito.argThat(
- e ->
- remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
- && 0 == e.getStartSequenceId()
- && numOfMockTsBlock * 2 == e.getEndSequenceId()));
+ .onAcknowledgeDataBlockEvent(
+ Mockito.argThat(
+ e ->
+ remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
+ && 0 == e.getStartSequenceId()
+ && numOfMockTsBlock * 2 == e.getEndSequenceId()));
} catch (TException e) {
e.printStackTrace();
Assert.fail();
@@ -440,7 +440,7 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(
- numOfMockTsBlock * 2 * MOCK_TSBLOCK_SIZE, sourceHandle.getBufferRetainedSizeInBytes());
+ numOfMockTsBlock * 2 * MOCK_TSBLOCK_SIZE, sourceHandle.getBufferRetainedSizeInBytes());
// The local fragment instance consumes the data blocks.
for (int i = 0; i < 2 * numOfMockTsBlock; i++) {
@@ -453,31 +453,31 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(
- (2 * numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
- sourceHandle.getBufferRetainedSizeInBytes());
+ (2 * numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
+ sourceHandle.getBufferRetainedSizeInBytes());
}
// New data blocks event arrived.
sourceHandle.updatePendingDataBlockInfo(
- numOfMockTsBlock * 2,
- Stream.generate(() -> MOCK_TSBLOCK_SIZE)
- .limit(numOfMockTsBlock)
- .collect(Collectors.toList()));
+ numOfMockTsBlock * 2,
+ Stream.generate(() -> MOCK_TSBLOCK_SIZE)
+ .limit(numOfMockTsBlock)
+ .collect(Collectors.toList()));
try {
Mockito.verify(mockClient, Mockito.timeout(10_000).times(1))
- .getDataBlock(
- Mockito.argThat(
- req ->
- remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
- && numOfMockTsBlock * 2 == req.getStartSequenceId()
- && numOfMockTsBlock * 3 == req.getEndSequenceId()));
+ .getDataBlock(
+ Mockito.argThat(
+ req ->
+ remoteFragmentInstanceId.equals(req.getSourceFragmentInstanceId())
+ && numOfMockTsBlock * 2 == req.getStartSequenceId()
+ && numOfMockTsBlock * 3 == req.getEndSequenceId()));
Mockito.verify(mockClient, Mockito.timeout(10_0000).times(1))
- .onAcknowledgeDataBlockEvent(
- Mockito.argThat(
- e ->
- remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
- && numOfMockTsBlock * 2 == e.getStartSequenceId()
- && numOfMockTsBlock * 3 == e.getEndSequenceId()));
+ .onAcknowledgeDataBlockEvent(
+ Mockito.argThat(
+ e ->
+ remoteFragmentInstanceId.equals(e.getSourceFragmentInstanceId())
+ && numOfMockTsBlock * 2 == e.getStartSequenceId()
+ && numOfMockTsBlock * 3 == e.getEndSequenceId()));
} catch (TException e) {
e.printStackTrace();
Assert.fail();
@@ -486,7 +486,7 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(
- numOfMockTsBlock * MOCK_TSBLOCK_SIZE, sourceHandle.getBufferRetainedSizeInBytes());
+ numOfMockTsBlock * MOCK_TSBLOCK_SIZE, sourceHandle.getBufferRetainedSizeInBytes());
// The local fragment instance consumes the data blocks.
for (int i = 0; i < numOfMockTsBlock; i++) {
@@ -499,8 +499,8 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isAborted());
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(
- (numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
- sourceHandle.getBufferRetainedSizeInBytes());
+ (numOfMockTsBlock - 1 - i) * MOCK_TSBLOCK_SIZE,
+ sourceHandle.getBufferRetainedSizeInBytes());
}
// Receive EndOfDataBlock event from upstream fragment instance.
@@ -510,7 +510,7 @@ public class SourceHandleTest {
Assert.assertTrue(sourceHandle.isFinished());
Assert.assertEquals(0L, sourceHandle.getBufferRetainedSizeInBytes());
Mockito.verify(mockSourceHandleListener, Mockito.timeout(10_0000).times(1))
- .onFinished(sourceHandle);
+ .onFinished(sourceHandle);
}
@Test
@@ -519,7 +519,7 @@ public class SourceHandleTest {
final long MOCK_TSBLOCK_SIZE = 1024L * 1024L;
final int numOfMockTsBlock = 10;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -533,32 +533,32 @@ public class SourceHandleTest {
// Construct a mock TsBlockSerde that deserializes any bytebuffer into a mock TsBlock.
TsBlockSerde mockTsBlockSerde = Utils.createMockTsBlockSerde(MOCK_TSBLOCK_SIZE);
IClientManager<TEndPoint, SyncDataNodeMPPDataExchangeServiceClient> mockClientManager =
- Mockito.mock(IClientManager.class);
+ Mockito.mock(IClientManager.class);
// Construct a mock client.
SyncDataNodeMPPDataExchangeServiceClient mockClient =
- Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
+ Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
TException mockException = new TException("Mock exception");
try {
Mockito.when(mockClientManager.borrowClient(remoteEndpoint)).thenReturn(mockClient);
Mockito.doThrow(mockException)
- .when(mockClient)
- .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
+ .when(mockClient)
+ .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
} catch (ClientManagerException | TException e) {
e.printStackTrace();
Assert.fail();
}
SourceHandle sourceHandle =
- new SourceHandle(
- remoteEndpoint,
- remoteFragmentInstanceId,
- localFragmentInstanceId,
- localPlanNodeId,
- mockLocalMemoryManager,
- Executors.newSingleThreadExecutor(),
- mockTsBlockSerde,
- mockSourceHandleListener,
- mockClientManager);
+ new SourceHandle(
+ remoteEndpoint,
+ remoteFragmentInstanceId,
+ localFragmentInstanceId,
+ localPlanNodeId,
+ mockLocalMemoryManager,
+ Executors.newSingleThreadExecutor(),
+ mockTsBlockSerde,
+ mockSourceHandleListener,
+ mockClientManager);
sourceHandle.setRetryIntervalInMs(0L);
Future<?> blocked = sourceHandle.isBlocked();
Assert.assertFalse(blocked.isDone());
@@ -568,20 +568,20 @@ public class SourceHandleTest {
// New data blocks event arrived.
sourceHandle.updatePendingDataBlockInfo(
- 0,
- Stream.generate(() -> MOCK_TSBLOCK_SIZE)
- .limit(numOfMockTsBlock)
- .collect(Collectors.toList()));
+ 0,
+ Stream.generate(() -> MOCK_TSBLOCK_SIZE)
+ .limit(numOfMockTsBlock)
+ .collect(Collectors.toList()));
try {
Mockito.verify(mockClient, Mockito.timeout(10_000).times(SourceHandle.MAX_ATTEMPT_TIMES))
- .getDataBlock(Mockito.any());
+ .getDataBlock(Mockito.any());
} catch (TException e) {
e.printStackTrace();
Assert.fail();
}
Mockito.verify(mockSourceHandleListener, Mockito.timeout(10_0000).times(1))
- .onFailure(sourceHandle, mockException);
+ .onFailure(sourceHandle, mockException);
Assert.assertFalse(blocked.isDone());
sourceHandle.abort();
@@ -590,7 +590,7 @@ public class SourceHandleTest {
Assert.assertTrue(blocked.isDone());
Assert.assertEquals(0L, sourceHandle.getBufferRetainedSizeInBytes());
Mockito.verify(mockSourceHandleListener, Mockito.timeout(10_0000).times(1))
- .onAborted(sourceHandle);
+ .onAborted(sourceHandle);
}
@Test
@@ -598,7 +598,7 @@ public class SourceHandleTest {
final String queryId = "q0";
final long MOCK_TSBLOCK_SIZE = 1024L * 1024L;
final TEndPoint remoteEndpoint =
- new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
+ new TEndPoint("remote", IoTDBDescriptor.getInstance().getConfig().getMppDataExchangePort());
final TFragmentInstanceId remoteFragmentInstanceId = new TFragmentInstanceId(queryId, 1, "0");
final String localPlanNodeId = "exchange_0";
final TFragmentInstanceId localFragmentInstanceId = new TFragmentInstanceId(queryId, 0, "0");
@@ -608,24 +608,24 @@ public class SourceHandleTest {
MemoryPool mockMemoryPool = Utils.createMockNonBlockedMemoryPool();
Mockito.when(mockLocalMemoryManager.getQueryPool()).thenReturn(mockMemoryPool);
IClientManager<TEndPoint, SyncDataNodeMPPDataExchangeServiceClient> mockClientManager =
- Mockito.mock(IClientManager.class);
+ Mockito.mock(IClientManager.class);
// Construct a mock client.
SyncDataNodeMPPDataExchangeServiceClient mockClient =
- Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
+ Mockito.mock(SyncDataNodeMPPDataExchangeServiceClient.class);
try {
Mockito.when(mockClientManager.borrowClient(remoteEndpoint)).thenReturn(mockClient);
Mockito.doAnswer(
- invocation -> {
- TGetDataBlockRequest req = invocation.getArgument(0);
- List<ByteBuffer> byteBuffers =
- new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
- for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
- byteBuffers.add(ByteBuffer.allocate(0));
- }
- return new TGetDataBlockResponse(byteBuffers);
- })
- .when(mockClient)
- .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
+ invocation -> {
+ TGetDataBlockRequest req = invocation.getArgument(0);
+ List<ByteBuffer> byteBuffers =
+ new ArrayList<>(req.getEndSequenceId() - req.getStartSequenceId());
+ for (int i = 0; i < req.getEndSequenceId() - req.getStartSequenceId(); i++) {
+ byteBuffers.add(ByteBuffer.allocate(0));
+ }
+ return new TGetDataBlockResponse(byteBuffers);
+ })
+ .when(mockClient)
+ .getDataBlock(Mockito.any(TGetDataBlockRequest.class));
} catch (ClientManagerException | TException e) {
e.printStackTrace();
Assert.fail();
@@ -636,16 +636,16 @@ public class SourceHandleTest {
TsBlockSerde mockTsBlockSerde = Utils.createMockTsBlockSerde(MOCK_TSBLOCK_SIZE);
SourceHandle sourceHandle =
- new SourceHandle(
- remoteEndpoint,
- remoteFragmentInstanceId,
- localFragmentInstanceId,
- localPlanNodeId,
- mockLocalMemoryManager,
- Executors.newSingleThreadExecutor(),
- mockTsBlockSerde,
- mockSourceHandleListener,
- mockClientManager);
+ new SourceHandle(
+ remoteEndpoint,
+ remoteFragmentInstanceId,
+ localFragmentInstanceId,
+ localPlanNodeId,
+ mockLocalMemoryManager,
+ Executors.newSingleThreadExecutor(),
+ mockTsBlockSerde,
+ mockSourceHandleListener,
+ mockClientManager);
Future<?> blocked = sourceHandle.isBlocked();
Assert.assertFalse(blocked.isDone());
Assert.assertFalse(blocked.isCancelled());
@@ -660,6 +660,6 @@ public class SourceHandleTest {
Assert.assertFalse(sourceHandle.isFinished());
Assert.assertEquals(0L, sourceHandle.getBufferRetainedSizeInBytes());
Mockito.verify(mockSourceHandleListener, Mockito.timeout(10_0000).times(1))
- .onAborted(sourceHandle);
+ .onAborted(sourceHandle);
}
}