Package com.linkedin.r2.util

Examples of com.linkedin.r2.util.NamedThreadFactory


  {
    // write D2-related configuration to ZooKeeper
    // all the configuration here are permanent, no need to re-write as long as ZooKeeper still has the data
    // therefore in real case, do this "discovery" step separately

    final HttpServer server = RestLiExampleBasicServer.createServer();
    final ZooKeeperConnectionManager zkConn = createZkConn();

    startServer(server, zkConn);

    System.out.println("Example server with D2 is running with URL " + RestLiExampleBasicServer.getServerUrl() + ". Press any key to stop server.");
View Full Code Here


    TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config,
                                                                                        resourceFactory,
                                                                                        engine));

    final FilterChain fc = FilterChains.empty().addLast(new SimpleLoggingFilter());
    final HttpServer server = new HttpServerFactory(fc).createServer(port,
                                                               HttpServerFactory.DEFAULT_CONTEXT_PATH,
                                                               NUM_THREADS,
                                                               dispatcher,
                                                               enableAsync,
                                                               enableAsync ? ASYNC_TIMEOUT : -1);
View Full Code Here

    // using InjectMockResourceFactory to keep examples spring-free
    final ResourceFactory factory = new InjectMockResourceFactory(beanProvider);

    final TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config, factory));
    return new HttpServerFactory(FilterChains.empty()).createServer(SERVER_PORT, dispatcher);
  }
View Full Code Here

    return createHttpServer(HTTP_PORT, filters);
  }

  public static Server createHttpServer(int port, FilterChain filters)
  {
    return new HttpServerFactory(filters)
            .createServer(port, createDispatcher());
  }
View Full Code Here

  public RestliHttpRequestHandler(RestLiConfig config,
                                  SpringInjectResourceFactory injectResourceFactory,
                                  FilterChain filterChain)
  {
    _r2Servlet = new RAPServlet(
        new FilterChainDispatcher(
            new DelegatingTransportDispatcher(
                new RestLiServer(config, injectResourceFactory)),
            filterChain
        )
View Full Code Here

    _directory = new ZKFSDirectory(basePath);

    _shutdownAsynchronously = shutdownAsynchronously;
    _isSymlinkAware = isSymlinkAware;

    _executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("D2 PropertyEventExecutor"));
    _keyMapper = new ConsistentHashKeyMapper(this, this);
    _delayedExecution = 1000;
  }
View Full Code Here

  public HttpClientFactory(ExecutorService callbackExecutor,
                           boolean shutdownCallbackExecutor)
  {
    this(FilterChains.empty(),
         new NioClientSocketChannelFactory(
            Executors.newCachedThreadPool(new NamedThreadFactory("R2 Netty IO Boss")),
            Executors.newCachedThreadPool(new NamedThreadFactory("R2 Netty IO Worker"))),
         true,
         Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("R2 Netty Scheduler")),
         true,
         callbackExecutor,
         shutdownCallbackExecutor);
  }
View Full Code Here

  {
    // TODO Disable Netty's thread renaming so that the names below are the ones that actually
    // show up in log messages; need to coordinate with Espresso team (who also have netty threads)
    this(filters,
         new NioClientSocketChannelFactory(
            Executors.newCachedThreadPool(new NamedThreadFactory("R2 Netty IO Boss")),
            Executors.newCachedThreadPool(new NamedThreadFactory("R2 Netty IO Worker"))),
         true,
         Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("R2 Netty Scheduler")),
         true);
  }
View Full Code Here

                                     ".ini",
                                     new UriPropertiesJsonSerializer());

    // chains
    PropertyEventThread thread = new PropertyEventThread("echo client event thread");
    ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(
                        "echo client event thread"));

    // start up the world
    thread.start();
View Full Code Here

        (ZooKeeperEphemeralStore<UriProperties>) getEphemeralStore(zkclient,
                                                                   uristoreString,
                                                                   new UriPropertiesJsonSerializer(),
                                                                   new UriPropertiesMerger());

    ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("D2 PropertyEventExecutor"));

    PropertyEventBus<ServiceProperties> serviceBus =
        new PropertyEventBusImpl<ServiceProperties>(executor, zkServiceRegistry);
    PropertyEventBus<UriProperties> uriBus =
        new PropertyEventBusImpl<UriProperties>(executor, zkUriRegistry);
View Full Code Here

TOP

Related Classes of com.linkedin.r2.util.NamedThreadFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.