本文整理汇总了Java中org.sdnplatform.sync.internal.rpc.RPCService类的典型用法代码示例。如果您正苦于以下问题:Java RPCService类的具体用法?Java RPCService怎么用?Java RPCService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RPCService类属于org.sdnplatform.sync.internal.rpc包,在下文中一共展示了RPCService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
public void init() throws SyncException {
cg = new DefaultChannelGroup("Cluster Bootstrap", GlobalEventExecutor.INSTANCE);
workerExecutor = new NioEventLoopGroup();
timer = new HashedWheelTimer();
bootstrap = new Bootstrap()
.group(workerExecutor)
.channel(NioSocketChannel.class)
.option(ChannelOption.SO_REUSEADDR, true)
.option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.TCP_NODELAY, true)
.option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT);
pipelineFactory = new BootstrapChannelInitializer(timer, this);
bootstrap.handler(pipelineFactory);
}
示例2: startUp
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
throws FloodlightModuleException {
shutdown = false;
workerExecutor = new NioEventLoopGroup();
timer = new HashedWheelTimer();
pipelineFactory = new RemoteSyncChannelInitializer(timer, this);
final Bootstrap bootstrap = new Bootstrap()
.channel(NioSocketChannel.class)
.group(workerExecutor)
.option(ChannelOption.SO_REUSEADDR, true)
.option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.TCP_NODELAY, true)
.option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT)
.handler(pipelineFactory);
clientBootstrap = bootstrap;
}
示例3: init
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
public void init() throws SyncException {
cg = new DefaultChannelGroup("Cluster Bootstrap");
bossExecutor = Executors.newCachedThreadPool();
workerExecutor = Executors.newCachedThreadPool();
bootstrap =
new ClientBootstrap(new NioClientSocketChannelFactory(bossExecutor,
workerExecutor));
bootstrap.setOption("child.reuseAddr", true);
bootstrap.setOption("child.keepAlive", true);
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.sendBufferSize",
RPCService.SEND_BUFFER_SIZE);
bootstrap.setOption("child.receiveBufferSize",
RPCService.SEND_BUFFER_SIZE);
bootstrap.setOption("child.connectTimeoutMillis",
RPCService.CONNECT_TIMEOUT);
pipelineFactory = new BootstrapPipelineFactory(this);
bootstrap.setPipelineFactory(pipelineFactory);
}
示例4: startUp
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
throws FloodlightModuleException {
shutdown = false;
bossExecutor = Executors.newCachedThreadPool();
workerExecutor = Executors.newCachedThreadPool();
final ClientBootstrap bootstrap =
new ClientBootstrap(
new NioClientSocketChannelFactory(bossExecutor,
workerExecutor));
bootstrap.setOption("child.reuseAddr", true);
bootstrap.setOption("child.keepAlive", true);
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.sendBufferSize",
RPCService.SEND_BUFFER_SIZE);
bootstrap.setOption("child.receiveBufferSize",
RPCService.SEND_BUFFER_SIZE);
bootstrap.setOption("child.connectTimeoutMillis",
RPCService.CONNECT_TIMEOUT);
pipelineFactory = new RemoteSyncPipelineFactory(this);
bootstrap.setPipelineFactory(pipelineFactory);
clientBootstrap = bootstrap;
}
示例5: init
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
public void init() throws SyncException {
cg = new DefaultChannelGroup("Cluster Bootstrap", GlobalEventExecutor.INSTANCE);
workerExecutor = new NioEventLoopGroup();
timer = new HashedWheelTimer();
bootstrap = new Bootstrap()
.group(workerExecutor)
.channel(NioSocketChannel.class)
.option(ChannelOption.SO_REUSEADDR, true)
.option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.TCP_NODELAY, true)
.option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT);
pipelineFactory = new BootstrapChannelInitializer(timer, this);
bootstrap.handler(pipelineFactory);
}
示例6: startUp
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
throws FloodlightModuleException {
shutdown = false;
workerExecutor = new NioEventLoopGroup();
timer = new HashedWheelTimer();
pipelineFactory = new RemoteSyncChannelInitializer(timer, this);
final Bootstrap bootstrap = new Bootstrap()
.channel(NioSocketChannel.class)
.group(workerExecutor)
.option(ChannelOption.SO_REUSEADDR, true)
.option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.TCP_NODELAY, true)
.option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT)
.handler(pipelineFactory);
clientBootstrap = bootstrap;
}
示例7: startUp
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
throws FloodlightModuleException {
rpcService = new RPCService(this, debugCounter);
cleanupTask = new SingletonTask(threadPool.getScheduledExecutor(),
new CleanupTask());
cleanupTask.reschedule(CLEANUP_INTERVAL +
random.nextInt(30), TimeUnit.SECONDS);
antientropyTask = new SingletonTask(threadPool.getScheduledExecutor(),
new AntientropyTask());
antientropyTask.reschedule(ANTIENTROPY_INTERVAL +
random.nextInt(30), TimeUnit.SECONDS);
final ThreadGroup tg = new ThreadGroup("Hint Workers");
tg.setMaxPriority(Thread.NORM_PRIORITY - 2);
ThreadFactory f = new ThreadFactory() {
AtomicInteger id = new AtomicInteger();
@Override
public Thread newThread(Runnable runnable) {
return new Thread(tg, runnable,
"HintWorker-" + id.getAndIncrement());
}
};
hintThreadPool = Executors.newCachedThreadPool(f);
for (int i = 0; i < SYNC_WORKER_POOL; i++) {
hintThreadPool.execute(new HintWorker());
}
doUpdateConfiguration();
rpcService.run();
updateConfigTask =
new SingletonTask(threadPool.getScheduledExecutor(),
new UpdateConfigTask());
updateConfigTask.reschedule(CONFIG_RESCAN_INTERVAL, TimeUnit.SECONDS);
}
示例8: startUp
import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
throws FloodlightModuleException {
timer = new HashedWheelTimer();
rpcService = new RPCService(this, debugCounter, timer);
cleanupTask = new SingletonTask(threadPool.getScheduledExecutor(),
new CleanupTask());
cleanupTask.reschedule(CLEANUP_INTERVAL +
random.nextInt(30), TimeUnit.SECONDS);
antientropyTask = new SingletonTask(threadPool.getScheduledExecutor(),
new AntientropyTask());
antientropyTask.reschedule(ANTIENTROPY_INTERVAL +
random.nextInt(30), TimeUnit.SECONDS);
final ThreadGroup tg = new ThreadGroup("Hint Workers");
tg.setMaxPriority(Thread.NORM_PRIORITY - 2);
ThreadFactory f = new ThreadFactory() {
AtomicInteger id = new AtomicInteger();
@Override
public Thread newThread(Runnable runnable) {
return new Thread(tg, runnable,
"HintWorker-" + id.getAndIncrement());
}
};
hintThreadPool = Executors.newCachedThreadPool(f);
for (int i = 0; i < SYNC_WORKER_POOL; i++) {
hintThreadPool.execute(new HintWorker());
}
doUpdateConfiguration();
rpcService.run();
updateConfigTask =
new SingletonTask(threadPool.getScheduledExecutor(),
new UpdateConfigTask());
updateConfigTask.reschedule(CONFIG_RESCAN_INTERVAL, TimeUnit.SECONDS);
}