Package com.linkedin.r2.message.rest

Examples of com.linkedin.r2.message.rest.RestResponseBuilder


        this.config = config;
        this.httpClientFactory = new HttpClientFactory();
        Map<String, String> properties = Maps.newHashMap();
        properties.put(HttpClientFactory.HTTP_POOL_SIZE,
                       Integer.toString(this.config.getMaxR2ConnectionPoolSize()));
        this.client = new TransportClientAdapter(httpClientFactory.getClient(properties));
    }
View Full Code Here


    AsyncCallableTask.register(engineBuilder, executor);

    final Engine engine = engineBuilder.build();
    ResourceFactory resourceFactory = createResourceFactory(beans);

    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,
View Full Code Here

        RESTClientConfig restClientConfig = new RESTClientConfig();
        restClientConfig.setHttpBootstrapURL("http://localhost:"
                                             + cluster.getNodeById(0).getRestPort())
                        .setTimeoutMs(10000, TimeUnit.MILLISECONDS)
                        .setMaxR2ConnectionPoolSize(100);
        clientFactory = new HttpClientFactory();
        Map<String, String> properties = new HashMap<String, String>();
        properties.put(HttpClientFactory.HTTP_POOL_SIZE,
                       Integer.toString(restClientConfig.getMaxR2ConnectionPoolSize()));
        TransportClient transportClient = clientFactory.getClient(properties);
        R2Store r2Store = new R2Store(STORE_NAME,
View Full Code Here

        restClientConfig = new RESTClientConfig();
        restClientConfig.setHttpBootstrapURL("http://localhost:8085")
                        .setTimeoutMs(1500, TimeUnit.MILLISECONDS)
                        .setMaxR2ConnectionPoolSize(100);
        clientFactory = new HttpClientFactory();
        Map<String, String> properties = new HashMap<String, String>();
        properties.put(HttpClientFactory.HTTP_POOL_SIZE,
                       Integer.toString(restClientConfig.getMaxR2ConnectionPoolSize()));
        transportClient = clientFactory.getClient(properties);
        r2store = new R2Store("test",
View Full Code Here

        this.config = new RESTClientConfig(restClientFactoryConfig.getClientConfig());
        this.stats = new StoreStats("aggregate.rest-client-factory");
        this.rawStoreList = new ArrayList<R2Store>();
        // Create the R2 (Netty) Factory object
        // TODO: Add monitoring for R2 factory
        this._clientFactory = new HttpClientFactory();
        this.RESTClientFactoryStats = new StoreClientFactoryStats();
        keySerializerMap = new HashMap<String, SerializerDefinition>();
        valueSerializerMap = new HashMap<String, SerializerDefinition>();
    }
View Full Code Here

        this(new RESTClientConfig());
    }

    public CoordinatorAdminClient(RESTClientConfig config) {
        this.config = config;
        this.httpClientFactory = new HttpClientFactory();
        Map<String, String> properties = Maps.newHashMap();
        properties.put(HttpClientFactory.HTTP_POOL_SIZE,
                       Integer.toString(this.config.getMaxR2ConnectionPoolSize()));
        this.client = new TransportClientAdapter(httpClientFactory.getClient(properties));
    }
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);
    return new HttpServer()
    {
      @Override
      public void start()
          throws IOException
      {
        server.start();
      }

      @Override
      public void stop()
          throws IOException
      {
        server.stop();
        engine.shutdown();
        executor.shutdown();
        scheduler.shutdown();
      }

      @Override
      public void waitForStop()
          throws InterruptedException
      {
        server.waitForStop();
      }
    };
  }
View Full Code Here

    Map<String, Object> beans = getBeans();

    boolean[] enableAsyncOptions = {true, false};
    for (boolean enableAsync: enableAsyncOptions)
    {
      HttpServer server = MockHttpServerFactory.create(PORT, resourceClasses, beans, enableAsync);

      runTest(server);
    }
  }
View Full Code Here

    Map<String, Object> beans = getBeans();

    boolean[] enableAsyncOptions = {true, false};
    for (boolean enableAsync: enableAsyncOptions)
    {
      HttpServer server = MockHttpServerFactory.create(PORT,
                                                       new String[]{"com.linkedin.restli.example.impl"},
                                                       beans,
                                                       enableAsync);

      runTest(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

TOP

Related Classes of com.linkedin.r2.message.rest.RestResponseBuilder

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.