did/did-common/src/main/java/io/github/ehlxr/did/common/Constants.java

54 lines
1.3 KiB
Java
Raw Normal View History

2021-01-22 07:40:02 +00:00
package io.github.ehlxr.did.common;
2018-08-14 07:21:56 +00:00
import java.util.Map;
/**
* @author ehlxr
*/
public class Constants {
2021-01-18 08:17:14 +00:00
private static final Map<String, String> SYS_ENV = System.getenv();
2018-08-14 07:21:56 +00:00
public static String getEnv(String key) {
return SYS_ENV.get(key) == null ? "" : SYS_ENV.get(key);
}
2021-01-20 07:25:58 +00:00
public static String SERVER_HOST = "localhost";
2018-08-14 07:21:56 +00:00
/**
2021-01-20 07:25:58 +00:00
* HTTP SDK
2018-08-14 07:21:56 +00:00
*/
public static int HTTP_PORT = 16830;
2021-01-20 07:25:58 +00:00
public static int SDK_PORT = 16831;
2018-08-14 07:21:56 +00:00
/**
2021-01-20 07:25:58 +00:00
* ID0~31
* ID0~31
* <p>
* ID
2018-08-14 07:21:56 +00:00
*/
public static long DATACENTER_ID = 1;
2018-08-14 10:37:34 +00:00
public static long MACHINES_ID = 1;
2018-08-14 07:21:56 +00:00
/**
2021-01-20 07:25:58 +00:00
* Server
2018-08-14 07:21:56 +00:00
*/
public static int HANDLE_HTTP_TPS = 10000;
2021-01-20 07:25:58 +00:00
public static int HANDLE_SDK_TPS = 50000;
/**
* sdk client
*/
public static int SDK_CLIENT_ASYNC_TPS = 100000;
public static int SDK_CLIENT_ONEWAY_TPS = 100000;
2018-08-14 07:21:56 +00:00
public static int ACQUIRE_TIMEOUTMILLIS = 5000;
2021-01-20 07:25:58 +00:00
/**
* sdk client
*/
public static int SDK_CLIENT_TIMEOUTMILLIS = 2000;
2018-08-14 07:21:56 +00:00
private Constants() {
}
}