-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Vs refactor javadoc and comment cleanup #53427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
25e5ee1
e58ad9a
9e626e7
131e938
642d472
686d2de
f720220
b71862a
39c1789
66c704d
1fd7aec
96a99be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,10 +26,16 @@ | |
| import java.util.function.LongSupplier; | ||
|
|
||
| /** | ||
| * ValuesSourceType wraps the creation of specific per-source instances each {@link ValuesSource} needs to provide. Every top-level | ||
| * subclass of {@link ValuesSource} should have a corresponding implementation of this interface. In general, new data types seeking | ||
| * aggregation support should create a top level {@link ValuesSource}, then implement this to return wrappers for the specific sources of | ||
| * values. | ||
| * {@link ValuesSourceType}s are the quantum unit of aggregations support. {@link org.elasticsearch.index.mapper.MappedFieldType}s that | ||
|
||
| * allow aggregations map to exactly one ValuesSourceType, although multiple field types can map to the same ValuesSourceType. Aggregations | ||
| * in turn provide a set of ValuesSourceTypes they can operate on. ValuesSourceTypes in turn map to a single direct sub-class of | ||
| * {@link ValuesSource} (e.g. {@link ValuesSource.Numeric}; note that a given ValuesSourceType can yield different sub-sub-classes, e.g. | ||
| * {@link ValuesSource.Numeric.WithScript}, depending on the configuration). Note that it's possible that two different ValuesSourceTypes | ||
| * will yield the same ValuesSource subclass. This typically happens when the underlying representation is shared, but logically the data | ||
| * are different, such as with numbers and dates. | ||
| * | ||
| * ValuesSourceTypes should be stateless, and thus immutable. We recommend that plugins define an enum for their ValuesSourceTypes, even | ||
|
||
| * if the plugin only intends to define one ValuesSourceType. ValuesSourceTypes are not serialized as part of the aggregations framework. | ||
| */ | ||
| public interface ValuesSourceType { | ||
| /** | ||
|
|
@@ -66,11 +72,11 @@ public interface ValuesSourceType { | |
| * @param valuesSource - The original {@link ValuesSource} | ||
| * @param rawMissing - The missing value we got from the parser, typically a string or number | ||
| * @param docValueFormat - The format to use for further parsing the user supplied value, e.g. a date format | ||
| * @param now - Used in conjunction with the formatter, should return the current time in milliseconds | ||
| * @param nowSupplier - Used in conjunction with the formatter, should return the current time in milliseconds | ||
| * @return - Wrapper over the provided {@link ValuesSource} to apply the given missing value | ||
| */ | ||
| ValuesSource replaceMissing(ValuesSource valuesSource, Object rawMissing, DocValueFormat docValueFormat, | ||
| LongSupplier now); | ||
| LongSupplier nowSupplier); | ||
|
|
||
| /** | ||
| * This method provides a hook for specifying a type-specific formatter. When {@link ValuesSourceConfig} can resolve a | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| /** | ||
| * The Aggregations Support package holds shared code for the aggregations framework, especially around dealing with values. | ||
|
||
| * | ||
| * Key Classes | ||
|
||
| * | ||
| * {@link org.elasticsearch.search.aggregations.support.ValuesSource} and its subclasses | ||
|
||
| * These are thin wrappers which provide a unified interface to different ways of getting input data (e.g. DocValues from Lucene, or script | ||
| * output). A class hierarchy defines the type of values returned by the source. The top level sub-classes define type-specific behavior, | ||
| * such as {@link org.elasticsearch.search.aggregations.support.ValuesSource.Numeric#isFloatingPoint()}. Second level subclasses are | ||
| * then specialized based on where they read values from, e.g. script or field cases. There are also adapter classes like | ||
| * {@link org.elasticsearch.search.aggregations.bucket.geogrid.CellIdSource} which do run-time conversion from one type to another, often | ||
| * dependent on a user specified parameter (precision in that case). | ||
| * | ||
| * {@link org.elasticsearch.search.aggregations.support.ValuesSourceRegistry} | ||
| * ValuesSourceRegistry stores the mappings for what types are supported by what aggregations. It is configured once during startup, when | ||
|
||
| * {@link org.elasticsearch.search.SearchModule} is configuring aggregations. It shouldn't be necessary to access the registry in most | ||
| * cases, but you can get a read copy from {@link org.elasticsearch.index.query.QueryShardContext#getValuesSourceRegistry()} if necessary. | ||
| * | ||
| * {@link org.elasticsearch.search.aggregations.support.ValuesSourceType} | ||
| * ValuesSourceTypes are the quantum of support in the aggregations framework, and provide a common language between fields and | ||
| * aggregations. Fields which support aggregation override {@link org.elasticsearch.index.mapper.MappedFieldType#getValuesSourceType()} to | ||
| * return a compatible VaulesSourceType (based on how the field is stored), and aggregations register what types they support via one of the | ||
| * {@link org.elasticsearch.search.aggregations.support.ValuesSourceRegistry#register} methods. The VaulesSourceType itself holds | ||
| * information on how to with values of that type, including methods for creating | ||
| * {@link org.elasticsearch.search.aggregations.support.ValuesSource} instances and {@link org.elasticsearch.search.DocValueFormat} | ||
| * instances. | ||
| * | ||
| * {@link org.elasticsearch.search.aggregations.support.ValuesSourceConfig} | ||
| * There are two things going on in ValuesSourceConfig. First, there is a collection of static factory methods to build valid configs for | ||
| * different situations. {@link org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder#resolveConfig} has a good | ||
| * default for what to call here and generally aggregations shouldn't need to deviate from that. | ||
| * | ||
| * Once properly constructed, the ValuesSourceConfig provides access to the ValuesSource instance, as well as related information like the | ||
| * formatter. Aggregations are free to use this information as needed, such as Max and Min which inspect the field context to see if they | ||
| * can apply an optimization. | ||
| * | ||
| * Classes we are trying to phase out | ||
| * {@link org.elasticsearch.search.aggregations.support.ValueType} | ||
| * This class is primarily used for parsing user type hints, and is deprecated for new use. Work is ongoing to remove it from existing | ||
| * code. | ||
| * | ||
| */ | ||
| package org.elasticsearch.search.aggregations.support; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure what you mean by place holder. Like, you mean that we'll replace it with another one later? Does this interface just exist to mark things that the registry can handle?