neptune 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. data/README +4 -0
  2. data/doc/BabelHelper.html +393 -376
  3. data/doc/BadConfigurationException.html +121 -127
  4. data/doc/CommonFunctions.html +237 -265
  5. data/doc/ExodusHelper.html +820 -0
  6. data/doc/ExodusTaskInfo.html +263 -0
  7. data/doc/FileNotFoundException.html +121 -127
  8. data/doc/NeptuneHelper.html +527 -592
  9. data/doc/NeptuneManagerClient.html +696 -0
  10. data/doc/NeptuneManagerException.html +139 -0
  11. data/doc/Object.html +334 -236
  12. data/doc/TaskInfo.html +428 -0
  13. data/doc/created.rid +8 -5
  14. data/doc/images/add.png +0 -0
  15. data/doc/images/delete.png +0 -0
  16. data/doc/images/tag_blue.png +0 -0
  17. data/doc/images/transparent.png +0 -0
  18. data/doc/index.html +74 -142
  19. data/doc/js/darkfish.js +99 -62
  20. data/doc/js/jquery.js +15 -29
  21. data/doc/js/navigation.js +142 -0
  22. data/doc/js/search.js +94 -0
  23. data/doc/js/search_index.js +1 -0
  24. data/doc/js/searcher.js +228 -0
  25. data/doc/table_of_contents.html +226 -0
  26. data/lib/babel.rb +116 -50
  27. data/lib/custom_exceptions.rb +2 -2
  28. data/lib/exodus.rb +311 -0
  29. data/lib/exodus_task_info.rb +36 -0
  30. data/lib/neptune.rb +52 -18
  31. data/lib/{app_controller_client.rb → neptune_manager_client.rb} +54 -38
  32. data/lib/task_info.rb +155 -0
  33. data/test/{unit/test_babel.rb → test_babel.rb} +161 -26
  34. data/test/{unit/test_common_functions.rb → test_common_functions.rb} +1 -1
  35. data/test/test_exodus.rb +687 -0
  36. data/test/{unit/test_neptune.rb → test_neptune.rb} +28 -17
  37. data/test/{unit/test_app_controller_client.rb → test_neptune_manager_client.rb} +15 -16
  38. data/test/test_task_info.rb +32 -0
  39. data/test/{unit/ts_all.rb → ts_all.rb} +3 -1
  40. metadata +30 -34
  41. data/doc/AppControllerClient.html +0 -702
  42. data/doc/AppControllerException.html +0 -145
  43. data/doc/bin/neptune.html +0 -56
  44. data/doc/js/quicksearch.js +0 -114
  45. data/doc/js/thickbox-compressed.js +0 -10
  46. data/doc/lib/app_controller_client_rb.html +0 -60
  47. data/doc/lib/babel_rb.html +0 -68
  48. data/doc/lib/common_functions_rb.html +0 -70
  49. data/doc/lib/custom_exceptions_rb.html +0 -54
  50. data/doc/lib/neptune_rb.html +0 -60
  51. data/test/integration/tc_c.rb +0 -57
  52. data/test/integration/tc_dfsp.rb +0 -37
  53. data/test/integration/tc_dwssa.rb +0 -38
  54. data/test/integration/tc_erlang.rb +0 -183
  55. data/test/integration/tc_mapreduce.rb +0 -282
  56. data/test/integration/tc_mpi.rb +0 -160
  57. data/test/integration/tc_storage.rb +0 -209
  58. data/test/integration/tc_upc.rb +0 -75
  59. data/test/integration/tc_x10.rb +0 -94
  60. data/test/integration/test_helper.rb +0 -135
  61. data/test/integration/ts_neptune.rb +0 -40
@@ -0,0 +1,696 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class NeptuneManagerClient - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/neptune_manager_client.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link"><a href="Object.html">Object</a>
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-c-new">::new</a>
74
+
75
+ <li><a href="#method-i-compile_code">#compile_code</a>
76
+
77
+ <li><a href="#method-i-does_file_exist-3F">#does_file_exist?</a>
78
+
79
+ <li><a href="#method-i-get_acl">#get_acl</a>
80
+
81
+ <li><a href="#method-i-get_output">#get_output</a>
82
+
83
+ <li><a href="#method-i-get_profiling_info">#get_profiling_info</a>
84
+
85
+ <li><a href="#method-i-get_supported_babel_engines">#get_supported_babel_engines</a>
86
+
87
+ <li><a href="#method-i-make_call">#make_call</a>
88
+
89
+ <li><a href="#method-i-put_input">#put_input</a>
90
+
91
+ <li><a href="#method-i-set_acl">#set_acl</a>
92
+
93
+ <li><a href="#method-i-start_neptune_job">#start_neptune_job</a>
94
+
95
+ </ul>
96
+ </nav>
97
+
98
+ </div>
99
+
100
+ <div id="project-metadata">
101
+
102
+ <nav id="classindex-section" class="section project-section">
103
+ <h3 class="section-header">Class and Module Index</h3>
104
+
105
+ <ul class="link-list">
106
+
107
+ <li><a href="./BabelHelper.html">BabelHelper</a>
108
+
109
+ <li><a href="./BadConfigurationException.html">BadConfigurationException</a>
110
+
111
+ <li><a href="./CommonFunctions.html">CommonFunctions</a>
112
+
113
+ <li><a href="./ExodusHelper.html">ExodusHelper</a>
114
+
115
+ <li><a href="./ExodusTaskInfo.html">ExodusTaskInfo</a>
116
+
117
+ <li><a href="./FileNotFoundException.html">FileNotFoundException</a>
118
+
119
+ <li><a href="./NeptuneHelper.html">NeptuneHelper</a>
120
+
121
+ <li><a href="./NeptuneManagerClient.html">NeptuneManagerClient</a>
122
+
123
+ <li><a href="./NeptuneManagerException.html">NeptuneManagerException</a>
124
+
125
+ <li><a href="./Object.html">Object</a>
126
+
127
+ <li><a href="./TaskInfo.html">TaskInfo</a>
128
+
129
+ </ul>
130
+ </nav>
131
+
132
+ </div>
133
+ </nav>
134
+
135
+ <div id="documentation">
136
+ <h1 class="class">class NeptuneManagerClient</h1>
137
+
138
+ <div id="description" class="description">
139
+
140
+ <p>A client that uses SOAP messages to communicate with the underlying cloud
141
+ platform (here, AppScale). This client is similar to that used in the
142
+ AppScale Tools, but with non-Neptune SOAP calls removed.</p>
143
+
144
+ </div><!-- description -->
145
+
146
+
147
+
148
+
149
+ <section id="5Buntitled-5D" class="documentation-section">
150
+
151
+
152
+
153
+
154
+
155
+ <!-- Constants -->
156
+ <section id="constants-list" class="section">
157
+ <h3 class="section-header">Constants</h3>
158
+ <dl>
159
+
160
+ <dt id="SERVER_PORT">SERVER_PORT
161
+
162
+ <dd class="description"><p>The port that the Neptune Manager runs on, by default.</p>
163
+
164
+
165
+ </dl>
166
+ </section>
167
+
168
+
169
+
170
+ <!-- Attributes -->
171
+ <section id="attribute-method-details" class="method-section section">
172
+ <h3 class="section-header">Attributes</h3>
173
+
174
+
175
+ <div id="attribute-i-conn" class="method-detail">
176
+ <div class="method-heading attribute-method-heading">
177
+ <span class="method-name">conn</span><span
178
+ class="attribute-access-type">[RW]</span>
179
+ </div>
180
+
181
+ <div class="method-description">
182
+
183
+ <p>The SOAP client that we use to communicate with the NeptuneManager.</p>
184
+
185
+ </div>
186
+ </div>
187
+
188
+ <div id="attribute-i-ip" class="method-detail">
189
+ <div class="method-heading attribute-method-heading">
190
+ <span class="method-name">ip</span><span
191
+ class="attribute-access-type">[RW]</span>
192
+ </div>
193
+
194
+ <div class="method-description">
195
+
196
+ <p>The IP address of the NeptuneManager that we will be connecting to.</p>
197
+
198
+ </div>
199
+ </div>
200
+
201
+ <div id="attribute-i-secret" class="method-detail">
202
+ <div class="method-heading attribute-method-heading">
203
+ <span class="method-name">secret</span><span
204
+ class="attribute-access-type">[RW]</span>
205
+ </div>
206
+
207
+ <div class="method-description">
208
+
209
+ <p>The secret string that is used to authenticate this client with
210
+ NeptuneManagers. It is initially generated by appscale-run-instances and
211
+ can be found on the machine that ran that tool, or on any AppScale machine.</p>
212
+
213
+ </div>
214
+ </div>
215
+
216
+ </section><!-- attribute-method-details -->
217
+
218
+
219
+ <!-- Methods -->
220
+
221
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
222
+ <h3 class="section-header">Public Instance Methods</h3>
223
+
224
+
225
+ <div id="method-i-compile_code" class="method-detail ">
226
+
227
+ <div class="method-heading">
228
+ <span class="method-name">compile_code</span><span
229
+ class="method-args">(job_data)</span>
230
+ <span class="method-click-advice">click to toggle source</span>
231
+ </div>
232
+
233
+
234
+ <div class="method-description">
235
+
236
+ <p>Instructs the NeptuneManager to fetch the code specified and compile it.
237
+ The result should then be placed in a location specified in the job data.</p>
238
+
239
+
240
+
241
+ <div class="method-source-code" id="compile_code-source">
242
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 183</span>
243
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">compile_code</span>(<span class="ruby-identifier">job_data</span>)
244
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
245
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
246
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">compile_code</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
247
+ }
248
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rError:/</span>
249
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
250
+ <span class="ruby-keyword">end</span></pre>
251
+ </div><!-- compile_code-source -->
252
+
253
+ </div>
254
+
255
+
256
+
257
+
258
+ </div><!-- compile_code-method -->
259
+
260
+
261
+ <div id="method-i-does_file_exist-3F" class="method-detail ">
262
+
263
+ <div class="method-heading">
264
+ <span class="method-name">does_file_exist?</span><span
265
+ class="method-args">(file, job_data)</span>
266
+ <span class="method-click-advice">click to toggle source</span>
267
+ </div>
268
+
269
+
270
+ <div class="method-description">
271
+
272
+ <p>Asks the NeptuneManager to see if the given file exists in the remote
273
+ datastore. If extra credentials are needed for this operation, they are
274
+ searched for within the job data.</p>
275
+
276
+
277
+
278
+ <div class="method-source-code" id="does_file_exist-3F-source">
279
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 208</span>
280
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">does_file_exist?</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">job_data</span>)
281
+ <span class="ruby-identifier">result</span> = <span class="ruby-keyword">false</span>
282
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
283
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">does_file_exist</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
284
+ }
285
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
286
+ <span class="ruby-keyword">end</span></pre>
287
+ </div><!-- does_file_exist-3F-source -->
288
+
289
+ </div>
290
+
291
+
292
+
293
+
294
+ </div><!-- does_file_exist-3F-method -->
295
+
296
+
297
+ <div id="method-i-get_acl" class="method-detail ">
298
+
299
+ <div class="method-heading">
300
+ <span class="method-name">get_acl</span><span
301
+ class="method-args">(job_data)</span>
302
+ <span class="method-click-advice">click to toggle source</span>
303
+ </div>
304
+
305
+
306
+ <div class="method-description">
307
+
308
+ <p>Returns the ACL associated with the named piece of data stored in the
309
+ underlying cloud platform. Right now, data can only be public or private,
310
+ but future versions will add individual user support. Input, output, and
311
+ exceptions mirror that of start_neptune_job.</p>
312
+
313
+
314
+
315
+ <div class="method-source-code" id="get_acl-source">
316
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 156</span>
317
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_acl</span>(<span class="ruby-identifier">job_data</span>)
318
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
319
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
320
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">get_acl</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
321
+ }
322
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rError:/</span>
323
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
324
+ <span class="ruby-keyword">end</span></pre>
325
+ </div><!-- get_acl-source -->
326
+
327
+ </div>
328
+
329
+
330
+
331
+
332
+ </div><!-- get_acl-method -->
333
+
334
+
335
+ <div id="method-i-get_output" class="method-detail ">
336
+
337
+ <div class="method-heading">
338
+ <span class="method-name">get_output</span><span
339
+ class="method-args">(job_data)</span>
340
+ <span class="method-click-advice">click to toggle source</span>
341
+ </div>
342
+
343
+
344
+ <div class="method-description">
345
+
346
+ <p>Retrieves the output of a Neptune job, stored in an underlying database.
347
+ Within AppScale, a special application runs, referred to as the Repository,
348
+ which provides a key-value interface to Neptune job data. Data is stored as
349
+ though it were on a file system, therefore output be of the usual form
350
+ /folder/filename . Currently the contents of the file is returned as a
351
+ string to the caller, but as this may be inefficient for non-trivial output
352
+ jobs, the next version of Neptune will add an additional call to directly
353
+ copy the output to a file on the local filesystem. See <a
354
+ href="NeptuneManagerClient.html#method-i-start_neptune_job">#start_neptune_job</a>
355
+ for conditions by which this method can raise NeptuneManagerException.new
356
+ as well as the input format used for job_data.</p>
357
+
358
+
359
+
360
+ <div class="method-source-code" id="get_output-source">
361
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 141</span>
362
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_output</span>(<span class="ruby-identifier">job_data</span>)
363
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
364
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
365
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">get_output</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
366
+ }
367
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rError:/</span>
368
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
369
+ <span class="ruby-keyword">end</span></pre>
370
+ </div><!-- get_output-source -->
371
+
372
+ </div>
373
+
374
+
375
+
376
+
377
+ </div><!-- get_output-method -->
378
+
379
+
380
+ <div id="method-i-get_profiling_info" class="method-detail ">
381
+
382
+ <div class="method-heading">
383
+ <span class="method-name">get_profiling_info</span><span
384
+ class="method-args">(key)</span>
385
+ <span class="method-click-advice">click to toggle source</span>
386
+ </div>
387
+
388
+
389
+ <div class="method-description">
390
+
391
+
392
+
393
+
394
+
395
+ <div class="method-source-code" id="get_profiling_info-source">
396
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 217</span>
397
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_profiling_info</span>(<span class="ruby-identifier">key</span>)
398
+ <span class="ruby-identifier">result</span> = {}
399
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
400
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">get_profiling_info</span>(<span class="ruby-identifier">key</span>, <span class="ruby-ivar">@secret</span>)
401
+ }
402
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
403
+ <span class="ruby-keyword">end</span></pre>
404
+ </div><!-- get_profiling_info-source -->
405
+
406
+ </div>
407
+
408
+
409
+
410
+
411
+ </div><!-- get_profiling_info-method -->
412
+
413
+
414
+ <div id="method-i-get_supported_babel_engines" class="method-detail ">
415
+
416
+ <div class="method-heading">
417
+ <span class="method-name">get_supported_babel_engines</span><span
418
+ class="method-args">(job_data)</span>
419
+ <span class="method-click-advice">click to toggle source</span>
420
+ </div>
421
+
422
+
423
+ <div class="method-description">
424
+
425
+ <p>Asks the NeptuneManager for a list of all the Babel engines (each of which
426
+ is a queue to store jobs and something that executes tasks) that are
427
+ supported for the given credentials.</p>
428
+
429
+
430
+
431
+ <div class="method-source-code" id="get_supported_babel_engines-source">
432
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 196</span>
433
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_supported_babel_engines</span>(<span class="ruby-identifier">job_data</span>)
434
+ <span class="ruby-identifier">result</span> = []
435
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
436
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">get_supported_babel_engines</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
437
+ }
438
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
439
+ <span class="ruby-keyword">end</span></pre>
440
+ </div><!-- get_supported_babel_engines-source -->
441
+
442
+ </div>
443
+
444
+
445
+
446
+
447
+ </div><!-- get_supported_babel_engines-method -->
448
+
449
+
450
+ <div id="method-i-make_call" class="method-detail ">
451
+
452
+ <div class="method-heading">
453
+ <span class="method-name">make_call</span><span
454
+ class="method-args">(time, retry_on_except) { || ... }</span>
455
+ <span class="method-click-advice">click to toggle source</span>
456
+ </div>
457
+
458
+
459
+ <div class="method-description">
460
+
461
+ <p>A helper method to make SOAP calls for us. This method is mainly here to
462
+ reduce code duplication: all SOAP calls expect a certain timeout and can
463
+ tolerate certain exceptions, so we consolidate this code into this method.
464
+ Here, the caller specifies the timeout for the SOAP call (or NO_TIMEOUT if
465
+ an infinite timeout is required) as well as whether the call should be
466
+ retried in the face of exceptions. Exceptions can occur if the machine is
467
+ not yet running or is too busy to handle the request, so these exceptions
468
+ are automatically retried regardless of the retry value. Typically callers
469
+ set this to false to catch ‘Connection Refused’ exceptions or the like.
470
+ Finally, the caller must provide a block of code that indicates the SOAP
471
+ call to make: this is really all that differs between the calling methods.
472
+ The result of the block is returned to the caller.</p>
473
+
474
+
475
+
476
+ <div class="method-source-code" id="make_call-source">
477
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 75</span>
478
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">make_call</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">retry_on_except</span>)
479
+ <span class="ruby-keyword">begin</span>
480
+ <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">time</span>) {
481
+ <span class="ruby-keyword">yield</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
482
+ }
483
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span>
484
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">retry_on_except</span>
485
+ <span class="ruby-keyword">retry</span>
486
+ <span class="ruby-keyword">else</span>
487
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;Connection was refused. Is the NeptuneManager running?&quot;</span>)
488
+ <span class="ruby-keyword">end</span>
489
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSLError</span>, <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
490
+ <span class="ruby-keyword">retry</span>
491
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">except</span>
492
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">retry_on_except</span>
493
+ <span class="ruby-keyword">retry</span>
494
+ <span class="ruby-keyword">else</span>
495
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;We saw an unexpected error of the type #{except.class} talking to #{@ip} with the following message:\n#{except}.&quot;</span>)
496
+ <span class="ruby-keyword">end</span>
497
+ <span class="ruby-keyword">end</span>
498
+ <span class="ruby-keyword">end</span></pre>
499
+ </div><!-- make_call-source -->
500
+
501
+ </div>
502
+
503
+
504
+
505
+
506
+ </div><!-- make_call-method -->
507
+
508
+
509
+ <div id="method-i-put_input" class="method-detail ">
510
+
511
+ <div class="method-heading">
512
+ <span class="method-name">put_input</span><span
513
+ class="method-args">(job_data)</span>
514
+ <span class="method-click-advice">click to toggle source</span>
515
+ </div>
516
+
517
+
518
+ <div class="method-description">
519
+
520
+ <p>Stores a file stored on the user’s local file system in the underlying
521
+ database. The user can specify to use either the underlying database that
522
+ AppScale is using, or alternative storage mechanisms (as of writing, Google
523
+ Storage, Amazon S3, and Eucalyptus Walrus are supported) via the storage
524
+ parameter.</p>
525
+
526
+
527
+
528
+ <div class="method-source-code" id="put_input-source">
529
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 121</span>
530
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">put_input</span>(<span class="ruby-identifier">job_data</span>)
531
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
532
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
533
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">put_input</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
534
+ }
535
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rError:/</span>
536
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
537
+ <span class="ruby-keyword">end</span></pre>
538
+ </div><!-- put_input-source -->
539
+
540
+ </div>
541
+
542
+
543
+
544
+
545
+ </div><!-- put_input-method -->
546
+
547
+
548
+ <div id="method-i-set_acl" class="method-detail ">
549
+
550
+ <div class="method-heading">
551
+ <span class="method-name">set_acl</span><span
552
+ class="method-args">(job_data)</span>
553
+ <span class="method-click-advice">click to toggle source</span>
554
+ </div>
555
+
556
+
557
+ <div class="method-description">
558
+
559
+ <p>Sets the ACL of a specified pieces of data stored in the underlying cloud
560
+ platform. As is the case with <a
561
+ href="NeptuneManagerClient.html#method-i-get_acl">#get_acl</a>, ACLs can be
562
+ either public or private right now, but this will be expanded upon in the
563
+ future. As with the other SOAP calls, input, output, and exceptions mirror
564
+ that of start_neptune_job.</p>
565
+
566
+
567
+
568
+ <div class="method-source-code" id="set_acl-source">
569
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 171</span>
570
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">set_acl</span>(<span class="ruby-identifier">job_data</span>)
571
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
572
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
573
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">set_acl</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
574
+ }
575
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rError:/</span>
576
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
577
+ <span class="ruby-keyword">end</span></pre>
578
+ </div><!-- set_acl-source -->
579
+
580
+ </div>
581
+
582
+
583
+
584
+
585
+ </div><!-- set_acl-method -->
586
+
587
+
588
+ <div id="method-i-start_neptune_job" class="method-detail ">
589
+
590
+ <div class="method-heading">
591
+ <span class="method-name">start_neptune_job</span><span
592
+ class="method-args">(job_data)</span>
593
+ <span class="method-click-advice">click to toggle source</span>
594
+ </div>
595
+
596
+
597
+ <div class="method-description">
598
+
599
+ <p>Initiates the start of a Neptune job, whether it be a HPC job (MPI, X10, or
600
+ MapReduce), or a scaling job (e.g., for AppScale itself). This method
601
+ should not be used for retrieving the output of a job or getting / setting
602
+ output ACLs, but just for starting new HPC / scaling jobs. This method
603
+ takes a hash containing the parameters of the job to run, and can raise
604
+ NeptuneManagerException.new if the NeptuneManager it calls returns an error
605
+ (e.g., if a bad secret is used or the machine isn’t running). Otherwise,
606
+ the return value of this method is the result returned from the
607
+ NeptuneManager.</p>
608
+
609
+
610
+
611
+ <div class="method-source-code" id="start_neptune_job-source">
612
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 106</span>
613
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">start_neptune_job</span>(<span class="ruby-identifier">job_data</span>)
614
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
615
+ <span class="ruby-identifier">make_call</span>(<span class="ruby-constant">NO_TIMEOUT</span>, <span class="ruby-keyword">false</span>) {
616
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">start_job</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-ivar">@secret</span>)
617
+ }
618
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NeptuneManagerException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rError:/</span>
619
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
620
+ <span class="ruby-keyword">end</span></pre>
621
+ </div><!-- start_neptune_job-source -->
622
+
623
+ </div>
624
+
625
+
626
+
627
+
628
+ </div><!-- start_neptune_job-method -->
629
+
630
+
631
+ </section><!-- public-instance-method-details -->
632
+
633
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
634
+ <h3 class="section-header">Public Class Methods</h3>
635
+
636
+
637
+ <div id="method-c-new" class="method-detail ">
638
+
639
+ <div class="method-heading">
640
+ <span class="method-name">new</span><span
641
+ class="method-args">(ip, secret)</span>
642
+ <span class="method-click-advice">click to toggle source</span>
643
+ </div>
644
+
645
+
646
+ <div class="method-description">
647
+
648
+ <p>A constructor that requires both the IP address of the machine to
649
+ communicate with as well as the secret (string) needed to perform
650
+ communication. NeptuneManagers will reject SOAP calls if this secret
651
+ (basically a password) is not present - it can be found in the user’s
652
+ .appscale directory, and a helper method is usually present to fetch this
653
+ for us.</p>
654
+
655
+
656
+
657
+ <div class="method-source-code" id="new-source">
658
+ <pre><span class="ruby-comment"># File lib/neptune_manager_client.rb, line 45</span>
659
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ip</span>, <span class="ruby-identifier">secret</span>)
660
+ <span class="ruby-ivar">@ip</span> = <span class="ruby-identifier">ip</span>
661
+ <span class="ruby-ivar">@secret</span> = <span class="ruby-identifier">secret</span>
662
+
663
+ <span class="ruby-ivar">@conn</span> = <span class="ruby-constant">SOAP</span><span class="ruby-operator">::</span><span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">Driver</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;https://#{@ip}:#{SERVER_PORT}&quot;</span>)
664
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;start_job&quot;</span>, <span class="ruby-string">&quot;jobs&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
665
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;put_input&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
666
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;get_output&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
667
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;get_acl&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
668
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;set_acl&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
669
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;compile_code&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
670
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;get_supported_babel_engines&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
671
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;does_file_exist&quot;</span>, <span class="ruby-string">&quot;file&quot;</span>, <span class="ruby-string">&quot;job_data&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
672
+ <span class="ruby-ivar">@conn</span>.<span class="ruby-identifier">add_method</span>(<span class="ruby-string">&quot;get_profiling_info&quot;</span>, <span class="ruby-string">&quot;key&quot;</span>, <span class="ruby-string">&quot;secret&quot;</span>)
673
+ <span class="ruby-keyword">end</span></pre>
674
+ </div><!-- new-source -->
675
+
676
+ </div>
677
+
678
+
679
+
680
+
681
+ </div><!-- new-method -->
682
+
683
+
684
+ </section><!-- public-class-method-details -->
685
+
686
+ </section><!-- 5Buntitled-5D -->
687
+
688
+ </div><!-- documentation -->
689
+
690
+
691
+ <footer id="validator-badges">
692
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
693
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
694
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
695
+ </footer>
696
+