Skip to content

Commit

Permalink
#174: Added more JavaDoc for Java 17 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcatbear committed Nov 25, 2021
1 parent 2602016 commit 9231431
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class LogPatternDetector {

/**
* Check whether a certain pattern appears in a log message.
* <h2>Implementation notes</h2>
* <h4>Implementation notes</h4>
* <p>
* We use {@code find} to locate the log file(s) matching the filename search pattern. This {@code find} command
* then executes a command that searches the files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public class ContainerFileOperations {

private final ExasolContainer<? extends ExasolContainer<?>> container;

/**
* Creates a new instance of the {@link ContainerFileOperations}.
*
* @param container Container reference required executing commands inside the container.
*/
public ContainerFileOperations(final ExasolContainer<? extends ExasolContainer<?>> container) {
this.container = container;
}
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/exasol/containers/ExasolContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,6 @@ public int getDefaultInternalDatabasePort() {
}
}

public static class PortDetectionException extends UnsupportedOperationException {
private static final long serialVersionUID = -1871794026177194823L;

public PortDetectionException(final String service) {
super("Could not detect internal " + service + " port for custom image. "
+ "Please specify the port explicitly using withExposedPorts().");
}
}

@Override
public Set<Integer> getLivenessCheckPortNumbers() {
return Set.of(getFirstMappedDatabasePort());
Expand Down Expand Up @@ -495,6 +486,9 @@ protected void waitUntilContainerStarted() {
}
}

/**
* Wait for BucketFS to become operational.
*/
protected void waitForBucketFs() {
if (isServiceReady(BUCKETFS)) {
LOGGER.debug("BucketFS marked running in container status cache. Skipping startup monitoring.");
Expand All @@ -509,6 +503,9 @@ protected void waitForBucketFs() {
}
}

/**
* Wait until the UDF container is available.
*/
protected void waitForUdfContainer() {
if (isServiceReady(UDF)) {
LOGGER.debug("UDF Containter marked running in container status cache. Skipping startup monitoring.");
Expand Down Expand Up @@ -570,6 +567,9 @@ private void cacheContainerStatus() {
this.statusCache.write(this.getContainerId(), this.status);
}

/**
* Wait until we can read from the Exasol cluster configuration.
*/
protected void waitUntilClusterConfigurationAvailable() {
if (!this.reused) {
LOGGER.debug("Waiting for cluster configuration to become available.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,64 @@
* Constants for the Exasol Docker containers (like image ID and version).
*/
public final class ExasolContainerConstants {
/** Version of the Exasol Docker image */
public static final String EXASOL_DOCKER_IMAGE_VERSION = "7.1.1";

/** Reference name of the Exasol Docker image */
public static final String EXASOL_DOCKER_IMAGE_ID = "exasol/docker-db";

/** Complete Docker image reference */
public static final String EXASOL_DOCKER_IMAGE_REFERENCE = EXASOL_DOCKER_IMAGE_ID + ":"
+ EXASOL_DOCKER_IMAGE_VERSION;

/** Exasol initial administrator username */
public static final String DEFAULT_ADMIN_USER = "SYS";

// The following assignment intentionally contains the initial password for the database administrator.
// Keep in mind that this project deals with disposable containers that should only be used in integration tests.
/** Initial administrator password */
@SuppressWarnings("squid:S2068")
public static final String DEFAULT_SYS_USER_PASSWORD = "exasol";
@SuppressWarnings("squid:S1075") // This is the default URI where EXAConf is supposed to be located.

/** Default path of the central EXAConf configuration file. */
@SuppressWarnings("squid:S1075")
public static final String CLUSTER_CONFIGURATION_PATH = "/exa/etc/EXAConf";

/** Default path of all Exasol logs */
@SuppressWarnings("squid:S1075") // This is the parent directory of all logs in the Docker version of Exasol
public static final String EXASOL_LOGS_PATH = "/exa/logs";

/** Path to core daemon logs */
public static final String EXASOL_CORE_DAEMON_LOGS_PATH = EXASOL_LOGS_PATH + "/cored";

/** Reference name for the service used in the container factory */
public static final String NAME = "exasol";

/** JDBC main class */
public static final String JDBC_DRIVER_CLASS = "com.exasol.jdbc.EXADriver";

/** BucketFS log filename pattern */
public static final String BUCKETFS_DAEMON_LOG_FILENAME_PATTERN = "bucketfsd.*.log";

/** File extensions of supported (i.e. auto-expanded) archive formats in BucketFS */
public static final Set<String> SUPPORTED_ARCHIVE_EXTENSIONS = Set.of(".tar", ".tgz", ".tar.gz", ".zip");

/** Name of the property with which the docker image name can be overridden */
public static final String DOCKER_IMAGE_OVERRIDE_PROPERTY = "com.exasol.dockerdb.image";

/** Default database port for Exasol versions in Docker before 7.0 */
static final int DEFAULT_CONTAINER_INTERNAL_DATABASE_PORT = 8888;

/** Default database port for Exasol versions in Docker from 7.0 on */
static final int DEFAULT_CONTAINER_INTERNAL_DATABASE_PORT_V7_AND_ABOVE = 8563;

/** Default BucketFS port for Exasol versions in Docker before 7.0 */
static final int DEFAULT_CONTAINER_INTERNAL_BUCKETFS_PORT = 6583;

/** Default BucketFS port for Exasol versions in Docker from 7.0 on */
static final int DEFAULT_CONTAINER_INTERNAL_BUCKETFS_PORT_V7_AND_ABOVE = 2580;

/** Default RPC port for Exasol versions in Docker */
static final int DEFAULT_CONTAINER_INTERNAL_RPC_PORT = 443;

private ExasolContainerConstants() {
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/exasol/containers/PortDetectionException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.exasol.containers;

/**
* Exception for failed detection of service ports.
*/
public class PortDetectionException extends UnsupportedOperationException {
private static final long serialVersionUID = -1871794026177194823L;

/**
* Create a new instance of a {@link PortDetectionException}.
*
* @param service service for which the port could not be detected.
*/
public PortDetectionException(final String service) {
super("Could not detect internal " + service + " port for custom image. "
+ "Please specify the port explicitly using withExposedPorts().");
}
}
1 change: 1 addition & 0 deletions src/main/java/com/exasol/containers/exec/ExitCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Exit codes for in-container command execution.
*/
public final class ExitCode {
/** Exit code to signal successful completion */
public static final int OK = 0;

private ExitCode() {
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/exasol/containers/status/ServiceStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
* Status of a service (like BucketFs).
*/
public enum ServiceStatus implements Serializable {
NOT_READY, // service is no available yet
READY, // service can be used
NOT_CHECKED // service state has not yet been determined
/** service is no available yet */
NOT_READY,
/** service can be used */
READY,
/** service state has not yet been determined */
NOT_CHECKED
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ protected void waitUntilReady() {
+ this.detector.getActualLog() + "\"");
}

/**
* Get the timeout in milliseconds.
*
* @return timeout in milliseconds
*/
protected long getWaitTimeOutMilliseconds() {
return WAIT_DURATION_IN_MILLISECONDS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Strategy for waiting until the UDF language container is ready.
*/
public class UdfContainerWaitStrategy extends LogFileEntryWaitStrategy {
/** Pattern for detecting extraction of script language containers */
public static final String SCRIPT_LANGUAGE_CONTAINER_READY_PATTERN = "ScriptLanguages.*extracted$";
private static final long WAIT_FOR_UDF_CONTAINER_DURATION_IN_MILLISECONDS = TimeUnit.MINUTES.toMillis(10);
private static final Logger LOGGER = LoggerFactory.getLogger(UdfContainerWaitStrategy.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Manager for automatically applied workarounds for container version quirks.
*/
public class WorkaroundManager {
private static final Logger LOGGER = LoggerFactory.getLogger(WorkaroundManager.class);
private final Workaround[] workarounds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public DatabaseServiceException(final String databaseName, final String message,
this.databaseName = databaseName;
}

/**
* Create a new instance of a {@link DatabaseServiceException}.
*
* @param databaseName name of the affected database
* @param message error message
*/
public DatabaseServiceException(final String databaseName, final String message) {
super(message);
this.databaseName = databaseName;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/exasol/drivers/ExasolDriverManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ private void uploadManifest(final String manifest) {
}
}

/**
* Get a list of all installed drivers.
*
* @return list of installed drivers
*/
public Collection<DatabaseDriver> getDrivers() {
return this.installedDrivers.values();
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/exasol/drivers/JdbcDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public String getManifest() {
+ "INSERTSIZE=-1";
}

/**
* Builder for {@link JdbcDriver} instances.
*/
public static class Builder {
private final String name;
private String prefix;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/exasol/exaoperation/plugin/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* </p>
*/
public class Plugin {
/** Plugin package prefix */
public static final String PLUGIN_PACKAGE_PREFIX = "Plugin.";
private static final Logger LOGGER = LoggerFactory.getLogger(Plugin.class);
@SuppressWarnings("squid:S4784") // This is a test framework RegEx DoS attacks are unrealistic since this would mean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
* Manages getting support information (like cluster logs, configuration settings and core-dumps) from the database.
*/
public class SupportInformationRetriever {
/** Target directory where support information packages will be stored */
public static final String TARGET_DIRECTORY_PROPERTY = "com.exasol.containers.support_information_target_dir";
/** Name of the property that allows overriding the monitored container exit */
public static final String MONITORED_EXIT_PROPERTY = "com.exasol.containers.monitored_exit";
static final String SUPPORT_ARCHIVE_PREFIX = "exacluster_debuginfo_";
private static final String EXASUPPORT_EXECUTABLE = "exasupport";
Expand Down

0 comments on commit 9231431

Please sign in to comment.