30 #ifndef GOOGLE_DATAFLOW_API_POSITION_H_ 31 #define GOOGLE_DATAFLOW_API_POSITION_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/concat_position.h" 69 explicit Position(
const Json::Value& storage);
76 explicit Position(Json::Value* storage);
89 return StringPiece(
"google_dataflow_api::Position");
98 return Storage().isMember(
"byteOffset");
105 MutableStorage()->removeMember(
"byteOffset");
113 const Json::Value& storage = Storage(
"byteOffset");
114 return client::JsonValueToCppValueHelper<int64 >(storage);
125 client::SetJsonValueFromCppValueHelper<int64 >(
126 value, MutableStorage(
"byteOffset"));
135 return Storage().isMember(
"concatPosition");
142 MutableStorage()->removeMember(
"concatPosition");
168 return Storage().isMember(
"end");
175 MutableStorage()->removeMember(
"end");
183 const Json::Value& storage = Storage(
"end");
184 return client::JsonValueToCppValueHelper<bool >(storage);
196 client::SetJsonValueFromCppValueHelper<bool >(
197 value, MutableStorage(
"end"));
206 return Storage().isMember(
"key");
213 MutableStorage()->removeMember(
"key");
221 const Json::Value& v = Storage(
"key");
222 if (v == Json::Value::null)
return StringPiece(
"");
223 return StringPiece(v.asCString());
234 *MutableStorage(
"key") = value.data();
243 return Storage().isMember(
"recordIndex");
250 MutableStorage()->removeMember(
"recordIndex");
258 const Json::Value& storage = Storage(
"recordIndex");
259 return client::JsonValueToCppValueHelper<int64 >(storage);
270 client::SetJsonValueFromCppValueHelper<int64 >(
271 value, MutableStorage(
"recordIndex"));
280 return Storage().isMember(
"shufflePosition");
287 MutableStorage()->removeMember(
"shufflePosition");
295 const Json::Value& v = Storage(
"shufflePosition");
296 if (v == Json::Value::null)
return StringPiece(
"");
297 return StringPiece(v.asCString());
309 *MutableStorage(
"shufflePosition") = value.data();
316 #endif // GOOGLE_DATAFLOW_API_POSITION_H_ void clear_shuffle_position()
Definition: position.h:286
void clear_concat_position()
Definition: position.h:141
void set_end(bool value)
Definition: position.h:195
int64 get_record_index() const
Definition: position.h:257
const StringPiece GetTypeName() const
Definition: position.h:88
bool has_byte_offset() const
Definition: position.h:97
Definition: position.h:55
bool has_key() const
Definition: position.h:205
bool has_end() const
Definition: position.h:167
void set_key(const StringPiece &value)
Definition: position.h:233
void clear_byte_offset()
Definition: position.h:104
bool has_concat_position() const
Definition: position.h:134
int64 get_byte_offset() const
Definition: position.h:112
bool has_shuffle_position() const
Definition: position.h:279
void clear_key()
Definition: position.h:212
void set_shuffle_position(const StringPiece &value)
Definition: position.h:308
Definition: approximate_progress.h:40
bool has_record_index() const
Definition: position.h:242
void clear_end()
Definition: position.h:174
const StringPiece get_key() const
Definition: position.h:220
void set_record_index(int64 value)
Definition: position.h:269
const StringPiece get_shuffle_position() const
Definition: position.h:294
bool get_end() const
Definition: position.h:182
Definition: approximate_progress.cc:42
void clear_record_index()
Definition: position.h:249
void set_byte_offset(int64 value)
Definition: position.h:124
Definition: concat_position.h:54