Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DUBBO-3137]: step4 - remove MonitorConstants #4069

Merged
merged 2 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.Map;

import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_AVAILABLE_CHECK_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,6 @@ public interface CommonConstants {
String RELEASE_KEY = "release";

int MAX_PROXY_COUNT = 65535;

String MONITOR_KEY = "monitor";
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.constants.ConfigConstants;
import org.apache.dubbo.common.constants.FilterConstants;
import org.apache.dubbo.common.constants.MonitorConstants;
import org.apache.dubbo.common.constants.RegistryConstants;
import org.apache.dubbo.common.constants.RemotingConstants;
import org.apache.dubbo.common.constants.RpcConstants;

@Deprecated
public class Constants implements CommonConstants, ConfigConstants, FilterConstants,
MonitorConstants, RegistryConstants, RemotingConstants, RpcConstants, org.apache.dubbo.rpc.cluster.Constants {
public class Constants implements CommonConstants, ConfigConstants, FilterConstants, RegistryConstants,
RemotingConstants, RpcConstants, org.apache.dubbo.rpc.cluster.Constants, org.apache.dubbo.monitor.Constants {
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTRIES_SUFFIX;
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_SECONDS_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.LOGSTAT_PROTOCOL;
import static org.apache.dubbo.monitor.Constants.LOGSTAT_PROTOCOL;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import org.apache.dubbo.config.support.Parameter;

import static org.apache.dubbo.common.constants.MonitorConstants.METRICS_PORT;
import static org.apache.dubbo.common.constants.MonitorConstants.METRICS_PROTOCOL;
import static org.apache.dubbo.monitor.Constants.METRICS_PORT;
import static org.apache.dubbo.monitor.Constants.METRICS_PROTOCOL;

public class MetricsConfig extends AbstractConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_IP_TO_REGISTRY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CONSUMER_PROTOCOL;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;
import static org.apache.dubbo.common.constants.RpcConstants.LOCAL_PROTOCOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_LOCAL;
import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_NONE;
import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_REMOTE;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.DYNAMIC_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.GENERIC_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.LOCAL_PROTOCOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.monitor;

package org.apache.dubbo.common.constants;

public interface MonitorConstants {
String MONITOR_KEY = "monitor";

String LOGSTAT_PROTOCOL = "logstat";

String COUNT_PROTOCOL = "count";

public interface Constants {
String DUBBO_PROVIDER = "dubbo.provider";

String DUBBO_CONSUMER = "dubbo.consumer";

String DUBBO_PROVIDER_METHOD = "dubbo.provider.method";

String DUBBO_CONSUMER_METHOD = "dubbo.consumer.method";

String SERVICE = "service";

String METHOD = "method";

String DUBBO_GROUP = "dubbo";

String METRICS_KEY = "metrics";

String METRICS_PORT = "metrics.port";

String METRICS_PROTOCOL = "metrics.protocol";
String LOGSTAT_PROTOCOL = "logstat";
String COUNT_PROTOCOL = "count";
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.COUNT_PROTOCOL;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.monitor.Constants.COUNT_PROTOCOL;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.INPUT_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.OUTPUT_KEY;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER_SIDE;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
import java.util.concurrent.atomic.AtomicBoolean;

import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_PROTOCOL;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_CONSUMER;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_CONSUMER_METHOD;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_GROUP;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_PROVIDER;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_PROVIDER_METHOD;
import static org.apache.dubbo.common.constants.MonitorConstants.METHOD;
import static org.apache.dubbo.common.constants.MonitorConstants.METRICS_PORT;
import static org.apache.dubbo.common.constants.MonitorConstants.METRICS_PROTOCOL;
import static org.apache.dubbo.common.constants.MonitorConstants.SERVICE;
import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER;
import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER_METHOD;
import static org.apache.dubbo.monitor.Constants.DUBBO_GROUP;
import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER;
import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER_METHOD;
import static org.apache.dubbo.monitor.Constants.METHOD;
import static org.apache.dubbo.monitor.Constants.METRICS_PORT;
import static org.apache.dubbo.monitor.Constants.METRICS_PROTOCOL;
import static org.apache.dubbo.monitor.Constants.SERVICE;

public class MetricsFilter implements Filter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_CONSUMER;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_CONSUMER_METHOD;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_GROUP;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_PROVIDER;
import static org.apache.dubbo.common.constants.MonitorConstants.DUBBO_PROVIDER_METHOD;
import static org.apache.dubbo.common.constants.MonitorConstants.METHOD;
import static org.apache.dubbo.common.constants.MonitorConstants.SERVICE;
import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER;
import static org.apache.dubbo.monitor.Constants.DUBBO_CONSUMER_METHOD;
import static org.apache.dubbo.monitor.Constants.DUBBO_GROUP;
import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER;
import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER_METHOD;
import static org.apache.dubbo.monitor.Constants.METHOD;
import static org.apache.dubbo.monitor.Constants.SERVICE;

public class MetricsFilterTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.APP_DYNAMIC_CONFIGURATORS_CATEGORY;
import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.COMPATIBLE_CONFIG_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.FilterConstants.VALIDATION_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CONFIGURATORS_CATEGORY;
import static org.apache.dubbo.common.constants.RegistryConstants.CONFIGURATORS_SUFFIX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.constants.ConfigConstants;
import org.apache.dubbo.common.constants.FilterConstants;
import org.apache.dubbo.common.constants.MonitorConstants;
import org.apache.dubbo.common.constants.RegistryConstants;
import org.apache.dubbo.common.constants.RemotingConstants;

Expand All @@ -29,7 +28,7 @@
* @deprecated Replace to org.apache.dubbo.common.Constants
*/
@Deprecated
public final class RpcConstants implements CommonConstants, ConfigConstants, FilterConstants, MonitorConstants,
public final class RpcConstants implements CommonConstants, ConfigConstants, FilterConstants,
RegistryConstants, RemotingConstants, org.apache.dubbo.common.constants.RpcConstants {

private RpcConstants() {
Expand Down