public class FlinkContainer extends org.testcontainers.containers.GenericContainer<FlinkContainer> implements org.testcontainers.lifecycle.TestLifecycleAware
Modifier and Type | Class and Description |
---|---|
static class |
FlinkContainer.FlinkContainerBuilder
A builder for a
FlinkContainer . |
Modifier and Type | Field and Description |
---|---|
static int |
JOB_MANAGER_REST_PORT |
Modifier and Type | Method and Description |
---|---|
void |
afterTest(org.testcontainers.lifecycle.TestDescription description,
Optional<Throwable> throwable) |
void |
beforeTest(org.testcontainers.lifecycle.TestDescription description) |
static FlinkContainer.FlinkContainerBuilder |
builder() |
void |
checkExitCode(org.testcontainers.containers.Container.ExecResult execResult,
String... command) |
void |
copyFileOrDirectoryFromContainer(String containerPath,
Path hostDirectory)
Copies a container path to a local directory.
|
RestClusterClient<StandaloneClusterId> |
getRestClusterClient()
Get
RestClusterClient connected to this FlinkContainer. |
void |
restartTaskManager(RunnableWithException afterFailAction)
Restart all task managers.
|
void |
stop() |
void |
submitSQLJob(SQLJobSubmission job)
Submits a SQL job to the running cluster.
|
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, configure, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, succeeded, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning
public static final int JOB_MANAGER_REST_PORT
public void beforeTest(org.testcontainers.lifecycle.TestDescription description)
beforeTest
in interface org.testcontainers.lifecycle.TestLifecycleAware
public void afterTest(org.testcontainers.lifecycle.TestDescription description, Optional<Throwable> throwable)
afterTest
in interface org.testcontainers.lifecycle.TestLifecycleAware
public void stop()
stop
in interface org.testcontainers.lifecycle.Startable
stop
in class org.testcontainers.containers.GenericContainer<FlinkContainer>
public RestClusterClient<StandaloneClusterId> getRestClusterClient()
RestClusterClient
connected to this FlinkContainer.
This method lazily initializes the REST client on-demand.
public void copyFileOrDirectoryFromContainer(String containerPath, Path hostDirectory) throws IOException
GenericContainer.copyFileFromContainer(String, String)
it supports copying whole
directories. NOTE: The hostDirectory
should point to a destination directory.IOException
public void submitSQLJob(SQLJobSubmission job) throws IOException, InterruptedException
NOTE: You should not use '\t'
.
IOException
InterruptedException
public void restartTaskManager(RunnableWithException afterFailAction) throws Exception
afterFailAction
- Action to do between stopping and restarting task managersException
- If anything wrong happens during the restartpublic void checkExitCode(org.testcontainers.containers.Container.ExecResult execResult, String... command)
public static FlinkContainer.FlinkContainerBuilder builder()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.