/** * 读取Integer类型的系统变量,为空时返回null. */ public static Integer getInteger(String name) { return Integer.getInteger(name); }
/** * 读取Integer类型的系统变量,为空时返回默认值 */ public static Integer getInteger(String name, Integer defaultValue) { return Integer.getInteger(name, defaultValue); }
public WatcherCleaner(IDeadWatcherListener listener) { this(listener, Integer.getInteger("zookeeper.watcherCleanThreshold", 1000), Integer.getInteger("zookeeper.watcherCleanIntervalInSeconds", 600), Integer.getInteger("zookeeper.watcherCleanThreadsNum", 2), Integer.getInteger("zookeeper.maxInProcessingDeadWatchers", -1)); }
/** * Gets the HTTP connection/read timeouts for registry interactions in milliseconds. This is * defined by the {@code jib.httpTimeout} system property. The default value is 20000 if the * system property is not set, and 0 indicates an infinite timeout. * * @return the HTTP connection/read timeouts for registry interactions in milliseconds */ public static int getHttpTimeout() { if (Integer.getInteger(HTTP_TIMEOUT) == null) { return 20000; } return Integer.getInteger(HTTP_TIMEOUT); }
/** * The value {@link #SERVICE_CONTROL_STREAM_ID_DEFAULT} or system property * {@link #SERVICE_STREAM_ID_PROP_NAME} if set. * * @return {@link #SERVICE_CONTROL_STREAM_ID_DEFAULT} or system property * {@link #SERVICE_STREAM_ID_PROP_NAME} if set. */ public static int serviceStreamId() { return Integer.getInteger(SERVICE_STREAM_ID_PROP_NAME, SERVICE_CONTROL_STREAM_ID_DEFAULT); }
/** * The value {@link #EGRESS_STREAM_ID_DEFAULT} or system property * {@link #EGRESS_STREAM_ID_PROP_NAME} if set. * * @return {@link #EGRESS_STREAM_ID_DEFAULT} or system property * {@link #EGRESS_STREAM_ID_PROP_NAME} if set. */ public static int egressStreamId() { return Integer.getInteger(EGRESS_STREAM_ID_PROP_NAME, EGRESS_STREAM_ID_DEFAULT); } }
/** * The value {@link #CLUSTER_MEMBER_ID_DEFAULT} or system property * {@link #CLUSTER_MEMBER_ID_PROP_NAME} if set. * * @return {@link #CLUSTER_MEMBER_ID_DEFAULT} or system property * {@link #CLUSTER_MEMBER_ID_PROP_NAME} if set. */ public static int clusterMemberId() { return Integer.getInteger(CLUSTER_MEMBER_ID_PROP_NAME, CLUSTER_MEMBER_ID_DEFAULT); }
/** * The value {@link #SNAPSHOT_STREAM_ID_DEFAULT} or system property * {@link ClusteredServiceContainer.Configuration#SNAPSHOT_STREAM_ID_PROP_NAME} if set. * * @return {@link #SNAPSHOT_STREAM_ID_DEFAULT} or system property * {@link ClusteredServiceContainer.Configuration#SNAPSHOT_STREAM_ID_PROP_NAME} if set. */ public static int snapshotStreamId() { return Integer.getInteger(SNAPSHOT_STREAM_ID_PROP_NAME, SNAPSHOT_STREAM_ID_DEFAULT); }
/** * The value {@link #SERVICE_ID_DEFAULT} or system property {@link #SERVICE_ID_PROP_NAME} if set. * * @return {@link #SERVICE_ID_DEFAULT} or system property {@link #SERVICE_ID_PROP_NAME} if set. */ public static int serviceId() { return Integer.getInteger(SERVICE_ID_PROP_NAME, SERVICE_ID_DEFAULT); }
/** * The value {@link #APPOINTED_LEADER_ID_DEFAULT} or system property * {@link #APPOINTED_LEADER_ID_PROP_NAME} if set. * * @return {@link #APPOINTED_LEADER_ID_DEFAULT} or system property * {@link #APPOINTED_LEADER_ID_PROP_NAME} if set. */ public static int appointedLeaderId() { return Integer.getInteger(APPOINTED_LEADER_ID_PROP_NAME, APPOINTED_LEADER_ID_DEFAULT); }
/** * The value {@link #LOCAL_CONTROL_STREAM_ID_DEFAULT} or system property * {@link #LOCAL_CONTROL_STREAM_ID_PROP_NAME} if set. * * @return {@link #LOCAL_CONTROL_STREAM_ID_DEFAULT} or system property * {@link #LOCAL_CONTROL_STREAM_ID_PROP_NAME} if set. */ public static int localControlStreamId() { return Integer.getInteger(LOCAL_CONTROL_STREAM_ID_PROP_NAME, LOCAL_CONTROL_STREAM_ID_DEFAULT); }
/** * The value {@link #CONSENSUS_MODULE_STREAM_ID_DEFAULT} or system property * {@link #CONSENSUS_MODULE_STREAM_ID_PROP_NAME} if set. * * @return {@link #CONSENSUS_MODULE_STREAM_ID_DEFAULT} or system property * {@link #CONSENSUS_MODULE_STREAM_ID_PROP_NAME} if set. */ public static int consensusModuleStreamId() { return Integer.getInteger(CONSENSUS_MODULE_STREAM_ID_PROP_NAME, CONSENSUS_MODULE_STREAM_ID_DEFAULT); }
/** * The value {@link #INGRESS_STREAM_ID_DEFAULT} or system property * {@link #INGRESS_STREAM_ID_PROP_NAME} if set. * * @return {@link #INGRESS_STREAM_ID_DEFAULT} or system property * {@link #INGRESS_STREAM_ID_PROP_NAME} if set. */ public static int ingressStreamId() { return Integer.getInteger(INGRESS_STREAM_ID_PROP_NAME, INGRESS_STREAM_ID_DEFAULT); }
/** * The value {@link #SERVICE_COUNT_DEFAULT} or system property * {@link #SERVICE_COUNT_PROP_NAME} if set. * * @return {@link #SERVICE_COUNT_DEFAULT} or system property * {@link #SERVICE_COUNT_PROP_NAME} if set. */ public static int serviceCount() { return Integer.getInteger(SERVICE_COUNT_PROP_NAME, SERVICE_COUNT_DEFAULT); }
/** * The value {@link #MEMBER_STATUS_STREAM_ID_DEFAULT} or system property * {@link #MEMBER_STATUS_STREAM_ID_PROP_NAME} if set. * * @return {@link #MEMBER_STATUS_STREAM_ID_DEFAULT} or system property * {@link #MEMBER_STATUS_STREAM_ID_PROP_NAME} if set. */ public static int memberStatusStreamId() { return Integer.getInteger(MEMBER_STATUS_STREAM_ID_PROP_NAME, MEMBER_STATUS_STREAM_ID_DEFAULT); } }
public JettyAdminServer() throws AdminServerException { this(System.getProperty("zookeeper.admin.serverAddress", DEFAULT_ADDRESS), Integer.getInteger("zookeeper.admin.serverPort", DEFAULT_PORT), Integer.getInteger("zookeeper.admin.idleTimeout", DEFAULT_IDLE_TIMEOUT), System.getProperty("zookeeper.admin.commandURL", DEFAULT_COMMAND_URL)); }
private int getClusterPublicPort(EventBusOptions options, int actualPort) { // We retain the old system property for backwards compat int publicPort = Integer.getInteger(CLUSTER_PUBLIC_PORT_PROP_NAME, options.getClusterPublicPort()); if (publicPort == -1) { // Get the actual port, wildcard port of zero might have been specified publicPort = actualPort; } return publicPort; }
private synchronized void setupContainerManager() { containerManager = new ContainerManager(getZKDatabase(), prepRequestProcessor, Integer.getInteger("znode.container.checkIntervalMs", (int) TimeUnit.MINUTES.toMillis(1)), Integer.getInteger("znode.container.maxPerMinute", 10000) ); }
/** * Get the value of a {@code int} system property. * * The absolute name of the system property is computed based on the provided class and local name. * * @param location the class that owns the flag. * @param name the local name of the flag. * @param defaultValue the default value of the flag if the system property is not assigned. * @return the parsed value of the system property, or the default value. */ public static int getInteger( Class<?> location, String name, int defaultValue ) { return Integer.getInteger( name( location, name ), defaultValue ); }
public static void main(String[] args) throws RunnerException { Options options = new OptionsBuilder() .verbosity(VerboseMode.NORMAL) .threads(getInteger("threads", 1)) .include(".*" + BenchmarkCPUCounters.class.getSimpleName() + ".*") .build(); new Runner(options).run(); } }