Search in sources :

Example 11 with HashedWheelTimer

use of org.jboss.netty.util.HashedWheelTimer in project graylog2-server by Graylog2.

the class UdpTransportTest method setUp.

@Before
public void setUp() throws Exception {
    throughputCounter = new ThroughputCounter(new HashedWheelTimer());
    localMetricRegistry = new LocalMetricRegistry();
    udpTransport = new UdpTransport(CONFIGURATION, throughputCounter, localMetricRegistry);
}
Also used : ThroughputCounter(org.graylog2.plugin.inputs.util.ThroughputCounter) HashedWheelTimer(org.jboss.netty.util.HashedWheelTimer) LocalMetricRegistry(org.graylog2.plugin.LocalMetricRegistry) Before(org.junit.Before)

Example 12 with HashedWheelTimer

use of org.jboss.netty.util.HashedWheelTimer in project cdap by caskdata.

the class NettyRouter method startUp.

@Override
protected void startUp() throws ServiceBindException {
    ChannelUpstreamHandler connectionTracker = new SimpleChannelUpstreamHandler() {

        @Override
        public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
            channelGroup.add(e.getChannel());
            super.channelOpen(ctx, e);
        }
    };
    tokenValidator.startAndWait();
    timer = new HashedWheelTimer(new ThreadFactoryBuilder().setDaemon(true).setNameFormat("router-idle-event-generator-timer").build());
    bootstrapClient(connectionTracker);
    bootstrapServer(connectionTracker);
}
Also used : SimpleChannelUpstreamHandler(org.jboss.netty.channel.SimpleChannelUpstreamHandler) ChannelUpstreamHandler(org.jboss.netty.channel.ChannelUpstreamHandler) ChannelStateEvent(org.jboss.netty.channel.ChannelStateEvent) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) ChannelHandlerContext(org.jboss.netty.channel.ChannelHandlerContext) HashedWheelTimer(org.jboss.netty.util.HashedWheelTimer) SimpleChannelUpstreamHandler(org.jboss.netty.channel.SimpleChannelUpstreamHandler)

Example 13 with HashedWheelTimer

use of org.jboss.netty.util.HashedWheelTimer in project camel by apache.

the class NettyComponent method doStart.

@Override
protected void doStart() throws Exception {
    if (timer == null) {
        HashedWheelTimer hashedWheelTimer = new HashedWheelTimer();
        hashedWheelTimer.start();
        timer = hashedWheelTimer;
    }
    if (configuration == null) {
        configuration = new NettyConfiguration();
    }
    if (configuration.isOrderedThreadPoolExecutor()) {
        executorService = createExecutorService();
    }
    super.doStart();
}
Also used : HashedWheelTimer(org.jboss.netty.util.HashedWheelTimer)

Example 14 with HashedWheelTimer

use of org.jboss.netty.util.HashedWheelTimer in project pinpoint by naver.

the class ZookeeperClusterDataManager method createTimer.

private Timer createTimer() {
    HashedWheelTimer timer = TimerFactory.createHashedWheelTimer("Pinpoint-Web-Cluster-Timer", 100, TimeUnit.MILLISECONDS, 512);
    timer.start();
    return timer;
}
Also used : HashedWheelTimer(org.jboss.netty.util.HashedWheelTimer)

Example 15 with HashedWheelTimer

use of org.jboss.netty.util.HashedWheelTimer in project graylog2-server by Graylog2.

the class GenericBindings method configure.

@Override
protected void configure() {
    // This is holding all our metrics.
    bind(MetricRegistry.class).toProvider(MetricRegistryProvider.class).asEagerSingleton();
    // must not be a singleton!
    bind(LocalMetricRegistry.class).in(Scopes.NO_SCOPE);
    install(new FactoryModuleBuilder().build(DecodingProcessor.Factory.class));
    bind(ProcessBuffer.class).asEagerSingleton();
    bind(InputBuffer.class).to(InputBufferImpl.class);
    bind(NodeId.class).toProvider(NodeIdProvider.class);
    bind(ServiceManager.class).toProvider(ServiceManagerProvider.class).asEagerSingleton();
    bind(HashedWheelTimer.class).toInstance(new HashedWheelTimer());
    bind(ThroughputCounter.class);
    bind(EventBus.class).toProvider(EventBusProvider.class).in(Scopes.SINGLETON);
    bind(Semaphore.class).annotatedWith(Names.named("JournalSignal")).toInstance(new Semaphore(0));
    install(new FactoryModuleBuilder().build(new TypeLiteral<IOState.Factory<MessageInput>>() {
    }));
    bind(InputRegistry.class).asEagerSingleton();
    bind(OkHttpClient.class).toProvider(OkHttpClientProvider.class).asEagerSingleton();
    bind(OkHttpClient.class).annotatedWith(Names.named("systemHttpClient")).toProvider(SystemOkHttpClientProvider.class).asEagerSingleton();
    bind(MimetypesFileTypeMap.class).toInstance(new MimetypesFileTypeMap());
    bind(ExecutorService.class).annotatedWith(Names.named("proxiedRequestsExecutorService")).toProvider(ProxiedRequestsExecutorService.class).asEagerSingleton();
}
Also used : MimetypesFileTypeMap(javax.activation.MimetypesFileTypeMap) OkHttpClient(okhttp3.OkHttpClient) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) MessageInput(org.graylog2.plugin.inputs.MessageInput) HashedWheelTimer(org.jboss.netty.util.HashedWheelTimer) Semaphore(java.util.concurrent.Semaphore) InputRegistry(org.graylog2.shared.inputs.InputRegistry) MetricRegistryProvider(org.graylog2.shared.bindings.providers.MetricRegistryProvider) EventBusProvider(org.graylog2.shared.bindings.providers.EventBusProvider) TypeLiteral(com.google.inject.TypeLiteral) ServiceManagerProvider(org.graylog2.shared.bindings.providers.ServiceManagerProvider) ProxiedRequestsExecutorService(org.graylog2.shared.bindings.providers.ProxiedRequestsExecutorService) IOState(org.graylog2.plugin.IOState) NodeId(org.graylog2.plugin.system.NodeId) SystemOkHttpClientProvider(org.graylog2.shared.bindings.providers.SystemOkHttpClientProvider) OkHttpClientProvider(org.graylog2.shared.bindings.providers.OkHttpClientProvider) ProxiedRequestsExecutorService(org.graylog2.shared.bindings.providers.ProxiedRequestsExecutorService) ExecutorService(java.util.concurrent.ExecutorService) InputBuffer(org.graylog2.plugin.buffers.InputBuffer) SystemOkHttpClientProvider(org.graylog2.shared.bindings.providers.SystemOkHttpClientProvider) ProcessBuffer(org.graylog2.shared.buffers.ProcessBuffer) LocalMetricRegistry(org.graylog2.plugin.LocalMetricRegistry)

Aggregations

HashedWheelTimer (org.jboss.netty.util.HashedWheelTimer)16 LocalMetricRegistry (org.graylog2.plugin.LocalMetricRegistry)3 NioClientSocketChannelFactory (org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory)3 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)2 DefaultFuture (com.navercorp.pinpoint.rpc.DefaultFuture)2 Future (com.navercorp.pinpoint.rpc.Future)2 RequestPacket (com.navercorp.pinpoint.rpc.packet.RequestPacket)2 ThreadFactory (java.util.concurrent.ThreadFactory)2 ThroughputCounter (org.graylog2.plugin.inputs.util.ThroughputCounter)2 ClientBootstrap (org.jboss.netty.bootstrap.ClientBootstrap)2 Before (org.junit.Before)2 Test (org.junit.Test)2 TypeLiteral (com.google.inject.TypeLiteral)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 TestAwaitTaskUtils (com.navercorp.pinpoint.rpc.TestAwaitTaskUtils)1 ClientConfig (com.twitter.distributedlog.client.ClientConfig)1 DefaultRegionResolver (com.twitter.distributedlog.client.resolver.DefaultRegionResolver)1 ClientStats (com.twitter.distributedlog.client.stats.ClientStats)1 ConnectException (java.net.ConnectException)1 InetSocketAddress (java.net.InetSocketAddress)1