本文整理了Java中io.vertx.core.VertxOptions.setClusterPort()
方法的一些代码示例,展示了VertxOptions.setClusterPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VertxOptions.setClusterPort()
方法的具体详情如下:
包路径:io.vertx.core.VertxOptions
类名称:VertxOptions
方法名:setClusterPort
[英]Set the port to be used for clustering.
[中]设置用于群集的端口。
代码示例来源:origin: eclipse-vertx/vert.x
case "clusterPort":
if (member.getValue() instanceof Number) {
obj.setClusterPort(((Number)member.getValue()).intValue());
代码示例来源:origin: eclipse-vertx/vert.x
AtomicReference<AsyncResult<Vertx>> result = new AtomicReference<>();
options.setClusterHost(clusterHost).setClusterPort(clusterPort).setClustered(true);
if (ha) {
String haGroup = args.map.get("-hagroup");
代码示例来源:origin: eclipse-vertx/vert.x
protected void startNodes(int numNodes, VertxOptions options) {
CountDownLatch latch = new CountDownLatch(numNodes);
vertices = new Vertx[numNodes];
for (int i = 0; i < numNodes; i++) {
int index = i;
clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
.setClusterManager(getClusterManager()), ar -> {
try {
if (ar.failed()) {
ar.cause().printStackTrace();
}
assertTrue("Failed to start node", ar.succeeded());
vertices[index] = ar.result();
}
finally {
latch.countDown();
}
});
}
try {
assertTrue(latch.await(2, TimeUnit.MINUTES));
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public void beforeStartingVertx(VertxOptions options) {
beforeStartingVertxInvoked = true;
this.options = options;
if (clusterHost != null) {
options.setClusterHost(clusterHost);
options.setClusterPort(clusterPort);
options.setClusterPublicHost(clusterPublicHost);
options.setClusterPublicPort(clusterPublicPort);
super.beforeStartingVertx(options);
}
}
代码示例来源:origin: eclipse-vertx/vert.x
.setClusterHost(clusterHost).setClusterPort(clusterPort)
.setClusterPublicHost(clusterPublicHost);
if (clusterPublicPort != -1) {
代码示例来源:origin: io.vertx/vertx-core
case "clusterPort":
if (member.getValue() instanceof Number) {
obj.setClusterPort(((Number)member.getValue()).intValue());
代码示例来源:origin: io.vertx/vertx-core
AtomicReference<AsyncResult<Vertx>> result = new AtomicReference<>();
options.setClusterHost(clusterHost).setClusterPort(clusterPort).setClustered(true);
if (ha) {
String haGroup = args.map.get("-hagroup");
代码示例来源:origin: eclipse-vertx/vert.x
TimeUnit warningExceptionTimeUnit = TimeUnit.MINUTES;
TimeUnit blockedThreadCheckIntervalUnit = TimeUnit.MINUTES;
options.setClusterPort(clusterPort);
options.setClusterPublicPort(clusterPublicPort);
options.setEventLoopPoolSize(eventLoopPoolSize);
代码示例来源:origin: io.vertx/vertx-core
protected void startNodes(int numNodes, VertxOptions options) {
CountDownLatch latch = new CountDownLatch(numNodes);
vertices = new Vertx[numNodes];
for (int i = 0; i < numNodes; i++) {
int index = i;
clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
.setClusterManager(getClusterManager()), ar -> {
try {
if (ar.failed()) {
ar.cause().printStackTrace();
}
assertTrue("Failed to start node", ar.succeeded());
vertices[index] = ar.result();
}
finally {
latch.countDown();
}
});
}
try {
assertTrue(latch.await(2, TimeUnit.MINUTES));
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
代码示例来源:origin: io.vertx/vertx-core
@Override
public void beforeStartingVertx(VertxOptions options) {
beforeStartingVertxInvoked = true;
this.options = options;
if (clusterHost != null) {
options.setClusterHost(clusterHost);
options.setClusterPort(clusterPort);
options.setClusterPublicHost(clusterPublicHost);
options.setClusterPublicPort(clusterPublicPort);
super.beforeStartingVertx(options);
}
}
代码示例来源:origin: io.vertx/vertx-core
.setClusterHost(clusterHost).setClusterPort(clusterPort)
.setClusterPublicHost(clusterPublicHost);
if (clusterPublicPort != -1) {
代码示例来源:origin: eclipse-vertx/vert.x
assertTrue(options.isClustered());
assertEquals(0, options.getClusterPort());
assertEquals(options, options.setClusterPort(1234));
assertEquals(1234, options.getClusterPort());
try {
options.setClusterPort(-1);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
options.setClusterPort(65536);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
代码示例来源:origin: cn.vertxup/vertx-co
protected void startNodes(final int numNodes, final VertxOptions options) {
final CountDownLatch latch = new CountDownLatch(numNodes);
this.vertices = new Vertx[numNodes];
for (int i = 0; i < numNodes; i++) {
final int index = i;
this.clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
.setClusterManager(this.getClusterManager()), ar -> {
try {
if (ar.failed()) {
ar.cause().printStackTrace();
}
this.assertTrue("Failed to start node", ar.succeeded());
this.vertices[index] = ar.result();
} finally {
latch.countDown();
}
});
}
try {
this.assertTrue(latch.await(2, TimeUnit.MINUTES));
} catch (final InterruptedException e) {
this.fail(e.getMessage());
}
}
代码示例来源:origin: silentbalanceyh/vertx-zero
protected void startNodes(final int numNodes, final VertxOptions options) {
final CountDownLatch latch = new CountDownLatch(numNodes);
this.vertices = new Vertx[numNodes];
for (int i = 0; i < numNodes; i++) {
final int index = i;
this.clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
.setClusterManager(this.getClusterManager()), ar -> {
try {
if (ar.failed()) {
ar.cause().printStackTrace();
}
this.assertTrue("Failed to start node", ar.succeeded());
this.vertices[index] = ar.result();
} finally {
latch.countDown();
}
});
}
try {
this.assertTrue(latch.await(2, TimeUnit.MINUTES));
} catch (final InterruptedException e) {
this.fail(e.getMessage());
}
}
代码示例来源:origin: io.vertx/vertx-jca-adapter
options.setClustered(config.isClustered());
options.setClusterHost(config.getClusterHost());
options.setClusterPort(config.getClusterPort());
代码示例来源:origin: io.vertx/vertx-zookeeper
protected void startNodes(int numNodes, VertxOptions options) {
CountDownLatch latch = new CountDownLatch(numNodes);
vertices = new Vertx[numNodes];
for (int i = 0; i < numNodes; i++) {
int index = i;
clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
.setClusterManager(getClusterManager()), ar -> {
try {
if (ar.failed()) {
ar.cause().printStackTrace();
}
assertTrue("Failed to start node", ar.succeeded());
vertices[index] = ar.result();
} finally {
latch.countDown();
}
});
}
try {
Thread.sleep(1500L);
} catch (InterruptedException e) {
//
}
try {
assertTrue(latch.await(2, TimeUnit.MINUTES));
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
代码示例来源:origin: vert-x3/vertx-zookeeper
protected void startNodes(int numNodes, VertxOptions options) {
CountDownLatch latch = new CountDownLatch(numNodes);
vertices = new Vertx[numNodes];
for (int i = 0; i < numNodes; i++) {
int index = i;
clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
.setClusterManager(getClusterManager()), ar -> {
try {
if (ar.failed()) {
ar.cause().printStackTrace();
}
assertTrue("Failed to start node", ar.succeeded());
vertices[index] = ar.result();
} finally {
latch.countDown();
}
});
}
try {
Thread.sleep(1500L);
} catch (InterruptedException e) {
//
}
try {
assertTrue(latch.await(2, TimeUnit.MINUTES));
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
代码示例来源:origin: folio-org/okapi
vopt.setClusterPort(clusterPort);
} else {
logger.warn("clusterPort not set");
代码示例来源:origin: io.vertx/vertx-core
TimeUnit warningExceptionTimeUnit = TimeUnit.MINUTES;
TimeUnit blockedThreadCheckIntervalUnit = TimeUnit.MINUTES;
options.setClusterPort(clusterPort);
options.setClusterPublicPort(clusterPublicPort);
options.setEventLoopPoolSize(eventLoopPoolSize);
代码示例来源:origin: io.vertx/vertx-core
assertTrue(options.isClustered());
assertEquals(0, options.getClusterPort());
assertEquals(options, options.setClusterPort(1234));
assertEquals(1234, options.getClusterPort());
try {
options.setClusterPort(-1);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
options.setClusterPort(65536);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
内容来源于网络,如有侵权,请联系作者删除!