Skip to content

Commit

Permalink
[Javadocs] add to o.o.bootstrap, cli, and client (#3163)
Browse files Browse the repository at this point in the history
Adds javadocs to o.o.bootstrap, o.o.cli, and o.o.client packages.

Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize authored May 3, 2022
1 parent 1b2f154 commit c13b679
Show file tree
Hide file tree
Showing 38 changed files with 103 additions and 7 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ allprojects {
// see https://discuss.gradle.org/t/add-custom-javadoc-option-that-does-not-take-an-argument/5959
javadoc.options.encoding = 'UTF8'
javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet')
javadoc.options.tags = ["opensearch.internal", "opensearch.api", "opensearch.experimental"]
}

// support for reproducible builds
Expand Down Expand Up @@ -387,7 +388,7 @@ gradle.projectsEvaluated {
}
}
}

dependencies {
subprojects.findAll { it.pluginManager.hasPlugin('java') }.forEach {
testReportAggregation it
Expand All @@ -413,7 +414,7 @@ subprojects {
// eclipse configuration
allprojects {
apply plugin: 'eclipse'

// Name all the non-root projects after their path so that paths get grouped together when imported into eclipse.
if (path != ':') {
eclipse.project.name = path
Expand Down Expand Up @@ -573,12 +574,12 @@ subprojects {

reporting {
reports {
testAggregateTestReport(AggregateTestReport) {
testAggregateTestReport(AggregateTestReport) {
testType = TestSuiteType.UNIT_TEST
}
}
}

tasks.named(JavaBasePlugin.CHECK_TASK_NAME) {
dependsOn tasks.named('testAggregateTestReport', TestReport)
dependsOn tasks.named('testAggregateTestReport', TestReport)
}
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@

/**
* Internal startup code.
*
* @opensearch.internal
*/
final class Bootstrap {

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

/**
* Encapsulates a bootstrap check.
*
* @opensearch.internal
*/
public interface BootstrapCheck {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
* We enforce bootstrap checks once a node has the transport protocol bound to a non-loopback interface or if the system property {@code
* opensearch.enforce.bootstrap.checks} is set to {@true}. In this case we assume the node is running in production and
* all bootstrap checks must pass.
*
* @opensearch.internal
*/
final class BootstrapChecks {

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

/**
* Context that is passed to every bootstrap check to make decisions on.
*
* @opensearch.internal
*/
public class BootstrapContext {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
* these checked exceptions so that
* {@link Bootstrap#init(boolean, Path, boolean, org.opensearch.env.Environment)}
* does not have to declare all of these checked exceptions.
*
* @opensearch.internal
*/
class BootstrapException extends Exception {

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

/**
* Exposes system startup information
*
* @opensearch.internal
*/
@SuppressForbidden(reason = "exposes read-only view of system properties")
public final class BootstrapInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;

/**
* Settings used for bootstrapping OpenSearch
*
* @opensearch.internal
*/
public final class BootstrapSettings {

private BootstrapSettings() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.bootstrap;

/**
* Handler for ctrl events on the console
*
* @opensearch.internal
*/
public interface ConsoleCtrlHandler {

int CTRL_CLOSE_EVENT = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
import java.nio.file.Path;
import java.security.Permissions;

/**
* Utility for File Permissions during bootstrap
*
* @opensearch.internal
*/
public class FilePermissionUtils {

/** no instantiation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

/**
* java mapping to some libc functions
*
* @opensearch.internal
*/
final class JNACLibrary {

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

/**
* Library for Windows/Kernel32
*
* @opensearch.internal
*/
final class JNAKernel32Library {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/JNANatives.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
/**
* This class performs the actual work with JNA and library bindings to call native methods. It should only be used after
* we are sure that the JNA classes are available to the JVM
*
* @opensearch.internal
*/
class JNANatives {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/Natives.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
/**
* The Natives class is a wrapper class that checks if the classes necessary for calling native methods are available on
* startup. If they are not available, this class will avoid calling code that loads these classes.
*
* @opensearch.internal
*/
final class Natives {
/** no instantiation */
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/OpenSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

/**
* This class starts opensearch.
*
* @opensearch.internal
*/
class OpenSearch extends EnvironmentAwareCommand {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
import java.util.Map;
import java.util.function.Predicate;

/** custom policy for union of static and dynamic permissions */
/**
* custom policy for union of static and dynamic permissions
*
* @opensearch.internal
**/
final class OpenSearchPolicy extends Policy {

/** template policy file, the one used in tests */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
import java.security.AccessController;
import java.security.PrivilegedAction;

/**
* UncaughtException Handler used during bootstrapping
*
* @opensearch.internal
*/
class OpenSearchUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final Logger logger = LogManager.getLogger(OpenSearchUncaughtExceptionHandler.class);

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/Security.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
* </pre>
* See <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/security/troubleshooting-security.html">
* Troubleshooting Security</a> for information.
*
* @opensearch.internal
*/
final class Security {
/** no instantiation */
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/Spawner.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

/**
* Spawns native module controller processes if present. Will only work prior to a system call filter being installed.
*
* @opensearch.internal
*/
final class Spawner implements Closeable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* "reasonably". This means limits on stacktrace frames and
* cleanup for guice, and some guidance about consulting full
* logs for the whole exception.
*
* @opensearch.internal
*/
// TODO: remove this when guice is removed, and exceptions are cleaned up
// this is horrible, but its what we must do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
* https://reverse.put.as/wp-content/uploads/2011/06/The-Apple-Sandbox-BHDC2011-Paper.pdf</a>
* @see <a href="https://docs.oracle.com/cd/E23824_01/html/821-1456/prbac-2.html">
* https://docs.oracle.com/cd/E23824_01/html/821-1456/prbac-2.html</a>
*
* @opensearch.internal
*/
// not an example of how to write code!!!
final class SystemCallFilter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
/**
* Holder class for method to configure logging without OpenSearch configuration files for use in CLI tools that will not read such
* files.
*
* @opensearch.internal
*/
public final class CommandLoggingConfigurator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
import java.util.Locale;
import java.util.Map;

/** A cli command which requires an {@link org.opensearch.env.Environment} to use current paths and settings. */
/**
* A cli command which requires an {@link org.opensearch.env.Environment} to use current paths and settings.
*
* @opensearch.internal
*/
public abstract class EnvironmentAwareCommand extends Command {

private final OptionSpec<KeyValuePair> settingOption;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
/**
* An {@link org.opensearch.cli.EnvironmentAwareCommand} that needs to access the opensearch keystore, possibly
* decrypting it if it is password protected.
*
* @opensearch.internal
*/
public abstract class KeyStoreAwareCommand extends EnvironmentAwareCommand {
public KeyStoreAwareCommand(String description) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
/**
* A command that is aware of logging. This class should be preferred over the base {@link Command} class for any CLI tools that depend on
* core OpenSearch as they could directly or indirectly touch classes that touch logging and as such logging needs to be configured.
*
* @opensearch.internal
*/
public abstract class LoggingAwareCommand extends Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* A multi-command that is aware of logging. This class should be preferred over the base {@link MultiCommand} class for any CLI tools that
* depend on core OpenSearch as they could directly or indirectly touch classes that touch logging and as such logging needs to be
* configured.
*
* @opensearch.internal
*/
public abstract class LoggingAwareMultiCommand extends MultiCommand {

Expand Down
3 changes: 2 additions & 1 deletion server/src/main/java/org/opensearch/client/AdminClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
/**
* Administrative actions/operations against the cluster or the indices.
*
*
* @see org.opensearch.client.Client#admin()
*
* @opensearch.internal
*/
public interface AdminClient {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
* A client can be retrieved from a started {@link org.opensearch.node.Node}.
*
* @see org.opensearch.node.Node#client()
*
* @opensearch.internal
*/
public interface Client extends OpenSearchClient, Releasable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
* Administrative actions/operations against indices.
*
* @see AdminClient#cluster()
*
* @opensearch.internal
*/
public interface ClusterAdminClient extends OpenSearchClient {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/client/FilterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
* A {@link Client} that contains another {@link Client} which it
* uses as its basic source, possibly transforming the requests / responses along the
* way or providing additional functionality.
*
* @opensearch.internal
*/
public abstract class FilterClient extends AbstractClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
* Administrative actions/operations against indices.
*
* @see AdminClient#indices()
*
* @opensearch.internal
*/
public interface IndicesAdminClient extends OpenSearchClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
import org.opensearch.action.ActionResponse;
import org.opensearch.threadpool.ThreadPool;

/**
* Interface for an OpenSearch client implementation
*
* @opensearch.internal
*/
public interface OpenSearchClient {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
* {@link ThreadContext#stashWithOrigin origin} set to a particular
* value and calls its {@linkplain ActionListener} in its original
* {@link ThreadContext}.
*
* @opensearch.internal
*/
public final class OriginSettingClient extends FilterClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
/**
* A {@linkplain Client} that sets the parent task on all requests that it makes. Use this to conveniently implement actions that cause
* many other actions.
*
* @opensearch.internal
*/
public class ParentTaskAssigningClient extends FilterClient {
private final TaskId parentTask;
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/client/Requests.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@

/**
* A handy one stop shop for creating requests (make sure to import static this class).
*
* @opensearch.internal
*/
public class Requests {

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

/**
* Client that executes actions on the local node.
*
* @opensearch.internal
*/
public class NodeClient extends AbstractClient {

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

import java.util.Map;

/**
* Base client used to create concrete client implementations
*
* @opensearch.internal
*/
public abstract class AbstractClient implements Client {

protected final Logger logger;
Expand Down
Loading

0 comments on commit c13b679

Please sign in to comment.