Commit bca88fb1 authored by 吴晟's avatar 吴晟
Browse files

1.Remove two useless ClusterConfig. 2.Adjust ClusterConfig.class and its...

1.Remove two useless ClusterConfig. 2.Adjust ClusterConfig.class and its mapping properties file,  rename to ’seed_nodes’ .
parent 7d6dc495
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -41,8 +41,7 @@ public class CollectorSystem {
        final Config config = ConfigFactory.parseString("akka.remote.netty.tcp.hostname=" + ClusterConfig.Cluster.Current.hostname).
                withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=" + ClusterConfig.Cluster.Current.port)).
                withFallback(ConfigFactory.parseString("akka.cluster.roles=" + ClusterConfig.Cluster.Current.roles)).
                withFallback(ConfigFactory.parseString("akka.actor.provider=" + ClusterConfig.Cluster.provider)).
                withFallback(ConfigFactory.parseString("akka.cluster.seed-nodes=" + ClusterConfig.Cluster.nodes)).
                withFallback(ConfigFactory.parseString("akka.cluster.seed-nodes=" + ClusterConfig.Cluster.seed_nodes)).
                withFallback(ConfigFactory.load("application.conf"));
        ActorSystem akkaSystem = ActorSystem.create("ClusterSystem", config);

+2 −8
Original line number Diff line number Diff line
package com.a.eye.skywalking.collector.cluster;

import akka.actor.ActorSystem;

/**
 * A static class contains some config values of cluster.
 * {@link Cluster.Current#hostname} is a ip address of server which start this process.
 * {@link Cluster.Current#port} is a port of server use to bind
 * {@link Cluster.Current#roles} is a roles of workers that use to create workers which
 * has those role in this process.
 * {@link Cluster#nodes} is a nodes which cluster have.
 * {@link Cluster#appname} is a name of {@link ActorSystem} in cluster.
 * {@link Cluster#seed_nodes} is a seed_nodes which cluster have.
 *
 * @author pengys5
 */
@@ -22,9 +19,6 @@ public class ClusterConfig {
            public static String roles = "";
        }

        public static String nodes = "127.0.0.1:2551";

        public static final String appname = "CollectorSystem";
        public static final String provider = "akka.cluster.ClusterActorRefProvider";
        public static String seed_nodes = "127.0.0.1:2551";
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -53,8 +53,8 @@ public class ClusterConfigInitializer {
        if (!StringUtil.isEmpty(System.getProperty("cluster.current.roles"))) {
            ClusterConfig.Cluster.Current.roles = System.getProperty("cluster.current.roles");
        }
        if (!StringUtil.isEmpty(System.getProperty("cluster.nodes"))) {
            ClusterConfig.Cluster.nodes = System.getProperty("cluster.nodes");
        if (!StringUtil.isEmpty(System.getProperty("cluster.seed_nodes"))) {
            ClusterConfig.Cluster.seed_nodes = System.getProperty("cluster.seed_nodes");
        }
    }
}
+1 −2
Original line number Diff line number Diff line
package com.a.eye.skywalking.collector.commons.serializer;

import akka.serialization.JSerializer;
import com.a.eye.skywalking.collector.CollectorSystem;
import com.a.eye.skywalking.logging.ILog;
import com.a.eye.skywalking.logging.LogManager;
import com.a.eye.skywalking.trace.TraceSegment;
@@ -12,7 +11,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
 * @author pengys5
 */
public class TraceSegmentSerializer extends JSerializer {
    private static ILog logger = LogManager.getLogger(CollectorSystem.class);
    private static ILog logger = LogManager.getLogger(TraceSegmentSerializer.class);

    @Override
    public boolean includeManifest() {
+1 −2
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@ public class CollectorBootStartUp {
        final Config config = ConfigFactory.parseString("akka.remote.netty.tcp.hostname=" + ClusterConfig.Cluster.Current.hostname).
                withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=" + ClusterConfig.Cluster.Current.port)).
                withFallback(ConfigFactory.parseString("akka.cluster.roles=" + ClusterConfig.Cluster.Current.roles)).
                withFallback(ConfigFactory.parseString("akka.actor.provider=" + ClusterConfig.Cluster.provider)).
                withFallback(ConfigFactory.parseString("akka.cluster.seed-nodes=" + ClusterConfig.Cluster.nodes)).
                withFallback(ConfigFactory.parseString("akka.cluster.seed-nodes=" + ClusterConfig.Cluster.seed_nodes)).
                withFallback(ConfigFactory.load("application.conf"));

//        ActorSystem system = ActorSystem.create(ClusterConfig.Cluster.appname, config);
Loading