Examples of FetchRequest


Examples of com.google.step2.http.FetchRequest

    assertInputStreamIsClosed(response);
  }

  public void testGet_syntaxError() throws Exception {
    String host = "host.com";
    FetchRequest request =
        FetchRequest.createGetRequest(new URI("http://host.com/host-meta"));
    FetchResponse response = new FakeFetchResponse(200,
        "Link: <http://foo.com/bar>; rel=foobar type=foo\n");

    expect(http.fetch(request)).andReturn(response);
View Full Code Here

Examples of com.google.step2.http.FetchRequest

    assertInputStreamIsClosed(response);
  }

  public void testGet_fetchException() throws Exception {
    String host = "host.com";
    FetchRequest request =
        FetchRequest.createGetRequest(new URI("http://host.com/host-meta"));

    expect(http.fetch(request)).andThrow(new FetchException());

    control.replay();
View Full Code Here

Examples of com.google.step2.http.FetchRequest

    control.verify();
  }

  public void testGet_httpErrorCode() throws Exception {
    String host = "host.com";
    FetchRequest request =
        FetchRequest.createGetRequest(new URI("http://host.com/host-meta"));
    FetchResponse response = new FakeFetchResponse(400, "error");

    expect(http.fetch(request)).andReturn(response);
View Full Code Here

Examples of com.taobao.metamorphosis.client.consumer.FetchRequest

        this.mockLoadNullInitOffset("topic1", GROUP, new Partition("0-2"));
        this.mockLoadNullInitOffset("topic2", GROUP, new Partition("0-0"));
        // this.mockLoadNullInitOffset("topic2", GROUP, new
        // Partition("1-0"));��load����һ��master�ķ���
        this.mockFetchManagerRestart();
        this.mockAddFetchRequest(new FetchRequest(new Broker(0, "meta://localhost:0"), 0, new TopicPartitionRegInfo(
            "topic1", new Partition("0-0"), 0), 1024 * 1024));
        this.mockAddFetchRequest(new FetchRequest(new Broker(0, "meta://localhost:0"), 0, new TopicPartitionRegInfo(
            "topic1", new Partition("0-1"), 0), 1024 * 1024));
        this.mockAddFetchRequest(new FetchRequest(new Broker(0, "meta://localhost:0"), 0, new TopicPartitionRegInfo(
            "topic1", new Partition("0-2"), 0), 1024 * 1024));
        this.mockAddFetchRequest(new FetchRequest(new Broker(0, "meta://localhost:0"), 0, new TopicPartitionRegInfo(
            "topic2", new Partition("0-0"), 0), 1024 * 1024));
        // this.mockAddFetchRequest(new FetchRequest(new Broker(1,
        // "meta://localhost:1"), 0, new TopicPartitionRegInfo(
        // "topic2", new Partition("1-0"), 0), 1024 * 1024));��������һ��masterץȡ��Ϣ

 
View Full Code Here

Examples of kafka.api.FetchRequest

    public static ByteBufferMessageSet fetchMessages(KafkaConfig config, SimpleConsumer consumer, Partition partition, long offset) throws UpdateOffsetException {
        ByteBufferMessageSet msgs = null;
        String topic = config.topic;
        int partitionId = partition.partition;
        FetchRequestBuilder builder = new FetchRequestBuilder();
        FetchRequest fetchRequest = builder.addFetch(topic, partitionId, offset, config.fetchSizeBytes).
                clientId(config.clientId).maxWait(config.fetchMaxWait).build();
        FetchResponse fetchResponse;
        try {
            fetchResponse = consumer.fetch(fetchRequest);
        } catch (Exception e) {
View Full Code Here

Examples of kafka.api.FetchRequest

        ByteBufferMessageSet msgs = null;
        String topic = config.topic;
        int partitionId = partition.partition;
        for (int errors = 0; errors < 2 && msgs == null; errors++) {
            FetchRequestBuilder builder = new FetchRequestBuilder();
            FetchRequest fetchRequest = builder.addFetch(topic, partitionId, offset, config.fetchSizeBytes).
                    clientId(config.clientId).build();
            FetchResponse fetchResponse;
            try {
                fetchResponse = consumer.fetch(fetchRequest);
            } catch (Exception e) {
View Full Code Here

Examples of kafka.javaapi.FetchRequest

        currentOffset, fetchBufferSize);

    HashMap<TopicAndPartition, PartitionFetchInfo> fetchInfo = new HashMap<TopicAndPartition, PartitionFetchInfo>();
    fetchInfo.put(topicAndPartition, partitionFetchInfo);

    FetchRequest fetchRequest = new FetchRequest(
        CamusJob.getKafkaFetchRequestCorrelationId(context),
        CamusJob.getKafkaClientName(context),
        CamusJob.getKafkaFetchRequestMaxWait(context),
        CamusJob.getKafkaFetchRequestMinBytes(context), fetchInfo);
View Full Code Here

Examples of org.apache.james.imap.message.request.FetchRequest

            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "VANISHED only allowed in UID FETCH");
        }
       
        request.eol();

        final ImapMessage result = new FetchRequest(command, useUids, idSet, fetch, tag);
        return result;
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.request.FetchRequest

        RequestIdentifier reqID = new RequestIdentifier(table, mmds, RequestType.FETCH,
            cmd.getFullClassName());
        Request req = requestsByID.get(reqID);
        if (req == null)
        {
            req = new FetchRequest(table, mmds, cmd, clr);
            requestsByID.put(reqID, req);
        }
        return req;
    }
View Full Code Here

Examples of org.eweb4j.spiderman.fetcher.FetchRequest

    config.setPolitenessDelay(200);
    fetcher.setConfig(config);
    fetcher.init(null);
    try {
      String url = "http://www.livingsocial.com/cities/1964-klang-valley-kuala-lumpur/deals/638602-patong-bay-resotel-return-flight?append_ref_code=source_cities_show";
      FetchRequest req = new FetchRequest();
      req.setUrl(url);
      FetchResult rs = fetcher.fetch(req);
      System.out.println(rs);
      System.out.println(rs.getPage().getContent());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.