Skip to content

Commit

Permalink
[DUBBO-3137]: step2 - seperate constants for config, remoting, rpc (#…
Browse files Browse the repository at this point in the history
…4021)

* constants step2

* change interface
  • Loading branch information
CrazyHZM authored and beiwei30 committed May 10, 2019
1 parent 951ad36 commit 6a1dd65
Show file tree
Hide file tree
Showing 3 changed files with 524 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
/*
* 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.dubbo.common.constants;

/**
* ConfigConstants
*/
public interface ConfigConstants {
// BEGIN dubbo-config-api
String CLUSTER_KEY = "cluster";

String STATUS_KEY = "status";

String CONTEXTPATH_KEY = "contextpath";

String LISTENER_KEY = "listener";

String LAYER_KEY = "layer";

/**
* General
*/
/**
* Application name;
*/
String NAME = "name";

/**
* Application owner name;
*/
String OWNER = "owner";

/**
* Running application organization name.
*/
String ORGANIZATION = "organization";

/**
* Application architecture name.
*/
String ARCHITECTURE = "architecture";

/**
* Environment name
*/
String ENVIRONMENT = "environment";

/**
* Test environment key.
*/
String TEST_ENVIRONMENT = "test";

/**
* Development environment key.
*/
String DEVELOPMENT_ENVIRONMENT = "develop";

/**
* Production environment key.
*/
String PRODUCTION_ENVIRONMENT = "product";

String CONFIG_CLUSTER_KEY = "config.cluster";
String CONFIG_NAMESPACE_KEY = "config.namespace";
String CONFIG_GROUP_KEY = "config.group";
String CONFIG_CHECK_KEY = "config.check";

String CONFIG_CONFIGFILE_KEY = "config.config-file";
String CONFIG_ENABLE_KEY = "config.highest-priority";
String CONFIG_TIMEOUT_KEY = "config.timeout";
String CONFIG_APPNAME_KEY = "config.app-name";

String USERNAME_KEY = "username";

String PASSWORD_KEY = "password";

String HOST_KEY = "host";

String PORT_KEY = "port";

String MULTICAST = "multicast";

String REGISTER_IP_KEY = "register.ip";

String DUBBO_IP_TO_REGISTRY = "DUBBO_IP_TO_REGISTRY";

String DUBBO_PORT_TO_REGISTRY = "DUBBO_PORT_TO_REGISTRY";

String DUBBO_IP_TO_BIND = "DUBBO_IP_TO_BIND";

String DUBBO_PORT_TO_BIND = "DUBBO_PORT_TO_BIND";

String SCOPE_KEY = "scope";

String SCOPE_LOCAL = "local";

String SCOPE_REMOTE = "remote";

String SCOPE_NONE = "none";

String ON_CONNECT_KEY = "onconnect";

String ON_DISCONNECT_KEY = "ondisconnect";

String ON_INVOKE_METHOD_KEY = "oninvoke.method";

String ON_RETURN_METHOD_KEY = "onreturn.method";

String ON_THROW_METHOD_KEY = "onthrow.method";

String ON_INVOKE_INSTANCE_KEY = "oninvoke.instance";

String ON_RETURN_INSTANCE_KEY = "onreturn.instance";

String ON_THROW_INSTANCE_KEY = "onthrow.instance";

@Deprecated
String SHUTDOWN_WAIT_SECONDS_KEY = "dubbo.service.shutdown.wait.seconds";

String SHUTDOWN_WAIT_KEY = "dubbo.service.shutdown.wait";

/**
* The key name for export URL in register center
*/
String EXPORT_KEY = "export";

/**
* The key name for reference URL in register center
*/
String REFER_KEY = "refer";

/**
* To decide whether to make connection when the client is created
*/
String LAZY_CONNECT_KEY = "lazy";

String DUBBO_PROTOCOL = "dubbo";

String ZOOKEEPER_PROTOCOL = "zookeeper";

// FIXME: is this still useful?
String SHUTDOWN_TIMEOUT_KEY = "shutdown.timeout";

int DEFAULT_SHUTDOWN_TIMEOUT = 1000 * 60 * 15;

String PROTOCOLS_SUFFIX = "dubbo.protocols.";

String PROTOCOL_SUFFIX = "dubbo.protocol.";

String REGISTRIES_SUFFIX = "dubbo.registries.";

String TELNET = "telnet";

String QOS_ENABLE = "qos.enable";

String QOS_PORT = "qos.port";

String ACCEPT_FOREIGN_IP = "qos.accept.foreign.ip";
// END dubbo-congfig-api
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* 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.dubbo.common.constants;

import java.util.concurrent.ExecutorService;

/**
* RemotingConstants
*/
public interface RemotingConstants {

String PAYLOAD_KEY = "payload";
/**
* 8M
*/
int DEFAULT_PAYLOAD = 8 * 1024 * 1024;

String BUFFER_KEY = "buffer";

/**
* default buffer size is 8k.
*/
int DEFAULT_BUFFER_SIZE = 8 * 1024;

int MAX_BUFFER_SIZE = 16 * 1024;

int MIN_BUFFER_SIZE = 1 * 1024;

String CONNECT_TIMEOUT_KEY = "connect.timeout";

int DEFAULT_CONNECT_TIMEOUT = 3000;

String HEARTBEAT_KEY = "heartbeat";

int DEFAULT_HEARTBEAT = 60 * 1000;

String IDLE_TIMEOUT_KEY = "idle.timeout";

int DEFAULT_IDLE_TIMEOUT = 600 * 1000;

String ACCEPTS_KEY = "accepts";

int DEFAULT_ACCEPTS = 0;

String SERIALIZATION_KEY = "serialization";

String DEFAULT_REMOTING_SERIALIZATION = "hessian2";

String CODEC_KEY = "codec";

String DEFAULT_REMOTING_CODEC = "dubbo";

String SERVER_KEY = "server";

String DEFAULT_REMOTING_SERVER = "netty";

String CLIENT_KEY = "client";

String DEFAULT_REMOTING_CLIENT = "netty";

String TRANSPORTER_KEY = "transporter";

String DEFAULT_TRANSPORTER = "netty";

String EXCHANGER_KEY = "exchanger";

String DEFAULT_EXCHANGER = "header";

String DISPACTHER_KEY = "dispacther";

int DEFAULT_IO_THREADS = Math.min(Runtime.getRuntime().availableProcessors() + 1, 32);

String BIND_IP_KEY = "bind.ip";

String BIND_PORT_KEY = "bind.port";

String SENT_KEY = "sent";

boolean DEFAULT_SENT = false;

String DISPATCHER_KEY = "dispatcher";

String CHANNEL_HANDLER_KEY = "channel.handler";

String DEFAULT_CHANNEL_HANDLER = "default";

String SERVICE_DESCIPTOR_KEY = "serviceDescriptor";

String CONNECT_QUEUE_CAPACITY = "connect.queue.capacity";

String CONNECT_QUEUE_WARNING_SIZE = "connect.queue.warning.size";

int DEFAULT_CONNECT_QUEUE_WARNING_SIZE = 1000;

String CHANNEL_ATTRIBUTE_READONLY_KEY = "channel.readonly";

String CHANNEL_READONLYEVENT_SENT_KEY = "channel.readonly.sent";

String CHANNEL_SEND_READONLYEVENT_KEY = "channel.readonly.send";

String EXECUTOR_SERVICE_COMPONENT_KEY = ExecutorService.class.getName();

String CHARSET_KEY = "charset";

String DEFAULT_CHARSET = "UTF-8";

String BACKUP_KEY = "backup";

/**
* Every heartbeat duration / HEATBEAT_CHECK_TICK, check if a heartbeat should be sent. Every heartbeat timeout
* duration / HEATBEAT_CHECK_TICK, check if a connection should be closed on server side, and if reconnect on
* client side
*/
int HEARTBEAT_CHECK_TICK = 3;

/**
* the least heartbeat during is 1000 ms.
*/
long LEAST_HEARTBEAT_DURATION = 1000;

/**
* ticks per wheel.
*/
int TICKS_PER_WHEEL = 128;

String HEARTBEAT_TIMEOUT_KEY = "heartbeat.timeout";

String RECONNECT_KEY = "reconnect";

int DEFAULT_RECONNECT_PERIOD = 2000;

String SEND_RECONNECT_KEY = "send.reconnect";

String CHECK_KEY = "check";

String PROMPT_KEY = "prompt";

String DEFAULT_PROMPT = "dubbo>";
}
Loading

0 comments on commit 6a1dd65

Please sign in to comment.