This is an automated email from the ASF dual-hosted git repository.

east pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/cluster by this push:
     new 5173d5f  remove RaftNode
5173d5f is described below

commit 5173d5f9ade192fd039920b71e5cb42b476e6592
Author: mdf369 <[email protected]>
AuthorDate: Tue Mar 26 22:01:18 2019 +0800

    remove RaftNode
---
 .../org/apache/iotdb/cluster/entity/Server.java    |  4 -
 .../apache/iotdb/cluster/entity/raft/RaftNode.java | 97 ----------------------
 .../java/org/apache/iotdb/cluster/utils/Utils.java |  3 -
 3 files changed, 104 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/entity/Server.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/entity/Server.java
index 610894e..4a5267f 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/entity/Server.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/entity/Server.java
@@ -21,9 +21,7 @@ package org.apache.iotdb.cluster.entity;
 import com.alipay.remoting.rpc.RpcServer;
 import com.alipay.sofa.jraft.entity.PeerId;
 import com.alipay.sofa.jraft.rpc.RaftRpcServerFactory;
-import java.util.Collections;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import org.apache.iotdb.cluster.utils.PhysicalNode;
 import org.apache.iotdb.cluster.utils.RaftUtils;
@@ -35,10 +33,8 @@ import 
org.apache.iotdb.cluster.entity.data.DataPartitionHolder;
 import org.apache.iotdb.cluster.entity.metadata.MetadataHolder;
 import org.apache.iotdb.cluster.entity.raft.DataPartitionRaftHolder;
 import org.apache.iotdb.cluster.entity.raft.MetadataRaftHolder;
-import org.apache.iotdb.cluster.entity.raft.RaftNode;
 import org.apache.iotdb.db.auth.AuthException;
 import org.apache.iotdb.db.service.IoTDB;
-import org.apache.iotdb.tsfile.utils.Pair;
 
 public class Server {
 
diff --git 
a/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftNode.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftNode.java
deleted file mode 100644
index 476dcbc..0000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftNode.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.entity.raft;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RaftNode {
-
-  // TODO replace this by PeerId
-
-  private static final Logger LOGGER = LoggerFactory.getLogger(RaftNode.class);
-
-  private String ip;
-  private int port;
-  private int groupId;
-
-  public RaftNode() {
-  }
-
-  public RaftNode(String ip, int port, int groupId) {
-    this.ip = ip;
-    this.port = port;
-    this.groupId = groupId;
-  }
-
-  public String getIp() {
-    return ip;
-  }
-
-  public int getPort() {
-    return port;
-  }
-
-  public int getGroupId() {
-    return groupId;
-  }
-
-  /**
-   * Parse a raft node from string in the format of "ip:port:groupId",
-   * returns null if fail to parse.
-   *
-   * @param s input string with the format of "ip:port:groupId"
-   * @return parsed peer
-   */
-  public static RaftNode parseRaftNode(String s) {
-    final RaftNode node = new RaftNode();
-    if (node.parse(s)) {
-      return node;
-    }
-    return null;
-  }
-
-  /**
-   * Parse raftNode from string that generated by {@link #toString()}
-   */
-  public boolean parse(String s) {
-    final String[] tmps = s.split(":");
-    if (tmps.length != 3 && tmps.length != 2) {
-      return false;
-    }
-    try {
-      this.ip = tmps[0];
-      this.port = Integer.valueOf(tmps[1]);
-      if (tmps.length == 3) {
-        this.groupId = Integer.valueOf(tmps[2]);
-      } else {
-        this.groupId = 0;
-      }
-      return true;
-    } catch (final Exception e) {
-      LOGGER.error("Parse raft node from string failed: {}", s, e);
-      return false;
-    }
-  }
-
-  @Override
-  public String toString() {
-    return this.ip + ":" + this.port + ":" + this.groupId;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/utils/Utils.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/utils/Utils.java
index 10790b9..7be95a3 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/Utils.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/Utils.java
@@ -19,9 +19,6 @@
 package org.apache.iotdb.cluster.utils;
 
 import com.alipay.sofa.jraft.entity.PeerId;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.iotdb.cluster.entity.raft.RaftNode;
 
 public class Utils {
 

Reply via email to