Skip to content

Commit

Permalink
[Javadocs] add to o.o.index and indices (#3209)
Browse files Browse the repository at this point in the history
Adds javadocs to org.opensearch.index and indices packages.

Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize authored May 5, 2022
1 parent 2fe2e37 commit 7b75fb4
Show file tree
Hide file tree
Showing 559 changed files with 1,896 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
import org.opensearch.common.logging.DeprecationLogger;
import org.opensearch.common.logging.Loggers;

/**
* A base class for new index components
*
* @opensearch.internal
*/
public abstract class AbstractIndexComponent implements IndexComponent {

protected final Logger logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

/**
* A composite {@link IndexEventListener} that forwards all callbacks to an immutable list of IndexEventListener
*
* @opensearch.internal
*/
final class CompositeIndexEventListener implements IndexEventListener {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/index/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

/**
* A value class representing the basic required properties of an OpenSearch index.
*
* @opensearch.internal
*/
public class Index implements Writeable, ToXContentObject {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/index/IndexComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.index;

/**
* Actions that can be executed on an Index Component
*
* @opensearch.internal
*/
public interface IndexComponent {

Index index();
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/index/IndexModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
* <li>Settings update listener - Custom settings update listener can be registered via
* {@link #addSettingsUpdateConsumer(Setting, Consumer)}</li>
* </ul>
*
* @opensearch.internal
*/
public final class IndexModule {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@

import java.io.IOException;

/**
* Exception thrown if an index is not found
*
* @opensearch.internal
*/
public final class IndexNotFoundException extends ResourceNotFoundException {
/**
* Construct with a custom message.
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/index/IndexService.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
import static java.util.Collections.unmodifiableMap;
import static org.opensearch.common.collect.MapBuilder.newMapBuilder;

/**
* The main OpenSearch index service
*
* @opensearch.internal
*/
public class IndexService extends AbstractIndexComponent implements IndicesClusterStateService.AllocatedIndex<IndexShard> {

private final IndexEventListener eventListener;
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/index/IndexSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
* the latest updated settings instance. Classes that need to listen to settings updates can register
* a settings consumer at index creation via {@link IndexModule#addSettingsUpdateConsumer(Setting, Consumer)} that will
* be called for each settings update.
*
* @opensearch.internal
*/
public final class IndexSettings {
public static final Setting<List<String>> DEFAULT_FIELD_SETTING = Setting.listSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
* </li>
* </ul>
*
* @opensearch.internal
**/
public final class IndexSortConfig {
/**
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/index/IndexWarmer.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;

/**
* The main opensearch index warmer
*
* @opensearch.internal
*/
public final class IndexWarmer {

private static final Logger logger = LogManager.getLogger(IndexWarmer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;

/**
* Tracks indexing memory pressure
*
* @opensearch.internal
*/
public class IndexingPressure {

public static final Setting<ByteSizeValue> MAX_INDEXING_BYTES = Setting.memorySizeSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/**
* Sets up classes for node/shard level indexing pressure.
* Provides abstraction and orchestration for indexing pressure interfaces when called from Transport Actions or for Stats.
*
* @opensearch.internal
*/
public class IndexingPressureService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
* The indexing slowlog implementation
*
* @opensearch.internal
*/
public final class IndexingSlowLog implements IndexingOperationListener {
public static final String INDEX_INDEXING_SLOWLOG_PREFIX = "index.indexing.slowlog";
public static final Setting<TimeValue> INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_WARN_SETTING = Setting.timeSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
* indices segments API to see the segments that an index has, and
* possibly either increase the <code>max_merged_segment</code> or issue an optimize
* call for the index (try and aim to issue it on a low traffic time).
*
* @opensearch.internal
*/

public final class MergePolicyConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
* throttled, while an application doing heavy indexing will see the throttle
* move higher to allow merges to keep up with ongoing indexing.
* </ul>
*
* @opensearch.internal
*/
public final class MergeSchedulerConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* Wrapper around {@link TieredMergePolicy} which doesn't respect
* {@link TieredMergePolicy#setMaxMergedSegmentMB(double)} on forced merges.
* See https://issues.apache.org/jira/browse/LUCENE-7976.
*
* @opensearch.internal
*/
final class OpenSearchTieredMergePolicy extends FilterMergePolicy {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/index/SearchSlowLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;

/**
* The search time slow log implementation
*
* @opensearch.internal
*/
public final class SearchSlowLog implements SearchOperationListener {
private static final Charset UTF_8 = Charset.forName("UTF-8");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
* 1. Memory Accounting at shard level. This can be enabled/disabled based on dynamic setting.
* 2. Memory Accounting at Node level. Tracking is done using the IndexingPressure artefacts to support feature seamless toggling.
* 3. Interfaces to access the statistics for shard trackers.
*
* @opensearch.internal
*/
public class ShardIndexingPressure extends IndexingPressure {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* goes above operating_factor.upper of current shard limits. MemoryManager attempts to update the new shard limit such that the new value
* remains withing the operating_factor.optimal range of current shard utilization.
*
* @opensearch.internal
*/
public class ShardIndexingPressureMemoryManager {
private static final Logger logger = LogManager.getLogger(ShardIndexingPressureMemoryManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* This class contains all the settings which are required and owned by {TODO link ShardIndexingPressure}. These will be
* referenced/used in ShardIndexingPressure, as well as its dependent components, i.e.
* {TODO link ShardIndexingPressureMemoryManager} and {TODO link ShardIndexingPressureStore}
*
* @opensearch.internal
*/
public final class ShardIndexingPressureSettings {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* update and evict operations can be abstracted out to support any other strategy such as LRU, if
* discovered a need later.
*
* @opensearch.internal
*/
public class ShardIndexingPressureStore {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* increase the complexity of handling shard-lister events and handling other race scenarios such as request-draining etc.
* To prefer simplicity we have modelled by keeping explicit fields for different operation tracking, while tracker by itself is
* agnostic of the actual shard role.
*
* @opensearch.internal
*/
public class ShardIndexingPressureTracker {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/index/SlowLogLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@

import java.util.Locale;

/**
* Levels for the slow logs
*
* @opensearch.internal
*/
public enum SlowLogLevel {
WARN(3), // most specific - little logging
INFO(2),
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/index/VersionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
import java.io.IOException;
import java.util.Locale;

/**
* Types of index versions
*
* @opensearch.internal
*/
public enum VersionType implements Writeable {
INTERNAL((byte) 0) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
import org.opensearch.index.AbstractIndexComponent;
import org.opensearch.index.IndexSettings;

/**
* Base character filter factory used in analysis chain
*
* @opensearch.internal
*/
public abstract class AbstractCharFilterFactory extends AbstractIndexComponent implements CharFilterFactory {

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
import org.opensearch.index.AbstractIndexComponent;
import org.opensearch.index.IndexSettings;

/**
* Base analyzer component
*
* @opensearch.internal
*/
public abstract class AbstractIndexAnalyzerProvider<T extends Analyzer> extends AbstractIndexComponent implements AnalyzerProvider<T> {

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
import org.opensearch.index.AbstractIndexComponent;
import org.opensearch.index.IndexSettings;

/**
* Base tokenfilter factory used in analysis chain
*
* @opensearch.internal
*/
public abstract class AbstractTokenFilterFactory extends AbstractIndexComponent implements TokenFilterFactory {

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
import org.opensearch.index.AbstractIndexComponent;
import org.opensearch.index.IndexSettings;

/**
* Base tokenizer factory used in analysis chain
*
* @opensearch.internal
*/
public abstract class AbstractTokenizerFactory extends AbstractIndexComponent implements TokenizerFactory {
private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@

import static java.util.Collections.unmodifiableMap;

/**
* Core analysis class
*
* @opensearch.internal
*/
public class Analysis {

public static CharArraySet parseStemExclusion(Settings settings, CharArraySet defaultStemExclusion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* Enum representing the mode in which token filters and analyzers are allowed to operate.
* While most token filters are allowed both in index and search time analyzers, some are
* restricted to be used only at index time, others at search time.
*
* @opensearch.internal
*/
public enum AnalysisMode {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
/**
* An internal registry for tokenizer, token filter, char filter and analyzer.
* This class exists per node and allows to create per-index {@link IndexAnalyzers} via {@link #build(IndexSettings)}
*
* @opensearch.internal
*/
public final class AnalysisRegistry implements Closeable {
public static final String INDEX_ANALYSIS_CHAR_FILTER = "index.analysis.char_filter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
/**
* A class that groups analysis components necessary to produce a custom analyzer.
* See {@link ReloadableCustomAnalyzer} for an example usage.
*
* @opensearch.internal
*/
public final class AnalyzerComponents {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

/**
* Analyzers that provide access to their token filters should implement this
*
* @opensearch.internal
*/
public interface AnalyzerComponentsProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
import org.apache.lucene.analysis.Analyzer;
import org.opensearch.common.inject.Provider;

/**
* Base interface for all analyzer providers
*
* @opensearch.internal
*/
public interface AnalyzerProvider<T extends Analyzer> extends Provider<T> {

String name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.index.analysis;

/**
* Enum to identify the scope of an analyzer
*
* @opensearch.internal
*/
public enum AnalyzerScope {
INDEX,
INDICES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@

import java.io.Reader;

/**
* Base character filter factory behavior used in analysis chain
*
* @opensearch.internal
*/
public interface CharFilterFactory {

String name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

import java.io.Reader;

/**
* Custom analyzer chain
*
* @opensearch.internal
*/
public final class CustomAnalyzer extends Analyzer implements AnalyzerComponentsProvider {

private final AnalyzerComponents components;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
/**
* A custom analyzer that is built out of a single {@link org.apache.lucene.analysis.Tokenizer} and a list
* of {@link org.apache.lucene.analysis.TokenFilter}s.
*
* @opensearch.internal
*/
public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider<Analyzer> {

Expand Down
Loading

0 comments on commit 7b75fb4

Please sign in to comment.