本文整理汇总了Java中com.netflix.config.DynamicIntProperty类的典型用法代码示例。如果您正苦于以下问题:Java DynamicIntProperty类的具体用法?Java DynamicIntProperty怎么用?Java DynamicIntProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DynamicIntProperty类属于com.netflix.config包,在下文中一共展示了DynamicIntProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSetter
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
protected static Setter getSetter(final String commandKey,
ZuulProperties zuulProperties, IClientConfig config) {
// @formatter:off
Setter commandSetter = Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("RibbonCommand"))
.andCommandKey(HystrixCommandKey.Factory.asKey(commandKey));
final HystrixCommandProperties.Setter setter = createSetter(config, commandKey, zuulProperties);
if (zuulProperties.getRibbonIsolationStrategy() == ExecutionIsolationStrategy.SEMAPHORE){
final String name = ZuulConstants.ZUUL_EUREKA + commandKey + ".semaphore.maxSemaphores";
// we want to default to semaphore-isolation since this wraps
// 2 others commands that are already thread isolated
final DynamicIntProperty value = DynamicPropertyFactory.getInstance()
.getIntProperty(name, zuulProperties.getSemaphore().getMaxSemaphores());
setter.withExecutionIsolationSemaphoreMaxConcurrentRequests(value.get());
} else if (zuulProperties.getThreadPool().isUseSeparateThreadPools()) {
final String threadPoolKey = zuulProperties.getThreadPool().getThreadPoolKeyPrefix() + commandKey;
commandSetter.andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(threadPoolKey));
}
return commandSetter.andCommandPropertiesDefaults(setter);
// @formatter:on
}
示例2: ScheduledThreadPoolExectuorWithDynamicSize
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public ScheduledThreadPoolExectuorWithDynamicSize(final DynamicIntProperty corePoolSize, ThreadFactory threadFactory) {
super(corePoolSize.get(), threadFactory);
corePoolSize.addCallback(new Runnable() {
public void run() {
setCorePoolSize(corePoolSize.get());
}
});
shutdownThread = new Thread(new Runnable() {
public void run() {
shutdown();
if (shutdownThread != null) {
try {
Runtime.getRuntime().removeShutdownHook(shutdownThread);
} catch (IllegalStateException ise) { // NOPMD
}
}
}
});
Runtime.getRuntime().addShutdownHook(shutdownThread);
}
示例3: getWorkerPoolSize
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getWorkerPoolSize() {
String workerPoolSizeKey = "cse.service.registry.client.workerPoolSize";
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty(workerPoolSizeKey, 1);
int workerPoolSize = property.get();
if (workerPoolSize <= 0) {
int nAvailableProcessors = Runtime.getRuntime().availableProcessors();
LOGGER.warn("The property `{}` must be positive integer, fallback to use number of available processors: {}",
workerPoolSizeKey,
nAvailableProcessors);
return nAvailableProcessors;
}
return workerPoolSize;
}
示例4: getConnectionTimeout
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getConnectionTimeout() {
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.client.timeout.connection", DEFAULT_TIMEOUT_IN_MS);
int timeout = property.get();
return timeout < 0 ? DEFAULT_TIMEOUT_IN_MS : timeout;
}
示例5: getIdleConnectionTimeout
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getIdleConnectionTimeout() {
// connection pool idle timeout based on client heart beat interval. Heart beat default value is 30.
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.client.timeout.idle", DEFAULT_TIMEOUT_IN_SECONDS * 2);
int timeout = property.get();
return timeout < 1 ? DEFAULT_TIMEOUT_IN_SECONDS * 2 : timeout;
}
示例6: getRequestTimeout
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getRequestTimeout() {
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.client.timeout.request", DEFAULT_REQUEST_TIMEOUT_IN_MS);
int timeout = property.get();
return timeout < 1 ? DEFAULT_REQUEST_TIMEOUT_IN_MS : timeout;
}
示例7: getHeartBeatRequestTimeout
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getHeartBeatRequestTimeout() {
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.client.timeout.heartbeat", DEFAULT_REQUEST_HEARTBEAT_TIMEOUT_IN_MS);
int timeout = property.get();
return timeout < 1 ? DEFAULT_REQUEST_HEARTBEAT_TIMEOUT_IN_MS : timeout;
}
示例8: getHeartbeatInterval
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getHeartbeatInterval() {
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.instance.healthCheck.interval",
DEFAULT_CHECK_INTERVAL_IN_S);
int interval = property.get();
return interval < 0 ? DEFAULT_CHECK_INTERVAL_IN_S : interval;
}
示例9: getInstancePullInterval
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getInstancePullInterval() {
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.instance.pull.interval",
DEFAULT_CHECK_INTERVAL_IN_S);
int interval = property.get();
return interval < 0 ? DEFAULT_CHECK_INTERVAL_IN_S : interval;
}
示例10: getResendHeartBeatTimes
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public int getResendHeartBeatTimes() {
DynamicIntProperty property =
DynamicPropertyFactory.getInstance()
.getIntProperty("cse.service.registry.instance.healthCheck.times",
DEFAULT_CHECK_TIMES);
int times = property.get();
return times < 0 ? DEFAULT_CHECK_TIMES : times;
}
示例11: configureServer
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
@Override
protected void configureServer() {
DynamicIntProperty httpPort = DynamicPropertyFactory.getInstance().getIntProperty("registration.httpPort", DEFAULT_PORT);
TriathlonEndpointImpl triathlonEndpoint = new TriathlonEndpointImpl();
HealthCheckEndpoint healthCheckEndpoint = new HealthCheckEndpoint(new HealthCheck());
bindRouter().toInstance(new TriathlonRouter(healthCheckEndpoint, triathlonEndpoint));
eurekaService.subscribeToInterest("marathon.*").subscribe(InstanceInfoModel::interestSubscriber);
server().port(httpPort.get());
}
示例12: ServiceCheck
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
public ServiceCheck() {
DynamicStringProperty appHost = DynamicPropertyFactory.getInstance().getStringProperty("registration.appHost", "localhost");
DynamicIntProperty appPort = DynamicPropertyFactory.getInstance().getIntProperty("registration.appPort", DEFAULT_APP_PORT);
DynamicStringProperty appHealthcheckPath = DynamicPropertyFactory.getInstance().getStringProperty("registration.appHealthcheckPatht", "/");
DynamicBooleanProperty appPortSecure = DynamicPropertyFactory.getInstance().getBooleanProperty("registration.appPortSecure", false);
DynamicIntProperty checkTimeout = DynamicPropertyFactory.getInstance().getIntProperty("registration.checkTimeout", DEFAULT_CHECK_TIMEOUT);
this.appHost = appHost.get();
this.appPort = appPort.get();
this.appHealthcheckPath = appHealthcheckPath.get();
this.appPortSecure = appPortSecure.get();
this.checkTimeout = checkTimeout.get();
}
示例13: getConnIdleEvictTimeMilliSeconds
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
@Monitor(name = "HttpClient-ConnIdleEvictTimeMilliSeconds", type = DataSourceType.INFORMATIONAL)
public DynamicIntProperty getConnIdleEvictTimeMilliSeconds() {
if (connIdleEvictTimeMilliSeconds == null){
connIdleEvictTimeMilliSeconds = DynamicPropertyFactory.getInstance().getIntProperty(name + ".nfhttpclient.connIdleEvictTimeMilliSeconds",
NFHttpClientConstants.DEFAULT_CONNECTIONIDLE_TIME_IN_MSECS);
}
return connIdleEvictTimeMilliSeconds;
}
示例14: getConnectionFailureCountThreshold
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
DynamicIntProperty getConnectionFailureCountThreshold() {
if (connectionFailureThreshold == null) {
connectionFailureThreshold = DynamicPropertyFactory.getInstance().getIntProperty(
"niws.loadbalancer." + name + ".connectionFailureCountThreshold", 3);
}
return connectionFailureThreshold;
}
示例15: getCircuitTrippedTimeoutFactor
import com.netflix.config.DynamicIntProperty; //导入依赖的package包/类
DynamicIntProperty getCircuitTrippedTimeoutFactor() {
if (circuitTrippedTimeoutFactor == null) {
circuitTrippedTimeoutFactor = DynamicPropertyFactory.getInstance().getIntProperty(
"niws.loadbalancer." + name + ".circuitTripTimeoutFactorSeconds", 10);
}
return circuitTrippedTimeoutFactor;
}