- All Implemented Interfaces:
IndexMatcher
,SystemResourceDescriptor
DataStream
that is reserved for use by a system feature.
A system data stream is managed by the system and protected by the system against user modifications so that system features are not broken by inadvertent user operations.
Unlike a SystemIndexDescriptor
, a SystemDataStreamDescriptor does not take an index pattern. Rather, it derives the expected
backing index pattern from the data stream name.
A SystemDataStreamDescriptor defines a list of allowed product origins. If that list is empty, only system operations can read, write to, or modify the system data stream. If there are entries in the list, then a special request header must be used in any request that accesses the system data stream, either through plugin-provided APIs or through data stream APIs.
A SystemDataStreamDescriptor may be internal or external. If internal, the system feature must define APIs for interacting with the system data stream. If external, the system feature will allow use of the data stream API, assuming the correct permissions and product origin flag.
One interesting implementation detail is that the SystemDataStreamDescriptor manages its own templates for the data stream, so although they have names, they are never listed in the index template or component template APIs.
The descriptor also provides names for the thread pools that Elasticsearch should use to read, search, or modify the descriptor’s indices.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSystemDataStreamDescriptor
(String dataStreamName, String description, SystemDataStreamDescriptor.Type type, ComposableIndexTemplate composableIndexTemplate, Map<String, ComponentTemplate> componentTemplates, List<String> allowedElasticProductOrigins, String origin, ExecutorNames executorNames) Creates a new descriptor for a system data descriptor -
Method Summary
Modifier and TypeMethodDescriptionRequests from these products, if made with the proper security credentials, are allowed non-deprecated access to this descriptor's indices.getBackingIndexNames
(Metadata metadata) Retrieve backing indices for this system data streamgetMatchingIndices
(Metadata metadata) Retrieves a list of all indices which match this descriptor's pattern.Get an origin string suitable for use in anOriginSettingClient
.Get the names of the thread pools that should be used for operations on this data stream.boolean
boolean
-
Constructor Details
-
SystemDataStreamDescriptor
public SystemDataStreamDescriptor(String dataStreamName, String description, SystemDataStreamDescriptor.Type type, ComposableIndexTemplate composableIndexTemplate, Map<String, ComponentTemplate> componentTemplates, List<String> allowedElasticProductOrigins, String origin, ExecutorNames executorNames) Creates a new descriptor for a system data descriptor- Parameters:
dataStreamName
- the name of the data stream. Must not benull
description
- a brief description of what the data stream is used for. Must not benull
type
- theSystemDataStreamDescriptor.Type
of the data stream which determines how the data stream can be accessed. Must not benull
composableIndexTemplate
- theComposableIndexTemplate
that contains the mappings and settings for the data stream. Must not benull
componentTemplates
- a map that containsComponentTemplate
instances corresponding to those references in theComposableIndexTemplate
allowedElasticProductOrigins
- a list of product origin values that are allowed to access this data stream if the type isSystemDataStreamDescriptor.Type.EXTERNAL
. Must not benull
origin
- specifies the origin to use when creating or updating the data streamexecutorNames
- thread pools that should be used for operations on the system data stream
-
-
Method Details
-
getDataStreamName
-
getBackingIndexNames
Retrieve backing indices for this system data stream- Parameters:
metadata
- Metadata in which to look for indices- Returns:
- List of names of backing indices
-
getMatchingIndices
Description copied from interface:IndexMatcher
Retrieves a list of all indices which match this descriptor's pattern. Implementations may include other special information when matching indices, such as aliases.This cannot be done via
IndexNameExpressionResolver
because that class can only handle simple wildcard expressions, but system index name patterns may use full Lucene regular expression syntax.- Specified by:
getMatchingIndices
in interfaceIndexMatcher
- Parameters:
metadata
- The current metadata to get the list of matching indices from- Returns:
- A list of index names that match this descriptor
-
getDescription
- Specified by:
getDescription
in interfaceSystemResourceDescriptor
- Returns:
- A short description of the purpose of this system resource.
-
getComposableIndexTemplate
-
getOrigin
Description copied from interface:SystemResourceDescriptor
Get an origin string suitable for use in anOriginSettingClient
. SeeSystemIndexDescriptor.Builder.setOrigin(String)
for more information.- Specified by:
getOrigin
in interfaceSystemResourceDescriptor
- Returns:
- an origin string to use for sub-requests
-
isAutomaticallyManaged
public boolean isAutomaticallyManaged()- Specified by:
isAutomaticallyManaged
in interfaceSystemResourceDescriptor
-
isExternal
public boolean isExternal()- Specified by:
isExternal
in interfaceSystemResourceDescriptor
-
getBackingIndexPattern
-
getAllowedElasticProductOrigins
Description copied from interface:SystemResourceDescriptor
Requests from these products, if made with the proper security credentials, are allowed non-deprecated access to this descriptor's indices. (Product names may be specified in requests with theTask.X_ELASTIC_PRODUCT_ORIGIN_HTTP_HEADER
).- Specified by:
getAllowedElasticProductOrigins
in interfaceSystemResourceDescriptor
- Returns:
- A list of product names.
-
getComponentTemplates
-
getThreadPoolNames
Get the names of the thread pools that should be used for operations on this data stream.- Specified by:
getThreadPoolNames
in interfaceSystemResourceDescriptor
- Returns:
- Names for get, search, and write executors.
-