Package org.elasticsearch.index.fielddata

Examples of org.elasticsearch.index.fielddata.IndexFieldDataService


                .build(), testingThreadPool);
    }

    public static MapperService newMapperService(Index index, Settings indexSettings, ThreadPool testingThreadPool) {
        NoneCircuitBreakerService circuitBreakerService = new NoneCircuitBreakerService();
        return new MapperService(index, indexSettings, new Environment(), newAnalysisService(), new IndexFieldDataService(index, ImmutableSettings.Builder.EMPTY_SETTINGS,
                new IndicesFieldDataCache(ImmutableSettings.Builder.EMPTY_SETTINGS, new IndicesFieldDataCacheListener(circuitBreakerService), testingThreadPool),
                circuitBreakerService),
                new PostingsFormatService(index), new DocValuesFormatService(index), newSimilarityLookupService(), null);
    }
View Full Code Here


    protected AtomicReaderContext readerContext;
    private IndexWriter writer;

    @Before
    public void prepare() throws Exception {
        ifd = new IndexFieldDataService(new Index("test"), new NoneCircuitBreakerService());
        ifd.setIndexService(new StubIndexService(null));

        MapperService mapperService = mock(MapperService.class);
        FieldMapper fieldMapper = mock(FieldMapper.class);
        when(fieldMapper.names()).thenReturn(fieldName());
View Full Code Here

                        continue;
                    }
                    warmUpGlobalOrdinals.put(indexName, fieldMapper);
                }
            }
            final IndexFieldDataService indexFieldDataService = indexShard.indexFieldDataService();
            final Executor executor = threadPool.executor(executor());
            final CountDownLatch latch = new CountDownLatch(warmUpGlobalOrdinals.size());
            for (final FieldMapper<?> fieldMapper : warmUpGlobalOrdinals.values()) {
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            final long start = System.nanoTime();
                            IndexFieldData.Global ifd = indexFieldDataService.getForField(fieldMapper);
                            ifd.loadGlobal(context.reader());
                            if (indexShard.warmerService().logger().isTraceEnabled()) {
                                indexShard.warmerService().logger().trace("warmed global ordinals for [{}], took [{}]", fieldMapper.names().name(), TimeValue.timeValueNanos(System.nanoTime() - start));
                            }
                        } catch (Throwable t) {
View Full Code Here

                        continue;
                    }
                    warmUp.put(indexName, fieldMapper);
                }
            }
            final IndexFieldDataService indexFieldDataService = indexShard.indexFieldDataService();
            final Executor executor = threadPool.executor(executor());
            final CountDownLatch latch = new CountDownLatch(context.searcher().reader().leaves().size() * warmUp.size());
            for (final LeafReaderContext ctx : context.searcher().reader().leaves()) {
                for (final FieldMapper<?> fieldMapper : warmUp.values()) {
                    executor.execute(new Runnable() {

                        @Override
                        public void run() {
                            try {
                                final long start = System.nanoTime();
                                indexFieldDataService.getForField(fieldMapper).load(ctx);
                                if (indexShard.warmerService().logger().isTraceEnabled()) {
                                    indexShard.warmerService().logger().trace("warmed fielddata for [{}], took [{}]", fieldMapper.names().name(), TimeValue.timeValueNanos(System.nanoTime() - start));
                                }
                            } catch (Throwable t) {
                                indexShard.warmerService().logger().warn("failed to warm-up fielddata for [{}]", t, fieldMapper.names().name());
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.fielddata.IndexFieldDataService

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.