#include <worker_message_code.h>
A message code is used to report status and error messages to the service. The message codes are intended to be machine readable. The service will take care of translating these into user understandable messages if necessary.
Example use cases:
- Worker processes reporting successful startup.
- Worker processes reporting specific errors (e.g. package staging failure).
◆ WorkerMessageCode() [1/2]
google_dataflow_api::WorkerMessageCode::WorkerMessageCode |
( |
const Json::Value & |
storage | ) |
|
|
explicit |
Standard constructor for an immutable data object instance.
- Parameters
-
[in] | storage | The underlying data storage for this instance. |
◆ WorkerMessageCode() [2/2]
google_dataflow_api::WorkerMessageCode::WorkerMessageCode |
( |
Json::Value * |
storage | ) |
|
|
explicit |
Standard constructor for a mutable data object instance.
- Parameters
-
[in] | storage | The underlying data storage for this instance. |
◆ ~WorkerMessageCode()
google_dataflow_api::WorkerMessageCode::~WorkerMessageCode |
( |
| ) |
|
|
virtual |
◆ clear_code()
void google_dataflow_api::WorkerMessageCode::clear_code |
( |
| ) |
|
|
inline |
Clears the 'code
' attribute.
◆ clear_parameters()
void google_dataflow_api::WorkerMessageCode::clear_parameters |
( |
| ) |
|
|
inline |
Clears the 'parameters
' attribute.
◆ get_code()
const StringPiece google_dataflow_api::WorkerMessageCode::get_code |
( |
| ) |
const |
|
inline |
Get the value of the 'code
' attribute.
◆ get_parameters()
const client::JsonCppAssociativeArray<client::JsonCppData > google_dataflow_api::WorkerMessageCode::get_parameters |
( |
| ) |
const |
|
inline |
Get a reference to the value of the 'parameters
' attribute.
◆ GetTypeName()
const StringPiece google_dataflow_api::WorkerMessageCode::GetTypeName |
( |
| ) |
const |
|
inline |
◆ has_code()
bool google_dataflow_api::WorkerMessageCode::has_code |
( |
| ) |
const |
|
inline |
Determine if the 'code
' attribute was set.
- Returns
- true if the '
code
' attribute was set.
◆ has_parameters()
bool google_dataflow_api::WorkerMessageCode::has_parameters |
( |
| ) |
const |
|
inline |
Determine if the 'parameters
' attribute was set.
- Returns
- true if the '
parameters
' attribute was set.
◆ mutable_parameters()
client::JsonCppAssociativeArray<client::JsonCppData > google_dataflow_api::WorkerMessageCode::mutable_parameters |
( |
| ) |
|
|
inline |
Gets a reference to a mutable value of the 'parameters
' property.
Parameters contains specific information about the code.
This is a struct to allow parameters of different types.
Examples:
- For a "HARNESS_STARTED" message parameters might provide the name of the worker and additional data like timing information.
- For a "GCS_DOWNLOAD_ERROR" parameters might contain fields listing the GCS objects being downloaded and fields containing errors.
In general complex data structures should be avoided. If a worker needs to send a specific and complicated data structure then please consider defining a new proto and adding it to the data oneof in WorkerMessageResponse.
Conventions: Parameters should only be used for information that isn't typically passed as a label. hostname and other worker identifiers should almost always be passed as labels since they will be included on most messages.
- Returns
- The result can be modified to change the attribute value.
◆ New()
Creates a new default instance.
- Returns
- Ownership is passed back to the caller.
◆ set_code()
void google_dataflow_api::WorkerMessageCode::set_code |
( |
const StringPiece & |
value | ) |
|
|
inline |
Change the 'code
' attribute.
The code is a string intended for consumption by a machine that identifies the type of message being sent. Examples:
- "HARNESS_STARTED" might be used to indicate the worker harness has started.
- "GCS_DOWNLOAD_ERROR" might be used to indicate an error downloading a GCS file as part of the boot process of one of the worker containers.
This is a string and not an enum to make it easy to add new codes without waiting for an API change.
- Parameters
-
The documentation for this class was generated from the following files: