Examples of TimeValue


Examples of org.elasticsearch.common.unit.TimeValue

  private static final long ES_SCROLL_KEEPALIVE = 60000;

  @Override
  public SearchRequestBuilder prepareESScrollSearchRequestBuilder(String indexName) {
    return client.prepareSearch(indexName).setScroll(new TimeValue(ES_SCROLL_KEEPALIVE)).setSearchType(SearchType.SCAN)
        .setSize(100);
  }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

    return searchRequestBuilder.execute().actionGet();
  }

  @Override
  public SearchResponse executeESScrollSearchNextRequest(SearchResponse scrollResp) {
    return client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(new TimeValue(ES_SCROLL_KEEPALIVE)).execute()
        .actionGet();
  }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        SimpleEngineBenchmark benchmark = new SimpleEngineBenchmark(store, engine)
                .numberOfContentItems(1000)
                .searcherThreads(50).searcherIterations(10000)
                .writerThreads(10).writerIterations(10000)
                .refreshSchedule(new TimeValue(1, TimeUnit.SECONDS))
                .flushSchedule(new TimeValue(1, TimeUnit.MINUTES))
                .create(false)
                .build();

        benchmark.run();
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        long iter = dataSize / BATCH_SIZE;
        for (long i = 0; i < iter; i++) {
            crc.update(data);
        }
        crc.getValue();
        System.out.println("CRC took " + new TimeValue(System.currentTimeMillis() - start));
    }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        long iter = dataSize / BATCH_SIZE;
        for (long i = 0; i < iter; i++) {
            crc.update(data);
        }
        crc.getValue();
        System.out.println("Adler took " + new TimeValue(System.currentTimeMillis() - start));
    }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        MessageDigest digest = Digest.getMd5Digest();
        for (long i = 0; i < iter; i++) {
            digest.update(data);
        }
        digest.digest();
        System.out.println("md5 took " + new TimeValue(System.currentTimeMillis() - start));
    }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));

        logger.info("--> creating alias1 ");
        assertThat(client2.admin().indices().prepareAliases().addAlias("test", "alias1").execute().actionGet().acknowledged(), equalTo(true));
        TimeValue timeout = TimeValue.timeValueSeconds(2);
        logger.info("--> recreating alias1 ");
        StopWatch stopWatch = new StopWatch();
        stopWatch.start();
        assertThat(client2.admin().indices().prepareAliases().addAlias("test", "alias1").setTimeout(timeout).execute().actionGet().acknowledged(), equalTo(true));
        assertThat(stopWatch.stop().lastTaskTime().millis(), lessThan(timeout.millis()));

        logger.info("--> modifying alias1 to have a filter");
        stopWatch.start();
        assertThat(client2.admin().indices().prepareAliases().addAlias("test", "alias1", termFilter("name", "foo")).setTimeout(timeout).execute().actionGet().acknowledged(), equalTo(true));
        assertThat(stopWatch.stop().lastTaskTime().millis(), lessThan(timeout.millis()));

        logger.info("--> recreating alias1 with the same filter");
        stopWatch.start();
        assertThat(client2.admin().indices().prepareAliases().addAlias("test", "alias1", termFilter("name", "foo")).setTimeout(timeout).execute().actionGet().acknowledged(), equalTo(true));
        assertThat(stopWatch.stop().lastTaskTime().millis(), lessThan(timeout.millis()));

        logger.info("--> recreating alias1 with a different filter");
        stopWatch.start();
        assertThat(client2.admin().indices().prepareAliases().addAlias("test", "alias1", termFilter("name", "bar")).setTimeout(timeout).execute().actionGet().acknowledged(), equalTo(true));
        assertThat(stopWatch.stop().lastTaskTime().millis(), lessThan(timeout.millis()));

        logger.info("--> verify that filter was updated");
        AliasMetaData aliasMetaData = ((InternalNode) node("server1")).injector().getInstance(ClusterService.class).state().metaData().aliases().get("alias1").get("test");
        assertThat(aliasMetaData.getFilter().toString(), equalTo("{\"term\":{\"name\":\"bar\"}}"));

        logger.info("--> deleting alias1");
        stopWatch.start();
        assertThat(client2.admin().indices().prepareAliases().removeAlias("test", "alias1").setTimeout(timeout).execute().actionGet().acknowledged(), equalTo(true));
        assertThat(stopWatch.stop().lastTaskTime().millis(), lessThan(timeout.millis()));

        logger.info("--> deleting alias1 one more time");
        stopWatch.start();
        assertThat(client2.admin().indices().prepareAliases().removeAlias("test", "alias1").setTimeout(timeout).execute().actionGet().acknowledged(), equalTo(true));
        assertThat(stopWatch.stop().lastTaskTime().millis(), lessThan(timeout.millis()));
    }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        List<DfsSearchResult> dfsResults = newArrayList();
        for (ShardIterator shardIt : clusterService.operationRouting().searchShards(clusterService.state(), new String[]{"test"}, new String[]{"test"}, null, null, null)) {
            for (ShardRouting shardRouting : shardIt.asUnordered()) {
                InternalSearchRequest searchRequest = searchRequest(shardRouting, sourceBuilder, SearchType.DFS_QUERY_THEN_FETCH)
                        .scroll(new Scroll(new TimeValue(10, TimeUnit.MINUTES)));
                dfsResults.add(nodeToSearchService.get(shardRouting.currentNodeId()).executeDfsPhase(searchRequest));
            }
        }

        AggregatedDfs dfs = searchPhaseController.aggregateDfs(dfsResults);
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        List<DfsSearchResult> dfsResults = newArrayList();
        for (ShardIterator shardIt : clusterService.operationRouting().searchShards(clusterService.state(), new String[]{"test"}, new String[]{"test"}, null, null, null)) {
            for (ShardRouting shardRouting : shardIt.asUnordered()) {
                InternalSearchRequest searchRequest = searchRequest(shardRouting, sourceBuilder, SearchType.DFS_QUERY_THEN_FETCH)
                        .scroll(new Scroll(new TimeValue(10, TimeUnit.MINUTES)));
                dfsResults.add(nodeToSearchService.get(shardRouting.currentNodeId()).executeDfsPhase(searchRequest));
            }
        }

        AggregatedDfs dfs = searchPhaseController.aggregateDfs(dfsResults);
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        // do this with dfs, since we have uneven distribution of docs between shards
        List<DfsSearchResult> dfsResults = newArrayList();
        for (ShardIterator shardIt : clusterService.operationRouting().searchShards(clusterService.state(), new String[]{"test"}, new String[]{"test"}, null, null, null)) {
            for (ShardRouting shardRouting : shardIt.asUnordered()) {
                InternalSearchRequest searchRequest = searchRequest(shardRouting, sourceBuilder, SearchType.QUERY_AND_FETCH)
                        .scroll(new Scroll(new TimeValue(10, TimeUnit.MINUTES)));
                dfsResults.add(nodeToSearchService.get(shardRouting.currentNodeId()).executeDfsPhase(searchRequest));
            }
        }

        AggregatedDfs dfs = searchPhaseController.aggregateDfs(dfsResults);
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.