30 #ifndef GOOGLE_DATAFLOW_API_WORK_ITEM_STATUS_H_ 31 #define GOOGLE_DATAFLOW_API_WORK_ITEM_STATUS_H_ 34 #include "googleapis/base/integral_types.h" 35 #include "googleapis/base/macros.h" 36 #include "googleapis/client/data/jsoncpp_data.h" 37 #include "googleapis/strings/stringpiece.h" 39 #include "google/dataflow_api/approximate_progress.h" 40 #include "google/dataflow_api/approximate_reported_progress.h" 41 #include "google/dataflow_api/counter_update.h" 42 #include "google/dataflow_api/dynamic_source_split.h" 43 #include "google/dataflow_api/metric_update.h" 44 #include "google/dataflow_api/position.h" 45 #include "google/dataflow_api/source_fork.h" 46 #include "google/dataflow_api/source_operation_response.h" 47 #include "google/dataflow_api/status.h" 95 return StringPiece(
"google_dataflow_api::WorkItemStatus");
104 return Storage().isMember(
"completed");
111 MutableStorage()->removeMember(
"completed");
119 const Json::Value& storage = Storage(
"completed");
120 return client::JsonValueToCppValueHelper<bool >(storage);
131 client::SetJsonValueFromCppValueHelper<bool >(
132 value, MutableStorage(
"completed"));
141 return Storage().isMember(
"counterUpdates");
148 MutableStorage()->removeMember(
"counterUpdates");
156 const client::JsonCppArray<CounterUpdate > get_counter_updates()
const;
166 client::JsonCppArray<CounterUpdate > mutable_counterUpdates();
174 return Storage().isMember(
"dynamicSourceSplit");
181 MutableStorage()->removeMember(
"dynamicSourceSplit");
207 return Storage().isMember(
"errors");
214 MutableStorage()->removeMember(
"errors");
221 const client::JsonCppArray<Status > get_errors()
const;
232 client::JsonCppArray<Status > mutable_errors();
240 return Storage().isMember(
"metricUpdates");
247 MutableStorage()->removeMember(
"metricUpdates");
254 const client::JsonCppArray<MetricUpdate > get_metric_updates()
const;
266 client::JsonCppArray<MetricUpdate > mutable_metricUpdates();
274 return Storage().isMember(
"progress");
281 MutableStorage()->removeMember(
"progress");
308 return Storage().isMember(
"reportIndex");
315 MutableStorage()->removeMember(
"reportIndex");
323 const Json::Value& storage = Storage(
"reportIndex");
324 return client::JsonValueToCppValueHelper<int64 >(storage);
346 client::SetJsonValueFromCppValueHelper<int64 >(
347 value, MutableStorage(
"reportIndex"));
356 return Storage().isMember(
"reportedProgress");
363 MutableStorage()->removeMember(
"reportedProgress");
390 return Storage().isMember(
"requestedLeaseDuration");
397 MutableStorage()->removeMember(
"requestedLeaseDuration");
405 const Json::Value& v = Storage(
"requestedLeaseDuration");
406 if (v == Json::Value::null)
return StringPiece(
"");
407 return StringPiece(v.asCString());
418 *MutableStorage(
"requestedLeaseDuration") = value.data();
427 return Storage().isMember(
"sourceFork");
434 MutableStorage()->removeMember(
"sourceFork");
462 return Storage().isMember(
"sourceOperationResponse");
469 MutableStorage()->removeMember(
"sourceOperationResponse");
496 return Storage().isMember(
"stopPosition");
503 MutableStorage()->removeMember(
"stopPosition");
510 const Position get_stop_position()
const;
559 return Storage().isMember(
"totalThrottlerWaitTimeSeconds");
566 MutableStorage()->removeMember(
"totalThrottlerWaitTimeSeconds");
575 const Json::Value& storage = Storage(
"totalThrottlerWaitTimeSeconds");
576 return client::JsonValueToCppValueHelper<double >(storage);
587 client::SetJsonValueFromCppValueHelper<double >(
588 value, MutableStorage(
"totalThrottlerWaitTimeSeconds"));
597 return Storage().isMember(
"workItemId");
604 MutableStorage()->removeMember(
"workItemId");
612 const Json::Value& v = Storage(
"workItemId");
613 if (v == Json::Value::null)
return StringPiece(
"");
614 return StringPiece(v.asCString());
625 *MutableStorage(
"workItemId") = value.data();
632 #endif // GOOGLE_DATAFLOW_API_WORK_ITEM_STATUS_H_ Definition: approximate_reported_progress.h:52
bool get_completed() const
Definition: work_item_status.h:118
bool has_stop_position() const
Definition: work_item_status.h:495
const StringPiece GetTypeName() const
Definition: work_item_status.h:94
void clear_stop_position()
Definition: work_item_status.h:502
int64 get_report_index() const
Definition: work_item_status.h:322
bool has_metric_updates() const
Definition: work_item_status.h:239
void set_total_throttler_wait_time_seconds(double value)
Definition: work_item_status.h:586
const StringPiece get_requested_lease_duration() const
Definition: work_item_status.h:404
void clear_progress()
Definition: work_item_status.h:280
bool has_total_throttler_wait_time_seconds() const
Definition: work_item_status.h:558
Definition: work_item_status.h:61
bool has_completed() const
Definition: work_item_status.h:103
bool has_source_fork() const
Definition: work_item_status.h:426
void clear_source_fork()
Definition: work_item_status.h:433
bool has_reported_progress() const
Definition: work_item_status.h:355
void clear_reported_progress()
Definition: work_item_status.h:362
void clear_dynamic_source_split()
Definition: work_item_status.h:180
bool has_source_operation_response() const
Definition: work_item_status.h:461
Definition: position.h:55
Definition: source_operation_response.h:54
void clear_total_throttler_wait_time_seconds()
Definition: work_item_status.h:565
void clear_source_operation_response()
Definition: work_item_status.h:468
bool has_counter_updates() const
Definition: work_item_status.h:140
bool has_progress() const
Definition: work_item_status.h:273
bool has_report_index() const
Definition: work_item_status.h:307
bool has_work_item_id() const
Definition: work_item_status.h:596
void clear_requested_lease_duration()
Definition: work_item_status.h:396
void clear_counter_updates()
Definition: work_item_status.h:147
Definition: approximate_progress.h:40
void clear_work_item_id()
Definition: work_item_status.h:603
void set_requested_lease_duration(const StringPiece &value)
Definition: work_item_status.h:417
void set_report_index(int64 value)
Definition: work_item_status.h:345
bool has_errors() const
Definition: work_item_status.h:206
void set_work_item_id(const StringPiece &value)
Definition: work_item_status.h:624
const StringPiece get_work_item_id() const
Definition: work_item_status.h:611
double get_total_throttler_wait_time_seconds() const
Definition: work_item_status.h:574
Definition: approximate_progress.h:52
bool has_dynamic_source_split() const
Definition: work_item_status.h:173
void clear_metric_updates()
Definition: work_item_status.h:246
Definition: dynamic_source_split.h:53
bool has_requested_lease_duration() const
Definition: work_item_status.h:389
Definition: approximate_progress.cc:42
void clear_report_index()
Definition: work_item_status.h:314
Definition: source_fork.h:52
void clear_errors()
Definition: work_item_status.h:213
void clear_completed()
Definition: work_item_status.h:110
void set_completed(bool value)
Definition: work_item_status.h:130