Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class TimeSeriesIdFieldMapper.TimeSeriesIdBuilder
java.lang.Object
org.elasticsearch.index.mapper.TimeSeriesIdFieldMapper.TimeSeriesIdBuilder
- All Implemented Interfaces:
DocumentDimensions
- Enclosing class:
- TimeSeriesIdFieldMapper
public static class TimeSeriesIdFieldMapper.TimeSeriesIdBuilder
extends Object
implements DocumentDimensions
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.DocumentDimensions
DocumentDimensions.Noop
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBoolean
(String fieldName, boolean value) addIp
(String fieldName, InetAddress value) This overloaded method tries to take advantage of the fact that the UTF-8 value is already computed in some cases when we want to collect dimensions, so we can save re-computing the UTF-8 encoding.addUnsignedLong
(String fieldName, long value) Here we build the hash of the tsid using a similarity function so that we have a result with the following pattern: hash128(catenate(dimension field names)) + foreach(dimension field value, limit = MAX_DIMENSIONS) { hash32(dimension field value) } + hash128(catenate(dimension field values)) The idea is to be able to place 'similar' time series close to each other.validate
(IndexSettings settings) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.index.mapper.DocumentDimensions
addString
-
Field Details
-
MAX_DIMENSIONS
public static final int MAX_DIMENSIONS- See Also:
-
-
Constructor Details
-
TimeSeriesIdBuilder
-
-
Method Details
-
buildLegacyTsid
- Throws:
IOException
-
buildTsidHash
Here we build the hash of the tsid using a similarity function so that we have a result with the following pattern: hash128(catenate(dimension field names)) + foreach(dimension field value, limit = MAX_DIMENSIONS) { hash32(dimension field value) } + hash128(catenate(dimension field values)) The idea is to be able to place 'similar' time series close to each other. Two time series are considered 'similar' if they share the same dimensions (names and values). -
addString
Description copied from interface:DocumentDimensions
This overloaded method tries to take advantage of the fact that the UTF-8 value is already computed in some cases when we want to collect dimensions, so we can save re-computing the UTF-8 encoding.- Specified by:
addString
in interfaceDocumentDimensions
-
addIp
- Specified by:
addIp
in interfaceDocumentDimensions
-
addLong
- Specified by:
addLong
in interfaceDocumentDimensions
-
addUnsignedLong
- Specified by:
addUnsignedLong
in interfaceDocumentDimensions
-
addBoolean
- Specified by:
addBoolean
in interfaceDocumentDimensions
-
validate
- Specified by:
validate
in interfaceDocumentDimensions
-