Package org.elasticsearch.action.admin.indices.refresh

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequest


  }

  @Override
  public List<RefreshRequest> doCall(Index index) {
    return ImmutableList.of(
      new RefreshRequest()
        .force(false)
        .indices(index.getIndexName()));
  }
View Full Code Here


    refreshAction.setIndex(index);

    List<RefreshRequest> requests = refreshAction.call();
    assertThat(requests).hasSize(1);

    RefreshRequest request = requests.get(0);
    assertThat(request.indices()).containsOnly(TEST_INDEX.getIndexName());
    assertThat(request.force()).isFalse();
  }
View Full Code Here

            // shortcut when refreshing on system tables
            // or empty partitioned tables
            return Futures.immediateFuture(null);
        } else {
            final SettableFuture<Long> future = SettableFuture.create();
            RefreshRequest request = new RefreshRequest(indexNames);
            transportRefreshAction.execute(request, new ActionListener<RefreshResponse>() {
                @Override
                public void onResponse(RefreshResponse refreshResponse) {
                    future.set(null); // no row count
                }
View Full Code Here

    protected void refreshIndex() {
        refreshIndex(index);
    }

    protected void refreshIndex(String index) {
        getNode().client().admin().indices().refresh(new RefreshRequest(index)).actionGet();
    }
View Full Code Here

     * @param indices The indices to refresh. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
     * @return The refresh request
     * @see org.elasticsearch.client.IndicesAdminClient#refresh(org.elasticsearch.action.admin.indices.refresh.RefreshRequest)
     */
    public static RefreshRequest refreshRequest(String... indices) {
        return new RefreshRequest(indices);
    }
View Full Code Here

        controller.registerHandler(GET, "/{index}/_refresh", this);
    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        RefreshRequest refreshRequest = new RefreshRequest(Strings.splitStringByCommaToArray(request.param("index")));
        refreshRequest.listenerThreaded(false);
        refreshRequest.force(request.paramAsBoolean("force", refreshRequest.force()));
        refreshRequest.indicesOptions(IndicesOptions.fromRequest(request, refreshRequest.indicesOptions()));
        client.admin().indices().refresh(refreshRequest, new RestBuilderListener<RefreshResponse>(channel) {
            @Override
            public RestResponse buildResponse(RefreshResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
                buildBroadcastShardsHeader(builder, response);
View Full Code Here

    @Test
    public void testRefresh() {
        String refreshShardAction = RefreshAction.NAME + "[s]";
        interceptTransportActions(refreshShardAction);

        RefreshRequest refreshRequest = new RefreshRequest(randomIndicesOrAliases());
        internalCluster().clientNodeClient().admin().indices().refresh(refreshRequest).actionGet();

        clearInterceptedActions();
        assertSameIndices(refreshRequest, refreshShardAction);
    }
View Full Code Here

                                        logger.trace("[{}/{}] Delete by query shard failure reason: {}", failure.index(), failure.shardId(), failure.reason());
                                    }
                                }
                            }
                        }
                        refreshAction.execute(new RefreshRequest(request).indices(concreteIndices), new ActionListener<RefreshResponse>() {
                            @Override
                            public void onResponse(RefreshResponse refreshResponse) {
                                if (logger.isTraceEnabled()) {
                                    traceLogResponse("Refresh", refreshResponse);
                                }
View Full Code Here

    /**
     * Refresh an index
     * @param indexName
     */
    private static void refresh(String indexName) {
        IndexClient.client.admin().indices().refresh(new RefreshRequest(indexName)).actionGet();
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.refresh.RefreshRequest

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.