tensorflow_serving_client/
cluster.rs1#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25#[derive(PartialEq,Clone,Default)]
30pub struct JobDef {
31 pub name: ::std::string::String,
33 pub tasks: ::std::collections::HashMap<i32, ::std::string::String>,
34 pub unknown_fields: ::protobuf::UnknownFields,
36 pub cached_size: ::protobuf::CachedSize,
37}
38
39impl<'a> ::std::default::Default for &'a JobDef {
40 fn default() -> &'a JobDef {
41 <JobDef as ::protobuf::Message>::default_instance()
42 }
43}
44
45impl JobDef {
46 pub fn new() -> JobDef {
47 ::std::default::Default::default()
48 }
49
50 pub fn get_name(&self) -> &str {
54 &self.name
55 }
56 pub fn clear_name(&mut self) {
57 self.name.clear();
58 }
59
60 pub fn set_name(&mut self, v: ::std::string::String) {
62 self.name = v;
63 }
64
65 pub fn mut_name(&mut self) -> &mut ::std::string::String {
68 &mut self.name
69 }
70
71 pub fn take_name(&mut self) -> ::std::string::String {
73 ::std::mem::replace(&mut self.name, ::std::string::String::new())
74 }
75
76 pub fn get_tasks(&self) -> &::std::collections::HashMap<i32, ::std::string::String> {
80 &self.tasks
81 }
82 pub fn clear_tasks(&mut self) {
83 self.tasks.clear();
84 }
85
86 pub fn set_tasks(&mut self, v: ::std::collections::HashMap<i32, ::std::string::String>) {
88 self.tasks = v;
89 }
90
91 pub fn mut_tasks(&mut self) -> &mut ::std::collections::HashMap<i32, ::std::string::String> {
93 &mut self.tasks
94 }
95
96 pub fn take_tasks(&mut self) -> ::std::collections::HashMap<i32, ::std::string::String> {
98 ::std::mem::replace(&mut self.tasks, ::std::collections::HashMap::new())
99 }
100}
101
102impl ::protobuf::Message for JobDef {
103 fn is_initialized(&self) -> bool {
104 true
105 }
106
107 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
108 while !is.eof()? {
109 let (field_number, wire_type) = is.read_tag_unpack()?;
110 match field_number {
111 1 => {
112 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
113 },
114 2 => {
115 ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.tasks)?;
116 },
117 _ => {
118 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
119 },
120 };
121 }
122 ::std::result::Result::Ok(())
123 }
124
125 #[allow(unused_variables)]
127 fn compute_size(&self) -> u32 {
128 let mut my_size = 0;
129 if !self.name.is_empty() {
130 my_size += ::protobuf::rt::string_size(1, &self.name);
131 }
132 my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(2, &self.tasks);
133 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
134 self.cached_size.set(my_size);
135 my_size
136 }
137
138 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
139 if !self.name.is_empty() {
140 os.write_string(1, &self.name)?;
141 }
142 ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(2, &self.tasks, os)?;
143 os.write_unknown_fields(self.get_unknown_fields())?;
144 ::std::result::Result::Ok(())
145 }
146
147 fn get_cached_size(&self) -> u32 {
148 self.cached_size.get()
149 }
150
151 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
152 &self.unknown_fields
153 }
154
155 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
156 &mut self.unknown_fields
157 }
158
159 fn as_any(&self) -> &dyn (::std::any::Any) {
160 self as &dyn (::std::any::Any)
161 }
162 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
163 self as &mut dyn (::std::any::Any)
164 }
165 fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
166 self
167 }
168
169 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
170 Self::descriptor_static()
171 }
172
173 fn new() -> JobDef {
174 JobDef::new()
175 }
176
177 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
178 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
179 unsafe {
180 descriptor.get(|| {
181 let mut fields = ::std::vec::Vec::new();
182 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
183 "name",
184 |m: &JobDef| { &m.name },
185 |m: &mut JobDef| { &mut m.name },
186 ));
187 fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(
188 "tasks",
189 |m: &JobDef| { &m.tasks },
190 |m: &mut JobDef| { &mut m.tasks },
191 ));
192 ::protobuf::reflect::MessageDescriptor::new_pb_name::<JobDef>(
193 "JobDef",
194 fields,
195 file_descriptor_proto()
196 )
197 })
198 }
199 }
200
201 fn default_instance() -> &'static JobDef {
202 static mut instance: ::protobuf::lazy::Lazy<JobDef> = ::protobuf::lazy::Lazy::INIT;
203 unsafe {
204 instance.get(JobDef::new)
205 }
206 }
207}
208
209impl ::protobuf::Clear for JobDef {
210 fn clear(&mut self) {
211 self.name.clear();
212 self.tasks.clear();
213 self.unknown_fields.clear();
214 }
215}
216
217impl ::std::fmt::Debug for JobDef {
218 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
219 ::protobuf::text_format::fmt(self, f)
220 }
221}
222
223impl ::protobuf::reflect::ProtobufValue for JobDef {
224 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
225 ::protobuf::reflect::ReflectValueRef::Message(self)
226 }
227}
228
229#[derive(PartialEq,Clone,Default)]
230pub struct ClusterDef {
231 pub job: ::protobuf::RepeatedField<JobDef>,
233 pub unknown_fields: ::protobuf::UnknownFields,
235 pub cached_size: ::protobuf::CachedSize,
236}
237
238impl<'a> ::std::default::Default for &'a ClusterDef {
239 fn default() -> &'a ClusterDef {
240 <ClusterDef as ::protobuf::Message>::default_instance()
241 }
242}
243
244impl ClusterDef {
245 pub fn new() -> ClusterDef {
246 ::std::default::Default::default()
247 }
248
249 pub fn get_job(&self) -> &[JobDef] {
253 &self.job
254 }
255 pub fn clear_job(&mut self) {
256 self.job.clear();
257 }
258
259 pub fn set_job(&mut self, v: ::protobuf::RepeatedField<JobDef>) {
261 self.job = v;
262 }
263
264 pub fn mut_job(&mut self) -> &mut ::protobuf::RepeatedField<JobDef> {
266 &mut self.job
267 }
268
269 pub fn take_job(&mut self) -> ::protobuf::RepeatedField<JobDef> {
271 ::std::mem::replace(&mut self.job, ::protobuf::RepeatedField::new())
272 }
273}
274
275impl ::protobuf::Message for ClusterDef {
276 fn is_initialized(&self) -> bool {
277 for v in &self.job {
278 if !v.is_initialized() {
279 return false;
280 }
281 };
282 true
283 }
284
285 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
286 while !is.eof()? {
287 let (field_number, wire_type) = is.read_tag_unpack()?;
288 match field_number {
289 1 => {
290 ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.job)?;
291 },
292 _ => {
293 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
294 },
295 };
296 }
297 ::std::result::Result::Ok(())
298 }
299
300 #[allow(unused_variables)]
302 fn compute_size(&self) -> u32 {
303 let mut my_size = 0;
304 for value in &self.job {
305 let len = value.compute_size();
306 my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
307 };
308 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
309 self.cached_size.set(my_size);
310 my_size
311 }
312
313 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
314 for v in &self.job {
315 os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
316 os.write_raw_varint32(v.get_cached_size())?;
317 v.write_to_with_cached_sizes(os)?;
318 };
319 os.write_unknown_fields(self.get_unknown_fields())?;
320 ::std::result::Result::Ok(())
321 }
322
323 fn get_cached_size(&self) -> u32 {
324 self.cached_size.get()
325 }
326
327 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
328 &self.unknown_fields
329 }
330
331 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
332 &mut self.unknown_fields
333 }
334
335 fn as_any(&self) -> &dyn (::std::any::Any) {
336 self as &dyn (::std::any::Any)
337 }
338 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
339 self as &mut dyn (::std::any::Any)
340 }
341 fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
342 self
343 }
344
345 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
346 Self::descriptor_static()
347 }
348
349 fn new() -> ClusterDef {
350 ClusterDef::new()
351 }
352
353 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
354 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
355 unsafe {
356 descriptor.get(|| {
357 let mut fields = ::std::vec::Vec::new();
358 fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<JobDef>>(
359 "job",
360 |m: &ClusterDef| { &m.job },
361 |m: &mut ClusterDef| { &mut m.job },
362 ));
363 ::protobuf::reflect::MessageDescriptor::new_pb_name::<ClusterDef>(
364 "ClusterDef",
365 fields,
366 file_descriptor_proto()
367 )
368 })
369 }
370 }
371
372 fn default_instance() -> &'static ClusterDef {
373 static mut instance: ::protobuf::lazy::Lazy<ClusterDef> = ::protobuf::lazy::Lazy::INIT;
374 unsafe {
375 instance.get(ClusterDef::new)
376 }
377 }
378}
379
380impl ::protobuf::Clear for ClusterDef {
381 fn clear(&mut self) {
382 self.job.clear();
383 self.unknown_fields.clear();
384 }
385}
386
387impl ::std::fmt::Debug for ClusterDef {
388 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
389 ::protobuf::text_format::fmt(self, f)
390 }
391}
392
393impl ::protobuf::reflect::ProtobufValue for ClusterDef {
394 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
395 ::protobuf::reflect::ReflectValueRef::Message(self)
396 }
397}
398
399static file_descriptor_proto_data: &'static [u8] = b"\
400 \n&tensorflow/core/protobuf/cluster.proto\x12\ntensorflow\"\x8b\x01\n\
401 \x06JobDef\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x123\n\x05tasks\
402 \x18\x02\x20\x03(\x0b2\x1d.tensorflow.JobDef.TasksEntryR\x05tasks\x1a8\n\
403 \nTasksEntry\x12\x10\n\x03key\x18\x01\x20\x01(\x05R\x03key\x12\x14\n\x05\
404 value\x18\x02\x20\x01(\tR\x05value:\x028\x01\"2\n\nClusterDef\x12$\n\x03\
405 job\x18\x01\x20\x03(\x0b2\x12.tensorflow.JobDefR\x03jobBz\n\x1aorg.tenso\
406 rflow.distruntimeB\rClusterProtosP\x01ZHgithub.com/tensorflow/tensorflow\
407 /tensorflow/go/core/core_protos_go_proto\xf8\x01\x01J\x9e\x16\n\x06\x12\
408 \x04\x0f\0S\x01\n\x9f\x05\n\x01\x0c\x12\x03\x0f\0\x122\x94\x05\x20Copyri\
409 ght\x202016\x20The\x20TensorFlow\x20Authors.\x20All\x20Rights\x20Reserve\
410 d.\n\nLicensed\x20under\x20the\x20Apache\x20License,\x20Version\x202.0\
411 \x20(the\x20\"License\");\nyou\x20may\x20not\x20use\x20this\x20file\x20e\
412 xcept\x20in\x20compliance\x20with\x20the\x20License.\nYou\x20may\x20obta\
413 in\x20a\x20copy\x20of\x20the\x20License\x20at\n\nhttp://www.apache.org/l\
414 icenses/LICENSE-2.0\n\nUnless\x20required\x20by\x20applicable\x20law\x20\
415 or\x20agreed\x20to\x20in\x20writing,\x20software\ndistributed\x20under\
416 \x20the\x20License\x20is\x20distributed\x20on\x20an\x20\"AS\x20IS\"\x20B\
417 ASIS,\nWITHOUT\x20WARRANTIES\x20OR\x20CONDITIONS\x20OF\x20ANY\x20KIND,\
418 \x20either\x20express\x20or\x20implied.\nSee\x20the\x20License\x20for\
419 \x20the\x20specific\x20language\x20governing\x20permissions\x20and\nlimi\
420 tations\x20under\x20the\x20License.\n===================================\
421 ===========================================\n\x08\n\x01\x02\x12\x03\x11\
422 \0\x13\n\x08\n\x01\x08\x12\x03\x13\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x13\0\
423 \x1f\n\x08\n\x01\x08\x12\x03\x14\0.\n\t\n\x02\x08\x08\x12\x03\x14\0.\n\
424 \x08\n\x01\x08\x12\x03\x15\0\"\n\t\n\x02\x08\n\x12\x03\x15\0\"\n\x08\n\
425 \x01\x08\x12\x03\x16\03\n\t\n\x02\x08\x01\x12\x03\x16\03\n\x08\n\x01\x08\
426 \x12\x03\x17\0_\n\t\n\x02\x08\x0b\x12\x03\x17\0_\n\xbc\x0b\n\x02\x04\0\
427 \x12\x04C\0M\x01\x1a/\x20Defines\x20a\x20single\x20job\x20in\x20a\x20Ten\
428 sorFlow\x20cluster.\n2\xfe\n\x20This\x20file\x20contains\x20protos\x20to\
429 \x20be\x20used\x20when\x20defining\x20a\x20TensorFlow\n\x20cluster.\n\n\
430 \x20EXAMPLES\n\x20--------\n\n\x201.\x20A\x20single-process\x20cluster,\
431 \x20containing\x20\"/job:local/task:0\".\n\n\x20\x20\x20\x20Cluster:\n\
432 \x20\x20\x20\x20\x20\x20job\x20{\x20name:\x20'local'\x20tasks\x20{\x20ke\
433 y:\x200\x20value:\x20'localhost:2222'\x20}\x20}\n\n\x20\x20\x20\x20Serve\
434 r:\n\x20\x20\x20\x20\x20\x20cluster\x20{\x20$CLUSTER\x20}\x20job_name:\
435 \x20'local'\x20task_index:\x200\n\n\x202.\x20A\x20two-process\x20cluster\
436 ,\x20containing\x20\"/job:local/task:{0,1}\".\n\n\x20\x20\x20\x20Cluster\
437 :\n\x20\x20\x20\x20\x20\x20job\x20{\x20name:\x20'local'\x20tasks\x20{\
438 \x20key:\x200\x20value:\x20'localhost:2222'\x20}\n\x20\x20\x20\x20\x20\
439 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
440 \x20\x20\x20tasks\x20{\x20key:\x201\x20value:\x20'localhost:2223'\x20}\
441 \x20}\n\n\x20\x20\x20\x20Servers:\n\x20\x20\x20\x20\x20\x20cluster\x20{\
442 \x20$CLUSTER\x20}\x20job_name:\x20'local'\x20task_index:\x200\n\x20\x20\
443 \x20\x20\x20\x20cluster\x20{\x20$CLUSTER\x20}\x20job_name:\x20'local'\
444 \x20task_index:\x201\n\n\x203.\x20A\x20two-job\x20cluster,\x20containing\
445 \x20\"/job:worker/task:{0,1,2}\"\x20and\n\x20\x20\x20\x20\"/job:ps/task:\
446 {0,1}\".\n\n\x20\x20\x20\x20Cluster:\n\x20\x20\x20\x20\x20\x20job\x20{\
447 \x20name:\x20'worker'\x20tasks\x20{\x20key:\x200\x20value:\x20'worker1:2\
448 222'\x20}\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
449 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20tasks\x20{\x20key:\x201\
450 \x20value:\x20'worker2:2222'\x20}\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\
451 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
452 tasks\x20{\x20key:\x202\x20value:\x20'worker3:2222'\x20}\x20}\n\x20\x20\
453 \x20\x20\x20\x20job\x20{\x20name:\x20'ps'\x20\x20\x20\x20\x20tasks\x20{\
454 \x20key:\x200\x20value:\x20'ps0:2222'\x20}\n\x20\x20\x20\x20\x20\x20\x20\
455 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
456 \x20\x20tasks\x20{\x20key:\x201\x20value:\x20'ps1:2222'\x20}\x20}\n\n\
457 \x20\x20\x20\x20Servers:\n\x20\x20\x20\x20\x20\x20cluster\x20{\x20$CLUST\
458 ER\x20}\x20job_name:\x20'worker'\x20task_index:\x200\n\x20\x20\x20\x20\
459 \x20\x20cluster\x20{\x20$CLUSTER\x20}\x20job_name:\x20'worker'\x20task_i\
460 ndex:\x201\n\x20\x20\x20\x20\x20\x20cluster\x20{\x20$CLUSTER\x20}\x20job\
461 _name:\x20'worker'\x20task_index:\x202\n\x20\x20\x20\x20\x20\x20cluster\
462 \x20{\x20$CLUSTER\x20}\x20job_name:\x20'ps'\x20\x20\x20\x20\x20task_inde\
463 x:\x200\n\x20\x20\x20\x20\x20\x20cluster\x20{\x20$CLUSTER\x20}\x20job_na\
464 me:\x20'ps'\x20\x20\x20\x20\x20task_index:\x201\n\n\n\n\x03\x04\0\x01\
465 \x12\x03C\x08\x0e\n$\n\x04\x04\0\x02\0\x12\x03E\x02\x12\x1a\x17\x20The\
466 \x20name\x20of\x20this\x20job.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03E\
467 \x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03E\t\r\n\x0c\n\x05\x04\0\x02\
468 \0\x03\x12\x03E\x10\x11\n\x83\x02\n\x04\x04\0\x02\x01\x12\x03L\x02\x1f\
469 \x1a\xf5\x01\x20Mapping\x20from\x20task\x20ID\x20to\x20\"hostname:port\"\
470 \x20string.\n\n\x20If\x20the\x20`name`\x20field\x20contains\x20\"worker\
471 \",\x20and\x20the\x20`tasks`\x20map\x20contains\x20a\n\x20mapping\x20fro\
472 m\x207\x20to\x20\"example.org:2222\",\x20then\x20the\x20device\x20prefix\
473 \n\x20\"/job:worker/task:7\"\x20will\x20be\x20assigned\x20to\x20\"exampl\
474 e.org:2222\".\n\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03L\x02\x14\n\x0c\n\
475 \x05\x04\0\x02\x01\x01\x12\x03L\x15\x1a\n\x0c\n\x05\x04\0\x02\x01\x03\
476 \x12\x03L\x1d\x1e\n<\n\x02\x04\x01\x12\x04P\0S\x01\x1a0\x20Defines\x20a\
477 \x20TensorFlow\x20cluster\x20as\x20a\x20set\x20of\x20jobs.\n\n\n\n\x03\
478 \x04\x01\x01\x12\x03P\x08\x12\n2\n\x04\x04\x01\x02\0\x12\x03R\x02\x1a\
479 \x1a%\x20The\x20jobs\x20that\x20comprise\x20the\x20cluster.\n\n\x0c\n\
480 \x05\x04\x01\x02\0\x04\x12\x03R\x02\n\n\x0c\n\x05\x04\x01\x02\0\x06\x12\
481 \x03R\x0b\x11\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03R\x12\x15\n\x0c\n\x05\
482 \x04\x01\x02\0\x03\x12\x03R\x18\x19b\x06proto3\
483";
484
485static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
486
487fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
488 ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
489}
490
491pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
492 unsafe {
493 file_descriptor_proto_lazy.get(|| {
494 parse_descriptor_proto()
495 })
496 }
497}