You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yu...@apache.org on 2020/07/12 10:06:54 UTC
[incubator-iotdb] branch kyy2 updated: format
This is an automated email from the ASF dual-hosted git repository.
yuyuankang pushed a commit to branch kyy2
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/kyy2 by this push:
new 9e46e6b format
9e46e6b is described below
commit 9e46e6be957ec42bdd6fd6bfe451062c990ec37b
Author: Ring-k <yu...@hotmail.com>
AuthorDate: Sun Jul 12 18:06:08 2020 +0800
format
---
.../iotdb/cluster/query/ClusterPlanExecutor.java | 3 ++-
.../cluster/server/member/MetaGroupMember.java | 29 +++++++++++-----------
.../iotdb/db/qp/physical/crud/InsertPlan.java | 8 +++---
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
index ff2fc47..10dd62e 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
@@ -698,7 +698,8 @@ public class ClusterPlanExecutor extends PlanExecutor {
List<MeasurementSchema> schemas = metaGroupMember.pullTimeSeriesSchemas(schemasToPull);
for (MeasurementSchema schema : schemas) {
IoTDB.metaManager
- .cacheMeta(deviceId + IoTDBConstant.PATH_SEPARATOR + schema.getMeasurementId(), new MeasurementMeta(schema));
+ .cacheMeta(deviceId + IoTDBConstant.PATH_SEPARATOR + schema.getMeasurementId(),
+ new MeasurementMeta(schema));
}
logger.debug("Pulled {}/{} schemas from remote", schemas.size(), measurementList.length);
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
index a36ca6d..4778508 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
@@ -356,7 +356,6 @@ public class MetaGroupMember extends RaftMember {
}
-
/**
* Apply the addition of a new node. Register its identifier, add it to the node list and
* partition table, serialize the partition table and update the DataGroupMembers.
@@ -653,7 +652,6 @@ public class MetaGroupMember extends RaftMember {
}
-
/**
* @return Whether all nodes' identifier is known.
*/
@@ -682,7 +680,7 @@ public class MetaGroupMember extends RaftMember {
/**
* Process the join cluster request of "node". Only proceed when the partition table is ready.
*
- * @param node cannot be the local node
+ * @param node cannot be the local node
*/
public AddNodeResponse addNode(Node node, StartUpStatus startUpStatus)
throws AddSelfException, LogExecutionException {
@@ -978,7 +976,8 @@ public class MetaGroupMember extends RaftMember {
groupRemainings[nodeIndex]--;
}
} else {
- askRemoteGroupVote(node, groupRemainings, i, leaderShipStale, log, newLeaderTerm, request);
+ askRemoteGroupVote(node, groupRemainings, i, leaderShipStale, log, newLeaderTerm,
+ request);
}
}
@@ -1355,13 +1354,13 @@ public class MetaGroupMember extends RaftMember {
DeleteTimeSeriesPlan getDeleteTimeseriesPlanWithFullPaths(DeleteTimeSeriesPlan plan)
throws PathNotExistException {
Pair<List<String>, List<String>> getMatchedPathsRet = getMatchedPaths(plan.getPathsStrings());
- List<String> fullPathsStrings = getMatchedPathsRet.left;
+ List<String> fullPathsStrings = getMatchedPathsRet.left;
List<String> nonExistPathsStrings = getMatchedPathsRet.right;
if (!nonExistPathsStrings.isEmpty()) {
throw new PathNotExistException(new ArrayList<>(nonExistPathsStrings));
}
List<Path> fullPaths = new ArrayList<>();
- for(String pathStr : fullPathsStrings){
+ for (String pathStr : fullPathsStrings) {
fullPaths.add(new Path(pathStr));
}
plan.setPaths(fullPaths);
@@ -1454,7 +1453,7 @@ public class MetaGroupMember extends RaftMember {
setStorageGroupResult.getCode(), storageGroupName)
);
}
- if(plan instanceof InsertPlan){
+ if (plan instanceof InsertPlan) {
// try to create timeseries
boolean isAutoCreateTimeseriesSuccess = autoCreateTimeseries((InsertPlan) plan);
if (!isAutoCreateTimeseriesSuccess) {
@@ -1492,8 +1491,8 @@ public class MetaGroupMember extends RaftMember {
&& status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode()
&& ClusterDescriptor.getInstance().getConfig().isEnableAutoCreateSchema()) {
// try to create timeseries
- if(((InsertPlan)plan).getFailedMeasurements() != null){
- ((InsertPlan)plan).transform();
+ if (((InsertPlan) plan).getFailedMeasurements() != null) {
+ ((InsertPlan) plan).transform();
}
boolean hasCreate = autoCreateTimeseries((InsertPlan) plan);
if (hasCreate) {
@@ -1933,7 +1932,8 @@ public class MetaGroupMember extends RaftMember {
if (logger.isDebugEnabled()) {
logger.debug("{}: Pulled {} timeseries schemas of {} and other {} paths from {} of {}",
name,
- schemas.size(), request.getPrefixPaths().get(0), request.getPrefixPaths().size() - 1, node,
+ schemas.size(), request.getPrefixPaths().get(0), request.getPrefixPaths().size() - 1,
+ node,
request.getHeader());
}
results.addAll(schemas);
@@ -2880,16 +2880,16 @@ public class MetaGroupMember extends RaftMember {
}
-
/**
* Process the request of removing a node from the cluster. Reject the request if partition table
* is unavailable or the node is not the MetaLeader and it does not know who the leader is.
* Otherwise (being the MetaLeader), the request will be processed locally and broadcast to every
* node.
*
- * @param node the node to be removed.
+ * @param node the node to be removed.
*/
- public long removeNode(Node node) throws PartitionTableUnavailableException, LogExecutionException {
+ public long removeNode(Node node)
+ throws PartitionTableUnavailableException, LogExecutionException {
if (partitionTable == null) {
logger.info("Cannot add node now because the partition table is not set");
throw new PartitionTableUnavailableException(thisNode);
@@ -2901,13 +2901,12 @@ public class MetaGroupMember extends RaftMember {
}
-
/**
* Process a node removal request locally and broadcast it to the whole cluster. The removal will
* be rejected if number of nodes will fall below half of the replication number after this
* operation.
*
- * @param node the node to be removed.
+ * @param node the node to be removed.
* @return Long.MIN_VALUE if further forwarding is required, or the execution result
*/
private long processRemoveNodeLocally(Node node)
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
index ba89656..c7b9954 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
@@ -115,17 +115,17 @@ public abstract class InsertPlan extends PhysicalPlan {
}
measurements = failedMeasurements.toArray(new String[0]);
failedMeasurements = null;
- if(dataTypes != null){
+ if (dataTypes != null) {
TSDataType[] temp = dataTypes.clone();
dataTypes = new TSDataType[failedIndices.size()];
- for(int i = 0; i < failedIndices.size(); i++){
+ for (int i = 0; i < failedIndices.size(); i++) {
dataTypes[i] = temp[failedIndices.get(i)];
}
}
- if(schemas != null){
+ if (schemas != null) {
MeasurementSchema[] temp = schemas.clone();
schemas = new MeasurementSchema[failedIndices.size()];
- for(int i = 0; i < failedIndices.size(); i++){
+ for (int i = 0; i < failedIndices.size(); i++) {
schemas[i] = temp[failedIndices.get(i)];
}
}