Package com.linkedin.r2.message.rest

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


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

    FindRequestBuilder<Long, Greeting> findRB = new FindRequestBuilder<Long, Greeting>(TEST_URI,
                                                                                       Greeting.class,
                                                                                       _COLL_SPEC,
                                                                                       options);
    Collection<RequestContext> requestContexts =
        (searchRB.buildRequestContexts(findRB.fields(Greeting.fields().message()).build(), new RequestContext())).getPartitionInfo();

    Assert.assertEquals(PARTITION_NUM, requestContexts.size());

    Set<String> expectedHostPrefixes = new HashSet<String>();
    for (int i = 0; i < PARTITION_NUM; i++)
View Full Code Here

        }
        latch.countDown();
      }
    };

    searchRB.sendRequests(REST_CLIENT, request, new RequestContext(), cb);
    latch.await();
    if (!errors.isEmpty())
    {
      Assert.fail("I knew it: " + errors.toString());
    }
View Full Code Here

                }
            }

        } catch(ExecutionException e) {
            if(e.getCause() instanceof RestException) {
                RestException exception = (RestException) e.getCause();
                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }
                if(exception.getResponse().getStatus() == NOT_FOUND.getCode()) {
                    return false;
                }
            } else {
                throw new VoldemortException("Unknown HTTP request execution exception: "
                                             + e.getMessage(), e);
View Full Code Here

                    logger.debug("Did not get any response!");
                }
            }
        } catch(ExecutionException e) {
            if(e.getCause() instanceof RestException) {
                RestException exception = (RestException) e.getCause();
                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }

            } else {
                throw new VoldemortException("Unknown HTTP request execution exception: "
                                             + e.getMessage(), e);
View Full Code Here

            RestResponse response = fetchGetResponse(rb, FETCH_SCHEMA_TIMEOUT_MS);
            return response.getEntity().asString("UTF-8");
        } catch(ExecutionException e) {
            if(e.getCause() instanceof RestException) {
                RestException exception = (RestException) e.getCause();
                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }
            } else {
                throw new VoldemortException("Unknown HTTP request execution exception: "
                                             + e.getMessage(), e);
            }
View Full Code Here

                    logger.debug("Empty response !");
                }
            }
        } catch(ExecutionException e) {
            if(e.getCause() instanceof RestException) {
                RestException exception = (RestException) e.getCause();
                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }

                int httpErrorStatus = exception.getResponse().getStatus();
                if(httpErrorStatus == BAD_REQUEST.getCode()) {
                    throw new VoldemortException("Bad request: " + e.getMessage(), e);
                } else if(httpErrorStatus == PRECONDITION_FAILED.getCode()) {
                    throw new ObsoleteVersionException(e.getMessage());
                } else if(httpErrorStatus == REQUEST_TIMEOUT.getCode()
View Full Code Here

                    }
                }
            }
        } catch(ExecutionException e) {
            if(e.getCause() instanceof RestException) {
                RestException exception = (RestException) e.getCause();
                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }
            } else {
                throw new VoldemortException("Unknown HTTP request execution exception: "
                                             + e.getMessage(), e);
            }
View Full Code Here

                    logger.debug("Did not get any response!");
                }
            }
        } catch(ExecutionException e) {
            if(e.getCause() instanceof RestException) {
                RestException exception = (RestException) e.getCause();
                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }

            } else {
                throw new VoldemortException("Unknown HTTP request execution exception: "
                                             + e.getMessage(), e);
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.