dataflow  v1b3
Public Member Functions | Static Public Member Functions | List of all members
google_dataflow_api::WorkerMessageCode Class Reference

#include <worker_message_code.h>

Inheritance diagram for google_dataflow_api::WorkerMessageCode:

Public Member Functions

 WorkerMessageCode (const Json::Value &storage)
 
 WorkerMessageCode (Json::Value *storage)
 
virtual ~WorkerMessageCode ()
 
const StringPiece GetTypeName () const
 
bool has_code () const
 
void clear_code ()
 
const StringPiece get_code () const
 
void set_code (const StringPiece &value)
 
bool has_parameters () const
 
void clear_parameters ()
 
const client::JsonCppAssociativeArray< client::JsonCppData > get_parameters () const
 
client::JsonCppAssociativeArray< client::JsonCppData > mutable_parameters ()
 

Static Public Member Functions

static WorkerMessageCodeNew ()
 

Detailed Description

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:

  1. Worker processes reporting successful startup.
  2. Worker processes reporting specific errors (e.g. package staging failure).

Constructor & Destructor Documentation

◆ WorkerMessageCode() [1/2]

google_dataflow_api::WorkerMessageCode::WorkerMessageCode ( const Json::Value &  storage)
explicit

Standard constructor for an immutable data object instance.

Parameters
[in]storageThe 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]storageThe underlying data storage for this instance.

◆ ~WorkerMessageCode()

google_dataflow_api::WorkerMessageCode::~WorkerMessageCode ( )
virtual

Standard destructor.

Member Function Documentation

◆ 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

Returns a string denoting the type of this data object.

Returns
google_dataflow_api::WorkerMessageCode

◆ 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:

  1. For a "HARNESS_STARTED" message parameters might provide the name of the worker and additional data like timing information.
  2. 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()

WorkerMessageCode * google_dataflow_api::WorkerMessageCode::New ( )
static

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:

  1. "HARNESS_STARTED" might be used to indicate the worker harness has started.
  2. "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
[in]valueThe new value.

The documentation for this class was generated from the following files: