Examples of ESNode


Examples of org.openstreetmap.osmosis.plugin.elasticsearch.model.entity.ESNode

  /* FIND */

  @Test
  public void find() throws Exception {
    // Setup
    ESNode node = mock(ESNode.class);

    doReturn(Arrays.asList(node)).when(entityDao).findAll(ESNode.class, 1);

    // Action
    entityDao.find(ESNode.class, 1);
View Full Code Here

Examples of org.openstreetmap.osmosis.plugin.elasticsearch.model.entity.ESNode

  }

  @Test
  public void executeMultiGetRequest() {
    // Setup
    ESNode node1 = OsmDataBuilder.buildSampleESNode(1);
    ESNode node2 = OsmDataBuilder.buildSampleESNode(2);

    MultiGetRequestBuilder multiGetRequestBuilderMocked = mock(MultiGetRequestBuilder.class);

    ListenableActionFuture<MultiGetResponse> listenableActionFutureMocked = mock(ListenableActionFuture.class);
    when(multiGetRequestBuilderMocked.execute()).thenReturn(listenableActionFutureMocked);
View Full Code Here

Examples of org.openstreetmap.osmosis.plugin.elasticsearch.model.entity.ESNode

  protected void saveAllNodes(List<Node> nodes) {
    BulkRequestBuilder bulkRequest = client.prepareBulk();
    for (Node node : nodes) {
      try {
        ESNode esNode = ESNode.Builder.buildFromEntity(node);
        bulkRequest.add(client.prepareIndex(indexName, esNode.getEntityType().getIndiceName(), esNode.getIdString())
            .setSource(esNode.toJson()));
      } catch (Exception exception) {
        LOG.warning(String.format("Unable to add Entity %s to bulk request, cause: %s",
            node.getId(), exception.getMessage()));
      }
    }
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.