Examples of request()


Examples of org.elasticsearch.action.bulk.BulkRequestBuilder.request()

        }

        request.setConsistencyLevel(WriteConsistencyLevel.ONE);
        request.setReplicationType(ReplicationType.ASYNC);

        final BulkResponse response = c.bulk(request.request()).actionGet();

        log.debug("Deflector index: Bulk indexed {} messages, took {} ms, failures: {}",
                  response.getItems().length, response.getTookInMillis(), response.hasFailures());

        if (response.hasFailures()) {
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequestBuilder.request()

   * @return null if object doesn't have an id
   */
  @CheckForNull
  public final DeleteRequest deleteRequest(String indexName, String id, Long version) {
    DeleteRequestBuilder builder = populate(new DeleteRequestBuilder(null), indexName, id, version);
    return builder == null ? null : builder.request();
  }

  /**
   * @return null if object doesn't have an id
   */
 
View Full Code Here

Examples of org.elasticsearch.action.deletebyquery.DeleteByQueryRequestBuilder.request()

    }

    public void deleteByName(String term) {
        DeleteByQueryRequestBuilder qb = client.prepareDeleteByQuery(getIndexName()).setTypes(getIndexType());
        qb.setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), FilterBuilders.termFilter(TERM, term)));
        client.deleteByQuery(qb.request());
    }

    public void deleteOlderThan(int hours) {
        RangeQueryBuilder sqb = QueryBuilders.rangeQuery(LAST_REQ).lt(new MyDate().minusHours(hours).toDate());
        DeleteByQueryRequestBuilder dbq = client.prepareDeleteByQuery(getIndexName()).setQuery(sqb);
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequestBuilder.request()

    public ResultMessage get(String messageId, String index) throws IndexMissingException, DocumentNotFoundException {
    GetRequestBuilder grb = new GetRequestBuilder(c, index);
    grb.setId(messageId);

    GetResponse r = c.get(grb.request()).actionGet();
   
    if (!r.isExists()) {
      throw new DocumentNotFoundException();
    }
   
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequestBuilder.request()

    IndexRequestBuilder indexRequestBuilder = factory.createIndexRequest(
        FAKE_CLIENT, indexPrefix, indexType, event);

    assertEquals(indexPrefix + '-'
        + ElasticSearchIndexRequestBuilderFactory.df.format(FIXED_TIME_MILLIS),
      indexRequestBuilder.request().index());
    assertEquals(indexType, indexRequestBuilder.request().type());
    assertArrayEquals(FakeEventSerializer.FAKE_BYTES,
        indexRequestBuilder.request().source().array());
  }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequestBuilder.request()

        srb.setSize(commandLineOptions.getBatchSize());
        srb.addField("_id");
        srb.addField("timestamp");
        srb.addField("_source");

        final SearchRequest request = srb.request();
        final SearchResponse response = client.search(request).actionGet();

        if (! commandLineOptions.isFix()) {
            LOG.warn("Not executing update because '-F' command line flag not given!");
        }
View Full Code Here

Examples of org.fusesource.stomp.client.BlockingConnection.request()

        final BlockingConnection subscribeConnection = stomp.connectBlocking();

        StompFrame frame = new StompFrame(SUBSCRIBE);
        frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
        frame.addHeader(ID, subscribeConnection.nextId());
        StompFrame response = subscribeConnection.request(frame);

        final CountDownLatch latch = new CountDownLatch(numberOfMessages);

        Thread thread = new Thread(new Runnable() {
            public void run() {
View Full Code Here

Examples of org.globus.gram.GramJob.request()

      log.info("Request to contact:" + contact);
      // The first boolean is to specify the job is a batch job - use true
      // for interactive and false for batch.
      // the second boolean is to specify to use the full proxy and not
      // delegate a limited proxy.
      job.request(contact, false, false);

      log.info("JobID = " + job.getIDAsString());

      // Gram.request(contact, job, false, false);
View Full Code Here

Examples of org.hornetq.api.core.client.ClientRequestor.request()

            ClientRequestor requestor = new ClientRequestor(managementSession, "jms.queue.hornetq.management");
            ClientMessage managementMessage = managementSession.createMessage(false);
            ManagementHelper.putAttribute(managementMessage, "core.queue." + queue, "ID");
            managementSession.start();
            HornetQServerLogger.LOGGER.debug("Requesting ID for: " + queue);
            ClientMessage reply = requestor.request(managementMessage);
            queueID = (Integer) ManagementHelper.getResult(reply);
            requestor.close();
            HornetQServerLogger.LOGGER.debug("ID for " + queue + " is: " + queueID);
            queueIDs.put(queue, queueID)// store it so we don't have to look it up every time
         }
View Full Code Here

Examples of org.jboss.resteasy.client.jaxrs.ResteasyWebTarget.request()

   @Test
   public void testBasic() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/test"));
      String val = target.request().get(String.class);
      Assert.assertEquals("hello world", val);
   }

   @Test
   public void testUnhandledException() throws Exception
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.