Java Code Examples for org.elasticsearch.index.mapper.MappedFieldType#Names

The following examples show how to use org.elasticsearch.index.mapper.MappedFieldType#Names . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParentChildIndexFieldData.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public ParentChildIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames,
                                 FieldDataType fieldDataType, IndexFieldDataCache cache, MapperService mapperService,
                                 CircuitBreakerService breakerService) {
    super(index, indexSettings, fieldNames, fieldDataType, cache);
    this.breakerService = breakerService;
    if (Version.indexCreated(indexSettings).before(Version.V_2_0_0_beta1)) {
        parentTypes = new TreeSet<>();
        for (DocumentMapper documentMapper : mapperService.docMappers(false)) {
            beforeCreate(documentMapper);
        }
        mapperService.addTypeListener(this);
    } else {
        ImmutableSortedSet.Builder<String> builder = ImmutableSortedSet.naturalOrder();
        for (DocumentMapper mapper : mapperService.docMappers(false)) {
            ParentFieldMapper parentFieldMapper = mapper.parentFieldMapper();
            if (parentFieldMapper.active()) {
                builder.add(parentFieldMapper.type());
            }
        }
        parentTypes = builder.build();
    }
}
 
Example 2
Source File: IndexService.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void onCache(ShardId shardId, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, Accountable ramUsage) {
    if (shardId != null) {
        final IndexShard shard = indexService.shard(shardId.id());
        if (shard != null) {
            shard.fieldData().onCache(shardId, fieldNames, fieldDataType, ramUsage);
        }
    }
}
 
Example 3
Source File: IndexService.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void onRemoval(ShardId shardId, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, boolean wasEvicted, long sizeInBytes) {
    if (shardId != null) {
        final IndexShard shard = indexService.shard(shardId.id());
        if (shard != null) {
            shard.fieldData().onRemoval(shardId, fieldNames, fieldDataType, wasEvicted, sizeInBytes);
        }
    }
}
 
Example 4
Source File: ShardFieldData.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void onRemoval(ShardId shardId, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, boolean wasEvicted, long sizeInBytes) {
    if (wasEvicted) {
        evictionsMetric.inc();
    }
    if (sizeInBytes != -1) {
        totalMetric.dec(sizeInBytes);

        String keyFieldName = fieldNames.indexName();
        CounterMetric total = perFieldTotals.get(keyFieldName);
        if (total != null) {
            total.dec(sizeInBytes);
        }
    }
}
 
Example 5
Source File: InternalGlobalOrdinalsIndexFieldData.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
InternalGlobalOrdinalsIndexFieldData(Index index, Settings settings, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, AtomicOrdinalsFieldData[] segmentAfd, OrdinalMap ordinalMap, long memorySizeInBytes) {
    super(index, settings, fieldNames, fieldDataType, memorySizeInBytes);
    this.atomicReaders = new Atomic[segmentAfd.length];
    for (int i = 0; i < segmentAfd.length; i++) {
        atomicReaders[i] = new Atomic(segmentAfd[i], ordinalMap, i);
    }
}
 
Example 6
Source File: PackedArrayIndexFieldData.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public PackedArrayIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames,
                                 FieldDataType fieldDataType, IndexFieldDataCache cache, NumericType numericType,
                                 CircuitBreakerService breakerService) {
    super(index, indexSettings, fieldNames, fieldDataType, cache);
    Preconditions.checkNotNull(numericType);
    Preconditions.checkArgument(EnumSet.of(NumericType.BOOLEAN, NumericType.BYTE, NumericType.SHORT, NumericType.INT, NumericType.LONG).contains(numericType), getClass().getSimpleName() + " only supports integer types, not " + numericType);
    this.numericType = numericType;
    this.breakerService = breakerService;
}
 
Example 7
Source File: GeoPointArrayIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public GeoPointArrayIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames,
                                         FieldDataType fieldDataType, IndexFieldDataCache cache, CircuitBreakerService breakerService) {
    super(index, indexSettings, fieldNames, fieldDataType, cache);
    this.breakerService = breakerService;
}
 
Example 8
Source File: IndicesFieldDataCacheListener.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void onCache(ShardId shardId, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, Accountable fieldData) {
}
 
Example 9
Source File: FloatArrayIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public FloatArrayIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames,
                                FieldDataType fieldDataType, IndexFieldDataCache cache, CircuitBreakerService breakerService) {
    super(index, indexSettings, fieldNames, fieldDataType, cache);
    this.breakerService = breakerService;
}
 
Example 10
Source File: IndexIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
private IndexIndexFieldData(Index index, MappedFieldType.Names names) {
    super(index, Settings.EMPTY, names, new FieldDataType("string"), null, null);
    atomicFieldData = new IndexAtomicFieldData(index().name());
}
 
Example 11
Source File: PagedBytesIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public PagedBytesIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames,
                                FieldDataType fieldDataType, IndexFieldDataCache cache, CircuitBreakerService breakerService) {
    super(index, indexSettings, fieldNames, fieldDataType, cache, breakerService);
}
 
Example 12
Source File: AbstractIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public MappedFieldType.Names getFieldNames() {
    return this.fieldNames;
}
 
Example 13
Source File: AbstractIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public AbstractIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, IndexFieldDataCache cache) {
    super(index, indexSettings);
    this.fieldNames = fieldNames;
    this.fieldDataType = fieldDataType;
    this.cache = cache;
}
 
Example 14
Source File: DoubleArrayIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public DoubleArrayIndexFieldData(Index index, Settings indexSettings, MappedFieldType.Names fieldNames,
                                 FieldDataType fieldDataType, IndexFieldDataCache cache, CircuitBreakerService breakerService) {
    super(index, indexSettings, fieldNames, fieldDataType, cache);
    this.breakerService = breakerService;
}
 
Example 15
Source File: GlobalOrdinalsIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public MappedFieldType.Names getFieldNames() {
    return fieldNames;
}
 
Example 16
Source File: GlobalOrdinalsIndexFieldData.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
protected GlobalOrdinalsIndexFieldData(Index index, Settings settings, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, long memorySizeInBytes) {
    super(index, settings);
    this.fieldNames = fieldNames;
    this.fieldDataType = fieldDataType;
    this.memorySizeInBytes = memorySizeInBytes;
}
 
Example 17
Source File: IndicesFieldDataCache.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public IndexFieldDataCache buildIndexFieldDataCache(IndexFieldDataCache.Listener listener, Index index, MappedFieldType.Names fieldNames, FieldDataType fieldDataType) {
    return new IndexFieldCache(logger, cache, index, fieldNames, fieldDataType, indicesFieldDataCacheListener, listener);
}
 
Example 18
Source File: IndexFieldDataCache.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Called after the fielddata is unloaded
 */
void onRemoval(ShardId shardId, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, boolean wasEvicted, long sizeInBytes);
 
Example 19
Source File: IndexFieldDataCache.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Called after the fielddata is loaded during the cache phase
 */
void onCache(ShardId shardId, MappedFieldType.Names fieldNames, FieldDataType fieldDataType, Accountable ramUsage);
 
Example 20
Source File: IndexFieldData.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * The field name.
 */
MappedFieldType.Names getFieldNames();