Examples of TimeValue


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.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

        Map<SearchShardTarget, QueryFetchSearchResult> queryFetchResults = newHashMap();
        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)));
                QueryFetchSearchResult queryFetchResult = nodeToSearchService.get(shardRouting.currentNodeId()).executeFetchPhase(searchRequest);
                queryFetchResults.put(queryFetchResult.shardTarget(), queryFetchResult);
            }
        }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        Map<SearchShardTarget, QuerySearchResultProvider> queryResults = newHashMap();
        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_THEN_FETCH)
                        .scroll(new Scroll(new TimeValue(10, TimeUnit.MINUTES)));
                QuerySearchResult queryResult = nodeToSearchService.get(shardRouting.currentNodeId()).executeQueryPhase(searchRequest);
                queryResults.put(queryResult.shardTarget(), queryResult);
            }
        }
        ShardDoc[] sortedShardList = searchPhaseController.sortDocs(queryResults.values());
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

            double percent = Double.parseDouble(size.substring(0, size.length() - 1));
            sizeInBytes = (long) ((percent / 100) * JvmInfo.jvmInfo().getMem().getHeapMax().bytes());
        } else {
            sizeInBytes = ByteSizeValue.parseBytesSizeValue(size).bytes();
        }
        TimeValue catchupTime = componentSettings.getAsTime("catchup", TimeValue.timeValueSeconds(10));

        int weightedSize = (int) Math.min(sizeInBytes / AbstractWeightedFilterCache.FilterCacheValueWeigher.FACTOR, Integer.MAX_VALUE);

        cache = new ConcurrentLinkedHashMap.Builder<AbstractWeightedFilterCache.FilterCacheKey, FilterCacheValue<DocSet>>()
                .maximumWeightedCapacity(weightedSize)
                .weigher(new AbstractWeightedFilterCache.FilterCacheValueWeigher())
                .listener(this)
                .catchup(threadPool.scheduler(), catchupTime.millis(), TimeUnit.MILLISECONDS)
                .build();

        logger.debug("using [node] filter cache with size [{}]", new ByteSizeValue(sizeInBytes));
    }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

    }

    class ApplySettings implements IndexSettingsService.Listener {
        @Override public void onRefreshSettings(Settings settings) {
            int maxSize = settings.getAsInt("index.cache.filter.max_size", SoftFilterCache.this.maxSize);
            TimeValue expire = settings.getAsTime("index.cache.filter.expire", SoftFilterCache.this.expire);
            boolean changed = false;
            if (maxSize != SoftFilterCache.this.maxSize) {
                logger.info("updating index.cache.filter.max_size from [{}] to [{}]", SoftFilterCache.this.maxSize, maxSize);
                changed = true;
                SoftFilterCache.this.maxSize = maxSize;
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

    }

    class ApplySettings implements IndexSettingsService.Listener {
        @Override public void onRefreshSettings(Settings settings) {
            int maxSize = settings.getAsInt("index.cache.filter.max_size", WeakFilterCache.this.maxSize);
            TimeValue expire = settings.getAsTime("index.cache.filter.expire", WeakFilterCache.this.expire);
            boolean changed = false;
            if (maxSize != WeakFilterCache.this.maxSize) {
                logger.info("updating index.cache.filter.max_size from [{}] to [{}]", WeakFilterCache.this.maxSize, maxSize);
                changed = true;
                WeakFilterCache.this.maxSize = maxSize;
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

            @Override public String executor() {
                return ThreadPool.Names.CACHED;
            }

            @Override public void messageReceived(StringMessage request, TransportChannel channel) {
                TimeValue sleep = TimeValue.parseTimeValue(request.message, null);
                try {
                    Thread.sleep(sleep.millis());
                } catch (InterruptedException e) {
                    // ignore
                }
                try {
                    channel.sendResponse(new StringMessage("hello " + request.message));
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

         * Get the Process cpu user time.
         *
         * <p>Supported Platforms: All.
         */
        public TimeValue user() {
            return new TimeValue(user);
        }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

         * Get the Process cpu time (sum of User and Sys).
         *
         * Supported Platforms: All.
         */
        public TimeValue total() {
            return new TimeValue(total);
        }
View Full Code Here

Examples of org.elasticsearch.common.unit.TimeValue

        executors.put(Names.SNAPSHOT, build(Names.SNAPSHOT, "scaling", groupSettings.get(Names.SNAPSHOT), ImmutableSettings.Builder.EMPTY_SETTINGS));
        executors.put(Names.SAME, MoreExecutors.sameThreadExecutor());
        this.executors = ImmutableMap.copyOf(executors);
        this.scheduler = Executors.newScheduledThreadPool(1, EsExecutors.daemonThreadFactory(settings, "[scheduler]"));

        TimeValue estimatedTimeInterval = componentSettings.getAsTime("estimated_time_interval", TimeValue.timeValueMillis(200));
        this.estimatedTimeThread = new EstimatedTimeThread(EsExecutors.threadName(settings, "[timer]"), estimatedTimeInterval.millis());
        this.estimatedTimeThread.start();
    }
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.