io.vertx.core.VertxOptions.getQuorumSize()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中io.vertx.core.VertxOptions.getQuorumSize()方法的一些代码示例,展示了VertxOptions.getQuorumSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VertxOptions.getQuorumSize()方法的具体详情如下:
包路径:io.vertx.core.VertxOptions
类名称:VertxOptions
方法名:getQuorumSize

VertxOptions.getQuorumSize介绍

[英]Get the quorum size to be used when HA is enabled.
[中]获取启用HA时要使用的仲裁大小。

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

private void createHaManager(VertxOptions options, Handler<AsyncResult<Vertx>> resultHandler) {
 this.<Map<String, String>>executeBlocking(fut -> {
  fut.complete(clusterManager.getSyncMap(CLUSTER_MAP_NAME));
 }, false, ar -> {
  if (ar.succeeded()) {
   Map<String, String> clusterMap = ar.result();
   haManager = new HAManager(this, deploymentManager, clusterManager, clusterMap, options.getQuorumSize(), options.getHAGroup(), options.isHAEnabled());
   startEventBus(resultHandler);
  } else {
   log.error("Failed to start HAManager", ar.cause());
   resultHandler.handle(Future.failedFuture(ar.cause()));
  }
 });
}

代码示例来源:origin: eclipse-vertx/vert.x

json.put("quorumSize", obj.getQuorumSize());
json.put("warningExceptionTime", obj.getWarningExceptionTime());
if (obj.getWarningExceptionTimeUnit() != null) {

代码示例来源:origin: eclipse-vertx/vert.x

/**
 * Copy constructor
 *
 * @param other The other {@code VertxOptions} to copy when creating this
 */
public VertxOptions(VertxOptions other) {
 this.eventLoopPoolSize = other.getEventLoopPoolSize();
 this.workerPoolSize = other.getWorkerPoolSize();
 this.blockedThreadCheckInterval = other.getBlockedThreadCheckInterval();
 this.maxEventLoopExecuteTime = other.getMaxEventLoopExecuteTime();
 this.maxWorkerExecuteTime = other.getMaxWorkerExecuteTime();
 this.internalBlockingPoolSize = other.getInternalBlockingPoolSize();
 this.clusterManager = other.getClusterManager();
 this.haEnabled = other.isHAEnabled();
 this.quorumSize = other.getQuorumSize();
 this.haGroup = other.getHAGroup();
 this.metricsOptions = other.getMetricsOptions() != null ? new MetricsOptions(other.getMetricsOptions()) : null;
 this.fileSystemOptions = other.getFileSystemOptions() != null ? new FileSystemOptions(other.getFileSystemOptions()) : null;
 this.warningExceptionTime = other.warningExceptionTime;
 this.eventBusOptions = new EventBusOptions(other.eventBusOptions);
 this.addressResolverOptions = other.addressResolverOptions != null ? new AddressResolverOptions() : null;
 this.maxEventLoopExecuteTimeUnit = other.maxEventLoopExecuteTimeUnit;
 this.maxWorkerExecuteTimeUnit = other.maxWorkerExecuteTimeUnit;
 this.warningExceptionTimeUnit = other.warningExceptionTimeUnit;
 this.blockedThreadCheckIntervalUnit = other.blockedThreadCheckIntervalUnit;
}

代码示例来源:origin: eclipse-vertx/vert.x

assertEquals(1l * 60 * 1000 * 1000000, options.getMaxWorkerExecuteTime());
assertFalse(options.isHAEnabled());
assertEquals(1, options.getQuorumSize());
assertEquals(VertxOptions.DEFAULT_HA_GROUP, options.getHAGroup());
assertNotNull(options.getMetricsOptions());
assertEquals(haEnabled, options.isHAEnabled());
assertEquals(fileResolverCachingEnabled, options.isFileResolverCachingEnabled());
assertEquals(quorumSize, options.getQuorumSize());
assertEquals(haGroup, options.getHAGroup());
FileSystemOptions fileSystemOptions = options.getFileSystemOptions();

代码示例来源:origin: io.vertx/vertx-core

private void createHaManager(VertxOptions options, Handler<AsyncResult<Vertx>> resultHandler) {
 this.<Map<String, String>>executeBlocking(fut -> {
  fut.complete(clusterManager.getSyncMap(CLUSTER_MAP_NAME));
 }, false, ar -> {
  if (ar.succeeded()) {
   Map<String, String> clusterMap = ar.result();
   haManager = new HAManager(this, deploymentManager, clusterManager, clusterMap, options.getQuorumSize(), options.getHAGroup(), options.isHAEnabled());
   startEventBus(resultHandler);
  } else {
   log.error("Failed to start HAManager", ar.cause());
   resultHandler.handle(Future.failedFuture(ar.cause()));
  }
 });
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testDefaultJsonOptions() {
 VertxOptions def = new VertxOptions();
 VertxOptions json = new VertxOptions(new JsonObject());
 assertEquals(def.getEventLoopPoolSize(), json.getEventLoopPoolSize());
 assertEquals(def.getWorkerPoolSize(), json.getWorkerPoolSize());
 assertEquals(def.isClustered(), json.isClustered());
 assertEquals(def.getClusterHost(), json.getClusterHost());
 assertEquals(def.getClusterPublicHost(), json.getClusterPublicHost());
 assertEquals(def.getClusterPublicPort(), json.getClusterPublicPort());
 assertEquals(def.getClusterPingInterval(), json.getClusterPingInterval());
 assertEquals(def.getClusterPingReplyInterval(), json.getClusterPingReplyInterval());
 assertEquals(def.getBlockedThreadCheckInterval(), json.getBlockedThreadCheckInterval());
 assertEquals(def.getMaxEventLoopExecuteTime(), json.getMaxEventLoopExecuteTime());
 assertEquals(def.getMaxWorkerExecuteTime(), json.getMaxWorkerExecuteTime());
 assertEquals(def.getInternalBlockingPoolSize(), json.getInternalBlockingPoolSize());
 assertEquals(def.isHAEnabled(), json.isHAEnabled());
 assertEquals(def.getQuorumSize(), json.getQuorumSize());
 assertEquals(def.getHAGroup(), json.getHAGroup());
 assertEquals(def.getWarningExceptionTime(), json.getWarningExceptionTime());
 assertEquals(def.isFileResolverCachingEnabled(), json.isFileResolverCachingEnabled());
 assertEquals(def.getMaxEventLoopExecuteTimeUnit(), json.getMaxEventLoopExecuteTimeUnit());
 assertEquals(def.getMaxWorkerExecuteTimeUnit(), json.getMaxWorkerExecuteTimeUnit());
 assertEquals(def.getWarningExceptionTimeUnit(), json.getWarningExceptionTimeUnit());
 assertEquals(def.getBlockedThreadCheckIntervalUnit(), json.getBlockedThreadCheckIntervalUnit());
}

代码示例来源:origin: eclipse-vertx/vert.x

assertEquals(haEnabled, options.isHAEnabled());
assertEquals(fileResolverCachingEnabled, options.isFileResolverCachingEnabled());
assertEquals(quorumSize, options.getQuorumSize());
assertEquals(haGroup, options.getHAGroup());
MetricsOptions metricsOptions = options.getMetricsOptions();

代码示例来源:origin: io.vertx/vertx-core

json.put("quorumSize", obj.getQuorumSize());
json.put("warningExceptionTime", obj.getWarningExceptionTime());
if (obj.getWarningExceptionTimeUnit() != null) {

代码示例来源:origin: eclipse-vertx/vert.x

assertTrue(options.isHAEnabled());
rand = TestUtils.randomPositiveInt();
assertEquals(1, options.getQuorumSize());
assertEquals(options, options.setQuorumSize(rand));
assertEquals(rand, options.getQuorumSize());
try {
 options.setQuorumSize(0);

代码示例来源:origin: io.vertx/vertx-core

/**
 * Copy constructor
 *
 * @param other The other {@code VertxOptions} to copy when creating this
 */
public VertxOptions(VertxOptions other) {
 this.eventLoopPoolSize = other.getEventLoopPoolSize();
 this.workerPoolSize = other.getWorkerPoolSize();
 this.blockedThreadCheckInterval = other.getBlockedThreadCheckInterval();
 this.maxEventLoopExecuteTime = other.getMaxEventLoopExecuteTime();
 this.maxWorkerExecuteTime = other.getMaxWorkerExecuteTime();
 this.internalBlockingPoolSize = other.getInternalBlockingPoolSize();
 this.clusterManager = other.getClusterManager();
 this.haEnabled = other.isHAEnabled();
 this.quorumSize = other.getQuorumSize();
 this.haGroup = other.getHAGroup();
 this.metricsOptions = other.getMetricsOptions() != null ? new MetricsOptions(other.getMetricsOptions()) : null;
 this.fileSystemOptions = other.getFileSystemOptions() != null ? new FileSystemOptions(other.getFileSystemOptions()) : null;
 this.warningExceptionTime = other.warningExceptionTime;
 this.eventBusOptions = new EventBusOptions(other.eventBusOptions);
 this.addressResolverOptions = other.addressResolverOptions != null ? new AddressResolverOptions() : null;
 this.maxEventLoopExecuteTimeUnit = other.maxEventLoopExecuteTimeUnit;
 this.maxWorkerExecuteTimeUnit = other.maxWorkerExecuteTimeUnit;
 this.warningExceptionTimeUnit = other.warningExceptionTimeUnit;
 this.blockedThreadCheckIntervalUnit = other.blockedThreadCheckIntervalUnit;
}

代码示例来源:origin: io.vertx/vertx-core

assertEquals(1l * 60 * 1000 * 1000000, options.getMaxWorkerExecuteTime());
assertFalse(options.isHAEnabled());
assertEquals(1, options.getQuorumSize());
assertEquals(VertxOptions.DEFAULT_HA_GROUP, options.getHAGroup());
assertNotNull(options.getMetricsOptions());
assertEquals(haEnabled, options.isHAEnabled());
assertEquals(fileResolverCachingEnabled, options.isFileResolverCachingEnabled());
assertEquals(quorumSize, options.getQuorumSize());
assertEquals(haGroup, options.getHAGroup());
FileSystemOptions fileSystemOptions = options.getFileSystemOptions();

代码示例来源:origin: io.vertx/vertx-core

@Test
public void testDefaultJsonOptions() {
 VertxOptions def = new VertxOptions();
 VertxOptions json = new VertxOptions(new JsonObject());
 assertEquals(def.getEventLoopPoolSize(), json.getEventLoopPoolSize());
 assertEquals(def.getWorkerPoolSize(), json.getWorkerPoolSize());
 assertEquals(def.isClustered(), json.isClustered());
 assertEquals(def.getClusterHost(), json.getClusterHost());
 assertEquals(def.getClusterPublicHost(), json.getClusterPublicHost());
 assertEquals(def.getClusterPublicPort(), json.getClusterPublicPort());
 assertEquals(def.getClusterPingInterval(), json.getClusterPingInterval());
 assertEquals(def.getClusterPingReplyInterval(), json.getClusterPingReplyInterval());
 assertEquals(def.getBlockedThreadCheckInterval(), json.getBlockedThreadCheckInterval());
 assertEquals(def.getMaxEventLoopExecuteTime(), json.getMaxEventLoopExecuteTime());
 assertEquals(def.getMaxWorkerExecuteTime(), json.getMaxWorkerExecuteTime());
 assertEquals(def.getInternalBlockingPoolSize(), json.getInternalBlockingPoolSize());
 assertEquals(def.isHAEnabled(), json.isHAEnabled());
 assertEquals(def.getQuorumSize(), json.getQuorumSize());
 assertEquals(def.getHAGroup(), json.getHAGroup());
 assertEquals(def.getWarningExceptionTime(), json.getWarningExceptionTime());
 assertEquals(def.isFileResolverCachingEnabled(), json.isFileResolverCachingEnabled());
 assertEquals(def.getMaxEventLoopExecuteTimeUnit(), json.getMaxEventLoopExecuteTimeUnit());
 assertEquals(def.getMaxWorkerExecuteTimeUnit(), json.getMaxWorkerExecuteTimeUnit());
 assertEquals(def.getWarningExceptionTimeUnit(), json.getWarningExceptionTimeUnit());
 assertEquals(def.getBlockedThreadCheckIntervalUnit(), json.getBlockedThreadCheckIntervalUnit());
}

代码示例来源:origin: io.vertx/vertx-core

assertEquals(haEnabled, options.isHAEnabled());
assertEquals(fileResolverCachingEnabled, options.isFileResolverCachingEnabled());
assertEquals(quorumSize, options.getQuorumSize());
assertEquals(haGroup, options.getHAGroup());
MetricsOptions metricsOptions = options.getMetricsOptions();

代码示例来源:origin: io.vertx/vertx-core

assertTrue(options.isHAEnabled());
rand = TestUtils.randomPositiveInt();
assertEquals(1, options.getQuorumSize());
assertEquals(options, options.setQuorumSize(rand));
assertEquals(rand, options.getQuorumSize());
try {
 options.setQuorumSize(0);

相关文章

VertxOptions类方法