Unverified Commit 8cd327d8 authored by 吴晟's avatar 吴晟 Committed by GitHub
Browse files

Revert #1790 reset feature and provide default alarm settings. (#1833)

* Revert reset feature.

* Set default dist alarm settings and make dist package setting files right.

* Support empty list.
parent 2dd4f549
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -152,10 +152,4 @@ public class DataCarrier<T> {
            consumerPool.close();
        }
    }

    public void clear() {
        for (int i = 0; i < channels.getChannelSize(); i++) {
            channels.getBuffer(i).clear();
        }
    }
}
+0 −6
Original line number Diff line number Diff line
@@ -91,10 +91,4 @@ public class Buffer<T> {
        return result;
    }

    public void clear() {
        for (Object obj : buffer) {
            obj = null;
        }
    }

}
+2 −16
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
 *
 */


package org.apache.skywalking.apm.agent.core.conf;

import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
@@ -69,21 +70,6 @@ public class Config {
         * Skywalking team may ask for these files in order to resolve compatible problem.
         */
        public static boolean IS_OPEN_DEBUGGING_CLASS = false;

        /**
         * Specify register.status dir ,This is an option, the default is AGENT_HOME/option/reset.status.
         */
        public static String REGISTER_STATUS_DIR = "skywalking-agent/option";

        /**
         * Specify instance_uuid to ensure that the whole show is unique, for example: applicationName_ip_12
         */
        public static String INSTANCE_UUID = "";
        /**
         * enabled means that the reset function is enabled, and disabled means that the reset function is not enabled. A reset can be triggered by modifying the configuration file only if the reset feature is enabled.
         */
        public static String RESETER_LISTENER = "disabled";

    }

    public static class Collector {
@@ -94,7 +80,7 @@ public class Config {
        /**
         * application and service registry check interval
         */
        public static long SERVICE_AND_ENDPOINT_REGISTER_CHECK_INTERVAL = 3;
        public static long APP_AND_SERVICE_REGISTER_CHECK_INTERVAL = 3;
        /**
         * Collector skywalking trace receiver service addresses.
         */
+12 −11
Original line number Diff line number Diff line
@@ -41,23 +41,24 @@ import org.apache.skywalking.apm.util.StringUtil;
 */
public class SnifferConfigInitializer {
    private static final ILog logger = LogManager.getLogger(SnifferConfigInitializer.class);
    private static final String SPECIFIED_CONFIG_PATH = "skywalking_config";
    private static final String DEFAULT_CONFIG_FILE_NAME = "/config/agent.config";
    private static final String ENV_KEY_PREFIX = "skywalking.";
    private static final String INSTANCE_UUID_NAME = "agent.instance_uuid";
    private static final String REGISTER_STATUS_DIR = "agent.register_status_dir";
    private static String SPECIFIED_CONFIG_PATH = "skywalking_config";
    private static String DEFAULT_CONFIG_FILE_NAME = "/config/agent.config";
    private static String ENV_KEY_PREFIX = "skywalking.";
    private static boolean IS_INIT_COMPLETED = false;

    /**
     * If the specified agent config path is set, the agent will try to locate the specified agent config. If the
     * specified agent config path is not set , the agent will try to locate `agent.config`, which should be in the
     * /config dictionary of agent package. <p> Also try to override the config by system.env and system.properties. All
     * the keys in these two places should start with {@link #ENV_KEY_PREFIX}. e.g. in env
     * `skywalking.agent.application_code=yourAppName` to override `agent.application_code` in config file. <p> At the
     * end, `agent.application_code` and `collector.servers` must be not blank.
     * If the specified agent config path is set, the agent will try to locate the specified agent config.
     * If the specified agent config path is not set , the agent will try to locate `agent.config`, which should be in the /config dictionary of agent package.
     * <p>
     * Also try to override the config by system.env and system.properties. All the keys in these two places should
     * start with {@link #ENV_KEY_PREFIX}. e.g. in env `skywalking.agent.application_code=yourAppName` to override
     * `agent.application_code` in config file.
     * <p>
     * At the end, `agent.application_code` and `collector.servers` must be not blank.
     */
    public static void initialize() throws ConfigNotFoundException, AgentPackageNotFoundException {
        InputStreamReader configFileStream;

        try {
            configFileStream = loadConfig();
            Properties properties = new Properties();
+1 −6
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
 *
 */


package org.apache.skywalking.apm.agent.core.dictionary;

import io.netty.util.internal.ConcurrentSet;
@@ -48,12 +49,6 @@ public enum NetworkAddressDictionary {
        }
    }

    public void clearApplicationDictionary() {
        unRegisterApplications.clear();
        applicationDictionary.clear();

    }

    public void syncRemoteDictionary(
        NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceBlockingStub networkAddressRegisterServiceBlockingStub) {
        if (unRegisterApplications.size() > 0) {
Loading