Class Runnable (0.49.0)

public final class Runnable extends GeneratedMessageV3 implements RunnableOrBuilder

Runnable describes instructions for executing a specific script or container as part of a Task.

Protobuf type google.cloud.batch.v1alpha.Runnable

Implements

RunnableOrBuilder

Static Fields

ALWAYS_RUN_FIELD_NUMBER

public static final int ALWAYS_RUN_FIELD_NUMBER
Field Value
Type Description
int

BACKGROUND_FIELD_NUMBER

public static final int BACKGROUND_FIELD_NUMBER
Field Value
Type Description
int

BARRIER_FIELD_NUMBER

public static final int BARRIER_FIELD_NUMBER
Field Value
Type Description
int

CONTAINER_FIELD_NUMBER

public static final int CONTAINER_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

ENVIRONMENT_FIELD_NUMBER

public static final int ENVIRONMENT_FIELD_NUMBER
Field Value
Type Description
int

IGNORE_EXIT_STATUS_FIELD_NUMBER

public static final int IGNORE_EXIT_STATUS_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

SCRIPT_FIELD_NUMBER

public static final int SCRIPT_FIELD_NUMBER
Field Value
Type Description
int

TIMEOUT_FIELD_NUMBER

public static final int TIMEOUT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Runnable getDefaultInstance()
Returns
Type Description
Runnable

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Runnable.Builder newBuilder()
Returns
Type Description
Runnable.Builder

newBuilder(Runnable prototype)

public static Runnable.Builder newBuilder(Runnable prototype)
Parameter
Name Description
prototype Runnable
Returns
Type Description
Runnable.Builder

parseDelimitedFrom(InputStream input)

public static Runnable parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Runnable
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Runnable parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Runnable
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Runnable parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Runnable
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Runnable parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Runnable
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Runnable parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Runnable
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Runnable parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Runnable
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Runnable parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Runnable
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Runnable parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Runnable
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Runnable parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Runnable
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Runnable parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Runnable
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Runnable parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Runnable
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Runnable parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Runnable
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Runnable> parser()
Returns
Type Description
Parser<Runnable>

Methods

containsLabels(String key)

public boolean containsLabels(String key)

Labels for this Runnable.

map<string, string> labels = 9;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAlwaysRun()

public boolean getAlwaysRun()

By default, after a Runnable fails, no further Runnable are executed. This flag indicates that this Runnable must be run even if the Task has already failed. This is useful for Runnables that copy output files off of the VM or for debugging.

The always_run flag does not override the Task's overall max_run_duration. If the max_run_duration has expired then no further Runnables will execute, not even always_run Runnables.

bool always_run = 5;

Returns
Type Description
boolean

The alwaysRun.

getBackground()

public boolean getBackground()

Normally, a runnable that doesn't exit causes its task to fail. However, you can set this field to true to configure a background runnable. Background runnables are allowed continue running in the background while the task executes subsequent runnables. For example, background runnables are useful for providing services to other runnables or providing debugging-support tools like SSH servers.

Specifically, background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as task failures.

bool background = 4;

Returns
Type Description
boolean

The background.

getBarrier()

public Runnable.Barrier getBarrier()

Barrier runnable.

.google.cloud.batch.v1alpha.Runnable.Barrier barrier = 6;

Returns
Type Description
Runnable.Barrier

The barrier.

getBarrierOrBuilder()

public Runnable.BarrierOrBuilder getBarrierOrBuilder()

Barrier runnable.

.google.cloud.batch.v1alpha.Runnable.Barrier barrier = 6;

Returns
Type Description
Runnable.BarrierOrBuilder

getContainer()

public Runnable.Container getContainer()

Container runnable.

.google.cloud.batch.v1alpha.Runnable.Container container = 1;

Returns
Type Description
Runnable.Container

The container.

getContainerOrBuilder()

public Runnable.ContainerOrBuilder getContainerOrBuilder()

Container runnable.

.google.cloud.batch.v1alpha.Runnable.Container container = 1;

Returns
Type Description
Runnable.ContainerOrBuilder

getDefaultInstanceForType()

public Runnable getDefaultInstanceForType()
Returns
Type Description
Runnable

getDisplayName()

public String getDisplayName()

Optional. DisplayName is an optional field that can be provided by the caller. If provided, it will be used in logs and other outputs to identify the script, making it easier for users to understand the logs. If not provided the index of the runnable will be used for outputs.

string display_name = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Optional. DisplayName is an optional field that can be provided by the caller. If provided, it will be used in logs and other outputs to identify the script, making it easier for users to understand the logs. If not provided the index of the runnable will be used for outputs.

string display_name = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for displayName.

getEnvironment()

public Environment getEnvironment()

Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).

.google.cloud.batch.v1alpha.Environment environment = 7;

Returns
Type Description
Environment

The environment.

getEnvironmentOrBuilder()

public EnvironmentOrBuilder getEnvironmentOrBuilder()

Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).

.google.cloud.batch.v1alpha.Environment environment = 7;

Returns
Type Description
EnvironmentOrBuilder

getExecutableCase()

public Runnable.ExecutableCase getExecutableCase()
Returns
Type Description
Runnable.ExecutableCase

getIgnoreExitStatus()

public boolean getIgnoreExitStatus()

Normally, a runnable that returns a non-zero exit status fails and causes the task to fail. However, you can set this field to true to allow the task to continue executing its other runnables even if this runnable fails.

bool ignore_exit_status = 3;

Returns
Type Description
boolean

The ignoreExitStatus.

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Labels for this Runnable.

map<string, string> labels = 9;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Labels for this Runnable.

map<string, string> labels = 9;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Labels for this Runnable.

map<string, string> labels = 9;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Labels for this Runnable.

map<string, string> labels = 9;

Parameter
Name Description
key String
Returns
Type Description
String

getParserForType()

public Parser<Runnable> getParserForType()
Returns
Type Description
Parser<Runnable>
Overrides

getScript()

public Runnable.Script getScript()

Script runnable.

.google.cloud.batch.v1alpha.Runnable.Script script = 2;

Returns
Type Description
Runnable.Script

The script.

getScriptOrBuilder()

public Runnable.ScriptOrBuilder getScriptOrBuilder()

Script runnable.

.google.cloud.batch.v1alpha.Runnable.Script script = 2;

Returns
Type Description
Runnable.ScriptOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTimeout()

public Duration getTimeout()

Timeout for this Runnable.

.google.protobuf.Duration timeout = 8;

Returns
Type Description
Duration

The timeout.

getTimeoutOrBuilder()

public DurationOrBuilder getTimeoutOrBuilder()

Timeout for this Runnable.

.google.protobuf.Duration timeout = 8;

Returns
Type Description
DurationOrBuilder

hasBarrier()

public boolean hasBarrier()

Barrier runnable.

.google.cloud.batch.v1alpha.Runnable.Barrier barrier = 6;

Returns
Type Description
boolean

Whether the barrier field is set.

hasContainer()

public boolean hasContainer()

Container runnable.

.google.cloud.batch.v1alpha.Runnable.Container container = 1;

Returns
Type Description
boolean

Whether the container field is set.

hasEnvironment()

public boolean hasEnvironment()

Environment variables for this Runnable (overrides variables set for the whole Task or TaskGroup).

.google.cloud.batch.v1alpha.Environment environment = 7;

Returns
Type Description
boolean

Whether the environment field is set.

hasScript()

public boolean hasScript()

Script runnable.

.google.cloud.batch.v1alpha.Runnable.Script script = 2;

Returns
Type Description
boolean

Whether the script field is set.

hasTimeout()

public boolean hasTimeout()

Timeout for this Runnable.

.google.protobuf.Duration timeout = 8;

Returns
Type Description
boolean

Whether the timeout field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Runnable.Builder newBuilderForType()
Returns
Type Description
Runnable.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Runnable.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Runnable.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Runnable.Builder toBuilder()
Returns
Type Description
Runnable.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException