Skip to content

Commit

Permalink
[Javadocs] add to o.o.monitor,persistance,plugins,repo,script,threadp…
Browse files Browse the repository at this point in the history
…ool,usage,watcher (#3186) (#3309)

Adds javadocs to classes in the org.opensearch.monitor, persistence, plugins,
repository, script, threadpool, usage, and watcher packages.

Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize authored May 13, 2022
1 parent a37766e commit dea8011
Show file tree
Hide file tree
Showing 163 changed files with 499 additions and 6 deletions.
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/Assertions.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* Provides a static final field that can be used to check if assertions are enabled. Since this field might be used elsewhere to check if
* assertions are enabled, if you are running with assertions enabled for specific packages or classes, you should enable assertions on this
* class too (e.g., {@code -ea org.opensearch.Assertions -ea org.opensearch.cluster.service.MasterService}).
*
* @opensearch.internal
*/
public final class Assertions {

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

/**
* Information about a build of OpenSearch.
*
* @opensearch.internal
*/
public class Build {
/**
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/ExceptionsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
* Helper class for OpenSearch Exceptions
*
* @opensearch.internal
*/
public final class ExceptionsHelper {

private static final Logger logger = LogManager.getLogger(ExceptionsHelper.class);
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/LegacyESVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
*
* This class keeps all the supported OpenSearch predecessor versions for
* backward compatibility purpose.
*
* @opensearch.internal
*/
public class LegacyESVersion extends Version {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
/**
* This exception is thrown when OpenSearch detects
* an inconsistency in one of it's persistent files.
*
* @opensearch.internal
*/
public class OpenSearchCorruptionException extends IOException {

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

/**
* A base class for all opensearch exceptions.
*
* @opensearch.internal
*/
public class OpenSearchException extends RuntimeException implements ToXContentFragment, Writeable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* A generic exception indicating failure to generate.
*
*
* @opensearch.internal
*/
public class OpenSearchGenerationException extends OpenSearchException {

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

/**
* Unchecked exception that is translated into a {@code 400 BAD REQUEST} error when it bubbles out over HTTP.
*
* @opensearch.internal
*/
public class OpenSearchParseException extends OpenSearchException {

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

/**
* Generic security exception
*
* @opensearch.internal
*/
public class OpenSearchSecurityException extends OpenSearchStatusException {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
/**
* Exception who's {@link RestStatus} is arbitrary rather than derived. Used, for example, by reindex-from-remote to wrap remote exceptions
* that contain a status.
*
* @opensearch.internal
*/
public class OpenSearchStatusException extends OpenSearchException {
private final RestStatus status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* The same as {@link java.util.concurrent.TimeoutException} simply a runtime one.
*
*
* @opensearch.internal
*/
public class OpenSearchTimeoutException extends OpenSearchException {
public OpenSearchTimeoutException(StreamInput in) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* An exception that is meant to be "unwrapped" when sent back to the user
* as an error because its is {@link #getCause() cause}, if non-null is
* <strong>always</strong> more useful to the user than the exception itself.
*
* @opensearch.internal
*/
public interface OpenSearchWrapperException {
Throwable getCause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

import java.io.IOException;

/**
* Exception when Resources already exists
*
* @opensearch.internal
*/
public class ResourceAlreadyExistsException extends OpenSearchException {

public ResourceAlreadyExistsException(Index index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

/**
* Generic ResourceNotFoundException corresponding to the {@link RestStatus#NOT_FOUND} status code
*
* @opensearch.internal
*/
public class ResourceNotFoundException extends OpenSearchException {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/SpecialPermission.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
* ...
* );
* </code></pre>
*
* @opensearch.internal
*/
public final class SpecialPermission extends BasicPermission {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
import java.util.Locale;
import java.util.Objects;

/**
* OpenSearch Version Class
*
* @opensearch.api
*/
public class Version implements Comparable<Version>, ToXContentFragment {
/*
* The logic for ID is: XXYYZZAA, where XX is major version, YY is minor version, ZZ is revision, and AA is alpha/beta/rc indicator AA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@

import java.io.IOException;

/**
* The resource monitoring service
*
* @opensearch.internal
*/
public class MonitorService extends AbstractLifecycleComponent {

private final JvmGcMonitorService jvmGcMonitorService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.monitor;

/**
* The service for monitoring node health
*
* @opensearch.internal
*/
@FunctionalInterface
public interface NodeHealthService {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/Probes.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
import java.lang.management.OperatingSystemMXBean;
import java.lang.reflect.Method;

/**
* Probes the various resources
*
* @opensearch.internal
*/
public class Probes {
public static short getLoadAndScaleToPercent(Method method, OperatingSystemMXBean osMxBean) {
if (method != null) {
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/monitor/StatusInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
/**
* Class that represents the Health status for a node as determined by {@link NodeHealthService} and provides additional
* info explaining the reasons
*
* @opensearch.internal
*/
public class StatusInfo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
/**
* Runs periodically and attempts to create a temp file to see if the filesystem is writable. If not then it marks the
* path as unhealthy.
*
* @opensearch.internal
*/
public class FsHealthService extends AbstractLifecycleComponent implements NodeHealthService {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/fs/FsInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
import java.util.Iterator;
import java.util.Set;

/**
* FileSystem information
*
* @opensearch.internal
*/
public class FsInfo implements Iterable<FsInfo.Path>, Writeable, ToXContentFragment {

public static class Path implements Writeable, ToXContentObject {
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/fs/FsProbe.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
import java.util.Map;
import java.util.Set;

/**
* FileSystem probe
*
* @opensearch.internal
*/
public class FsProbe {

private static final Logger logger = LogManager.getLogger(FsProbe.class);
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/fs/FsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
import java.io.IOException;
import java.util.function.Supplier;

/**
* FileSystem service
*
* @opensearch.internal
*/
public class FsService {

private static final Logger logger = LogManager.getLogger(FsService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
import static java.util.Collections.unmodifiableMap;
import static java.util.Collections.unmodifiableSet;

/**
* Analyzes Operating System deadlocks
*
* @opensearch.internal
*/
public class DeadlockAnalyzer {

private static final Deadlock NULL_RESULT[] = new Deadlock[0];
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/jvm/GcNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.monitor.jvm;

/**
* Simple utility class for human readable GC names
*
* @opensearch.internal
*/
public class GcNames {

public static final String YOUNG = "young";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
import java.util.concurrent.TimeUnit;
import java.util.function.ToLongFunction;

/**
* Monitors hot threads
*
* @opensearch.internal
*/
public class HotThreads {

private static final Object mutex = new Object();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@

import static java.util.Collections.unmodifiableMap;

/**
* Service to monitor garbage collection
*
* @opensearch.internal
*/
public class JvmGcMonitorService extends AbstractLifecycleComponent {
private static final Logger logger = LogManager.getLogger(JvmGcMonitorService.class);

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
import java.util.List;
import java.util.Map;

/**
* Holds information about the JVM
*
* @opensearch.internal
*/
public class JvmInfo implements ReportingService.Info {

private static JvmInfo INSTANCE;
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.monitor.jvm;

/**
* JVM Process ID
*
* @opensearch.internal
*/
class JvmPid {

static long getPid() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
import org.opensearch.common.unit.TimeValue;
import org.opensearch.node.ReportingService;

/**
* Service for monitoring the JVM
*
* @opensearch.internal
*/
public class JvmService implements ReportingService<JvmInfo> {

private static final Logger logger = LogManager.getLogger(JvmService.class);
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
* Holds JVM statistics
*
* @opensearch.internal
*/
public class JvmStats implements Writeable, ToXContentFragment {

private static final RuntimeMXBean runtimeMXBean;
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/os/OsInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

import java.io.IOException;

/**
* Holds Operating System Information
*
* @opensearch.internal
*/
public class OsInfo implements ReportingService.Info {

private final long refreshInterval;
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/monitor/os/OsProbe.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
* - An error case retrieving these values from a linux kernel
* - A non-standard libc implementation not implementing the required values
* For a more exhaustive explanation, see https://github.com/elastic/elasticsearch/pull/42725
*
* @opensearch.internal
*/
public class OsProbe {

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

import java.io.IOException;

/**
* Service for the Operating System
*
* @opensearch.internal
*/
public class OsService implements ReportingService<OsInfo> {

private static final Logger logger = LogManager.getLogger(OsService.class);
Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/monitor/os/OsStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
import java.util.Arrays;
import java.util.Objects;

/**
* Holds stats for the Operating System
*
* @opensearch.internal
*/
public class OsStats implements Writeable, ToXContentFragment {

private final long timestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

import java.io.IOException;

/**
* Holds information for monitoring the process
*
* @opensearch.internal
*/
public class ProcessInfo implements ReportingService.Info {

private final long refreshInterval;
Expand Down
Loading

0 comments on commit dea8011

Please sign in to comment.