pho 0.3 → 0.4
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.
- data/CHANGES +9 -0
- data/Rakefile +2 -1
- data/bin/talis_store +263 -0
- data/doc/rdoc/classes/Pho.html +3 -21
- data/doc/rdoc/classes/Pho/Analyzers.html +22 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +42 -10
- data/doc/rdoc/classes/Pho/Etags.html +102 -30
- data/doc/rdoc/classes/Pho/Facet/Results.html +81 -7
- data/doc/rdoc/classes/Pho/Facet/Term.html +13 -2
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +233 -30
- data/doc/rdoc/classes/Pho/FieldWeighting.html +38 -10
- data/doc/rdoc/classes/Pho/Job.html +488 -9
- data/doc/rdoc/classes/Pho/JobUpdate.html +141 -0
- data/doc/rdoc/classes/Pho/Jobs.html +538 -0
- data/doc/rdoc/classes/Pho/Namespaces.html +33 -2
- data/doc/rdoc/classes/Pho/QueryProfile.html +162 -20
- data/doc/rdoc/classes/Pho/RDFCollection.html +200 -60
- data/doc/rdoc/classes/Pho/Snapshot.html +162 -36
- data/doc/rdoc/classes/Pho/Status.html +59 -8
- data/doc/rdoc/classes/Pho/Store.html +589 -253
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +24 -1
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/job_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/snapshot_rb.html +2 -1
- data/doc/rdoc/files/lib/pho/status_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +2 -1
- data/doc/rdoc/fr_class_index.html +2 -0
- data/doc/rdoc/fr_method_index.html +85 -68
- data/lib/pho.rb +18 -10
- data/lib/pho/field_predicate_map.rb +6 -1
- data/lib/pho/job.rb +326 -6
- data/lib/pho/snapshot.rb +46 -19
- data/lib/pho/store.rb +22 -56
- data/tests/tc_job.rb +262 -0
- data/tests/tc_jobcontrol.rb +159 -12
- data/tests/tc_snapshots.rb +57 -28
- data/tests/ts_pho.rb +1 -0
- metadata +9 -110
- data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000034.html +0 -21
- data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000035.html +0 -29
- data/doc/rdoc/classes/Pho/Etags.src/M000088.html +0 -23
- data/doc/rdoc/classes/Pho/Etags.src/M000089.html +0 -28
- data/doc/rdoc/classes/Pho/Etags.src/M000090.html +0 -21
- data/doc/rdoc/classes/Pho/Etags.src/M000091.html +0 -18
- data/doc/rdoc/classes/Pho/Etags.src/M000092.html +0 -18
- data/doc/rdoc/classes/Pho/Etags.src/M000093.html +0 -18
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000001.html +0 -20
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000002.html +0 -27
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000003.html +0 -54
- data/doc/rdoc/classes/Pho/Facet/Term.src/M000004.html +0 -20
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000005.html +0 -38
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000006.html +0 -28
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000007.html +0 -20
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000008.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000009.html +0 -23
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000010.html +0 -23
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000011.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000012.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000013.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000014.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000015.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000016.html +0 -21
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000017.html +0 -21
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000018.html +0 -38
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000019.html +0 -18
- data/doc/rdoc/classes/Pho/FieldWeighting.src/M000075.html +0 -20
- data/doc/rdoc/classes/Pho/FieldWeighting.src/M000076.html +0 -26
- data/doc/rdoc/classes/Pho/Job.src/M000074.html +0 -21
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000024.html +0 -39
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000025.html +0 -24
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000026.html +0 -20
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000027.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000028.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000029.html +0 -21
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000030.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000031.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000032.html +0 -38
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000033.html +0 -18
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000077.html +0 -23
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000078.html +0 -22
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000079.html +0 -24
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000080.html +0 -23
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000081.html +0 -18
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000082.html +0 -22
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000083.html +0 -22
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000084.html +0 -26
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000085.html +0 -23
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000086.html +0 -18
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000087.html +0 -18
- data/doc/rdoc/classes/Pho/Snapshot.src/M000070.html +0 -31
- data/doc/rdoc/classes/Pho/Snapshot.src/M000071.html +0 -21
- data/doc/rdoc/classes/Pho/Snapshot.src/M000072.html +0 -18
- data/doc/rdoc/classes/Pho/Snapshot.src/M000073.html +0 -37
- data/doc/rdoc/classes/Pho/Status.src/M000020.html +0 -20
- data/doc/rdoc/classes/Pho/Status.src/M000021.html +0 -31
- data/doc/rdoc/classes/Pho/Status.src/M000022.html +0 -18
- data/doc/rdoc/classes/Pho/Status.src/M000023.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000036.html +0 -22
- data/doc/rdoc/classes/Pho/Store.src/M000037.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000038.html +0 -25
- data/doc/rdoc/classes/Pho/Store.src/M000039.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000040.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000041.html +0 -28
- data/doc/rdoc/classes/Pho/Store.src/M000042.html +0 -23
- data/doc/rdoc/classes/Pho/Store.src/M000043.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000044.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000045.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000046.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000047.html +0 -23
- data/doc/rdoc/classes/Pho/Store.src/M000048.html +0 -22
- data/doc/rdoc/classes/Pho/Store.src/M000049.html +0 -26
- data/doc/rdoc/classes/Pho/Store.src/M000050.html +0 -24
- data/doc/rdoc/classes/Pho/Store.src/M000051.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000052.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000053.html +0 -25
- data/doc/rdoc/classes/Pho/Store.src/M000054.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000055.html +0 -30
- data/doc/rdoc/classes/Pho/Store.src/M000056.html +0 -21
- data/doc/rdoc/classes/Pho/Store.src/M000057.html +0 -23
- data/doc/rdoc/classes/Pho/Store.src/M000058.html +0 -28
- data/doc/rdoc/classes/Pho/Store.src/M000059.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000060.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000061.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000062.html +0 -31
- data/doc/rdoc/classes/Pho/Store.src/M000063.html +0 -21
- data/doc/rdoc/classes/Pho/Store.src/M000064.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000065.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000066.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000067.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000068.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000069.html +0 -20
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: Pho::JobUpdate</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Pho::JobUpdate</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/pho/job_rb.html">
|
|
59
|
+
lib/pho/job.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
Simple object encapsulating the status message and time for a job update
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<!-- if includes -->
|
|
96
|
+
|
|
97
|
+
<div id="section">
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
<div id="attribute-list">
|
|
104
|
+
<h3 class="section-bar">Attributes</h3>
|
|
105
|
+
|
|
106
|
+
<div class="name-list">
|
|
107
|
+
<table>
|
|
108
|
+
<tr class="top-aligned-row context-row">
|
|
109
|
+
<td class="context-item-name">message</td>
|
|
110
|
+
<td class="context-item-value"> [RW] </td>
|
|
111
|
+
<td class="context-item-desc">
|
|
112
|
+
the status message
|
|
113
|
+
|
|
114
|
+
</td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr class="top-aligned-row context-row">
|
|
117
|
+
<td class="context-item-name">time</td>
|
|
118
|
+
<td class="context-item-value"> [RW] </td>
|
|
119
|
+
<td class="context-item-desc">
|
|
120
|
+
the time at which the update was logged
|
|
121
|
+
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</table>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
<!-- if method_list -->
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
<div id="validator-badges">
|
|
137
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
</body>
|
|
141
|
+
</html>
|
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: Pho::Jobs</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Pho::Jobs</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/pho/job_rb.html">
|
|
59
|
+
lib/pho/job.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
TODO job deletion
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div id="method-list">
|
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
|
93
|
+
|
|
94
|
+
<div class="name-list">
|
|
95
|
+
<a href="#M000040">build_job_request</a>
|
|
96
|
+
<a href="#M000034">read_from_store</a>
|
|
97
|
+
<a href="#M000039">submit_job</a>
|
|
98
|
+
<a href="#M000036">submit_reindex</a>
|
|
99
|
+
<a href="#M000035">submit_reset</a>
|
|
100
|
+
<a href="#M000038">submit_restore</a>
|
|
101
|
+
<a href="#M000037">submit_snapshot</a>
|
|
102
|
+
<a href="#M000042">wait_for</a>
|
|
103
|
+
<a href="#M000041">wait_for_submitted</a>
|
|
104
|
+
<a href="#M000043">yield_job_update</a>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
<!-- if includes -->
|
|
112
|
+
|
|
113
|
+
<div id="section">
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<div id="constants-list">
|
|
117
|
+
<h3 class="section-bar">Constants</h3>
|
|
118
|
+
|
|
119
|
+
<div class="name-list">
|
|
120
|
+
<table summary="Constants">
|
|
121
|
+
<tr class="top-aligned-row context-row">
|
|
122
|
+
<td class="context-item-name">RESET</td>
|
|
123
|
+
<td>=</td>
|
|
124
|
+
<td class="context-item-value">"http://schemas.talis.com/2006/bigfoot/configuration#ResetDataJob".freeze</td>
|
|
125
|
+
</tr>
|
|
126
|
+
<tr class="top-aligned-row context-row">
|
|
127
|
+
<td class="context-item-name">SNAPSHOT</td>
|
|
128
|
+
<td>=</td>
|
|
129
|
+
<td class="context-item-value">"http://schemas.talis.com/2006/bigfoot/configuration#SnapshotJob".freeze</td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr class="top-aligned-row context-row">
|
|
132
|
+
<td class="context-item-name">REINDEX</td>
|
|
133
|
+
<td>=</td>
|
|
134
|
+
<td class="context-item-value">"http://schemas.talis.com/2006/bigfoot/configuration#ReindexJob".freeze</td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr class="top-aligned-row context-row">
|
|
137
|
+
<td class="context-item-name">RESTORE</td>
|
|
138
|
+
<td>=</td>
|
|
139
|
+
<td class="context-item-value">"http://schemas.talis.com/2006/bigfoot/configuration#RestoreJob".freeze</td>
|
|
140
|
+
</tr>
|
|
141
|
+
</table>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<!-- if method_list -->
|
|
151
|
+
<div id="methods">
|
|
152
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
153
|
+
|
|
154
|
+
<div id="method-M000040" class="method-detail">
|
|
155
|
+
<a name="M000040"></a>
|
|
156
|
+
|
|
157
|
+
<div class="method-heading">
|
|
158
|
+
<a href="#M000040" class="method-signature">
|
|
159
|
+
<span class="method-name">build_job_request</span><span class="method-args">(type, label, t=Time.now, snapshot_uri=nil)</span>
|
|
160
|
+
</a>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="method-description">
|
|
164
|
+
<p>
|
|
165
|
+
Construct an RDF/XML document containing a job request for submitting to
|
|
166
|
+
the Platform.
|
|
167
|
+
</p>
|
|
168
|
+
<table>
|
|
169
|
+
<tr><td valign="top">t:</td><td>a Time object, specifying the time at which the request should be carried
|
|
170
|
+
out
|
|
171
|
+
|
|
172
|
+
</td></tr>
|
|
173
|
+
</table>
|
|
174
|
+
<p><a class="source-toggle" href="#"
|
|
175
|
+
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
|
176
|
+
<div class="method-source-code" id="M000040-source">
|
|
177
|
+
<pre>
|
|
178
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 79</span>
|
|
179
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">build_job_request</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-identifier">snapshot_uri</span>=<span class="ruby-keyword kw">nil</span>)
|
|
180
|
+
|
|
181
|
+
<span class="ruby-identifier">time</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">getutc</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">"%Y-%m-%dT%H:%M:%SZ"</span>)
|
|
182
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-value str">"<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" "</span>
|
|
183
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" "</span>
|
|
184
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" xmlns:bf=\"http://schemas.talis.com/2006/bigfoot/configuration#\"> "</span>
|
|
185
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" <bf:JobRequest>"</span>
|
|
186
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdfs:label>#{label}</rdfs:label>"</span>
|
|
187
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <bf:jobType rdf:resource=\"#{type}\"/>"</span>
|
|
188
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <bf:startTime>#{time}</bf:startTime>"</span>
|
|
189
|
+
|
|
190
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">snapshot_uri</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
|
|
191
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <bf:snapshotUri rdf:resource=\"#{snapshot_uri}\"/>"</span>
|
|
192
|
+
<span class="ruby-keyword kw">end</span>
|
|
193
|
+
|
|
194
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" </bf:JobRequest>"</span>
|
|
195
|
+
<span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</rdf:RDF>"</span>
|
|
196
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">data</span>
|
|
197
|
+
<span class="ruby-keyword kw">end</span>
|
|
198
|
+
</pre>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div id="method-M000034" class="method-detail">
|
|
204
|
+
<a name="M000034"></a>
|
|
205
|
+
|
|
206
|
+
<div class="method-heading">
|
|
207
|
+
<a href="#M000034" class="method-signature">
|
|
208
|
+
<span class="method-name">read_from_store</span><span class="method-args">(store)</span>
|
|
209
|
+
</a>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<div class="method-description">
|
|
213
|
+
<p>
|
|
214
|
+
Reads the current list of scheduled jobs from the provided store. Returns
|
|
215
|
+
an array of job names
|
|
216
|
+
</p>
|
|
217
|
+
<pre>
|
|
218
|
+
store:: store from which to read the scheduled job list
|
|
219
|
+
</pre>
|
|
220
|
+
<p><a class="source-toggle" href="#"
|
|
221
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
|
222
|
+
<div class="method-source-code" id="M000034-source">
|
|
223
|
+
<pre>
|
|
224
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 16</span>
|
|
225
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
|
226
|
+
<span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">get_jobs</span>()
|
|
227
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">200</span>
|
|
228
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unable to read jobs from store. Status was {resp.status}"</span>
|
|
229
|
+
<span class="ruby-keyword kw">end</span>
|
|
230
|
+
<span class="ruby-identifier">jobs</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
|
231
|
+
|
|
232
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span>)
|
|
233
|
+
<span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">each</span>(<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">"//bf:job"</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
|
|
234
|
+
<span class="ruby-identifier">jobs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">el</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"rdf:resource"</span>]
|
|
235
|
+
<span class="ruby-keyword kw">end</span>
|
|
236
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">jobs</span>
|
|
237
|
+
|
|
238
|
+
<span class="ruby-keyword kw">end</span>
|
|
239
|
+
</pre>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div id="method-M000039" class="method-detail">
|
|
245
|
+
<a name="M000039"></a>
|
|
246
|
+
|
|
247
|
+
<div class="method-heading">
|
|
248
|
+
<a href="#M000039" class="method-signature">
|
|
249
|
+
<span class="method-name">submit_job</span><span class="method-args">(store, jobtype, label, t=Time.now, snapshot_uri=nil)</span>
|
|
250
|
+
</a>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<div class="method-description">
|
|
254
|
+
<p>
|
|
255
|
+
Generic submit job method
|
|
256
|
+
</p>
|
|
257
|
+
<p><a class="source-toggle" href="#"
|
|
258
|
+
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
|
259
|
+
<div class="method-source-code" id="M000039-source">
|
|
260
|
+
<pre>
|
|
261
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 72</span>
|
|
262
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">jobtype</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-identifier">snapshot_uri</span>=<span class="ruby-keyword kw">nil</span>)
|
|
263
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">submit_job</span>( <span class="ruby-identifier">build_job_request</span>(<span class="ruby-identifier">jobtype</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>, <span class="ruby-identifier">snapshot_uri</span>) )
|
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
|
265
|
+
</pre>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div id="method-M000036" class="method-detail">
|
|
271
|
+
<a name="M000036"></a>
|
|
272
|
+
|
|
273
|
+
<div class="method-heading">
|
|
274
|
+
<a href="#M000036" class="method-signature">
|
|
275
|
+
<span class="method-name">submit_reindex</span><span class="method-args">(store, label="Reindex my store", t=Time.now)</span>
|
|
276
|
+
</a>
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div class="method-description">
|
|
280
|
+
<p>
|
|
281
|
+
Submit a reindex job to the Platform
|
|
282
|
+
</p>
|
|
283
|
+
<p>
|
|
284
|
+
This method submits the job, and will return an HTTP:Message indicating the
|
|
285
|
+
response from the Platform. Client code should check this for success. As
|
|
286
|
+
job processing may not be immediate, clients should determine the URI of
|
|
287
|
+
the newly created job and then monitor the jobs status if they need to wait
|
|
288
|
+
for the job to finish.
|
|
289
|
+
</p>
|
|
290
|
+
<p><a class="source-toggle" href="#"
|
|
291
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
292
|
+
<div class="method-source-code" id="M000036-source">
|
|
293
|
+
<pre>
|
|
294
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 47</span>
|
|
295
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">submit_reindex</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">label</span>=<span class="ruby-value str">"Reindex my store"</span>, <span class="ruby-identifier">t</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>)
|
|
296
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">store</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Jobs</span><span class="ruby-operator">::</span><span class="ruby-constant">REINDEX</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>)
|
|
297
|
+
<span class="ruby-keyword kw">end</span>
|
|
298
|
+
</pre>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div id="method-M000035" class="method-detail">
|
|
304
|
+
<a name="M000035"></a>
|
|
305
|
+
|
|
306
|
+
<div class="method-heading">
|
|
307
|
+
<a href="#M000035" class="method-signature">
|
|
308
|
+
<span class="method-name">submit_reset</span><span class="method-args">(store, label="Reset my store", t=Time.now)</span>
|
|
309
|
+
</a>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
<div class="method-description">
|
|
313
|
+
<p>
|
|
314
|
+
Submit a reset job to the Platform
|
|
315
|
+
</p>
|
|
316
|
+
<p>
|
|
317
|
+
This method submits the job, and will return an HTTP:Message indicating the
|
|
318
|
+
response from the Platform. Client code should check this for success. As
|
|
319
|
+
job processing may not be immediate, clients should determine the URI of
|
|
320
|
+
the newly created job and then monitor the jobs status if they need to wait
|
|
321
|
+
for the job to finish.
|
|
322
|
+
</p>
|
|
323
|
+
<p><a class="source-toggle" href="#"
|
|
324
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
|
325
|
+
<div class="method-source-code" id="M000035-source">
|
|
326
|
+
<pre>
|
|
327
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 37</span>
|
|
328
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">submit_reset</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">label</span>=<span class="ruby-value str">"Reset my store"</span>, <span class="ruby-identifier">t</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>)
|
|
329
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">store</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Jobs</span><span class="ruby-operator">::</span><span class="ruby-constant">RESET</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>)
|
|
330
|
+
<span class="ruby-keyword kw">end</span>
|
|
331
|
+
</pre>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
<div id="method-M000038" class="method-detail">
|
|
337
|
+
<a name="M000038"></a>
|
|
338
|
+
|
|
339
|
+
<div class="method-heading">
|
|
340
|
+
<a href="#M000038" class="method-signature">
|
|
341
|
+
<span class="method-name">submit_restore</span><span class="method-args">(store, snapshot_uri, label="Restore my snapshot", t=Time.now)</span>
|
|
342
|
+
</a>
|
|
343
|
+
</div>
|
|
344
|
+
|
|
345
|
+
<div class="method-description">
|
|
346
|
+
<p>
|
|
347
|
+
Submit a restore job to the Platform
|
|
348
|
+
</p>
|
|
349
|
+
<p>
|
|
350
|
+
This method submits the job, and will return an HTTP:Message indicating the
|
|
351
|
+
response from the Platform. Client code should check this for success. As
|
|
352
|
+
job processing may not be immediate, clients should determine the URI of
|
|
353
|
+
the newly created job and then monitor the jobs status if they need to wait
|
|
354
|
+
for the job to finish.
|
|
355
|
+
</p>
|
|
356
|
+
<p><a class="source-toggle" href="#"
|
|
357
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
|
358
|
+
<div class="method-source-code" id="M000038-source">
|
|
359
|
+
<pre>
|
|
360
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 67</span>
|
|
361
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">submit_restore</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">snapshot_uri</span>, <span class="ruby-identifier">label</span>=<span class="ruby-value str">"Restore my snapshot"</span>, <span class="ruby-identifier">t</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>)
|
|
362
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">store</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Jobs</span><span class="ruby-operator">::</span><span class="ruby-constant">RESTORE</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>, <span class="ruby-identifier">snapshot_uri</span>)
|
|
363
|
+
<span class="ruby-keyword kw">end</span>
|
|
364
|
+
</pre>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div id="method-M000037" class="method-detail">
|
|
370
|
+
<a name="M000037"></a>
|
|
371
|
+
|
|
372
|
+
<div class="method-heading">
|
|
373
|
+
<a href="#M000037" class="method-signature">
|
|
374
|
+
<span class="method-name">submit_snapshot</span><span class="method-args">(store, label="Snapshot my store", t=Time.now)</span>
|
|
375
|
+
</a>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<div class="method-description">
|
|
379
|
+
<p>
|
|
380
|
+
Submit a snapshot job to the Platform
|
|
381
|
+
</p>
|
|
382
|
+
<p>
|
|
383
|
+
This method submits the job, and will return an HTTP:Message indicating the
|
|
384
|
+
response from the Platform. Client code should check this for success. As
|
|
385
|
+
job processing may not be immediate, clients should determine the URI of
|
|
386
|
+
the newly created job and then monitor the jobs status if they need to wait
|
|
387
|
+
for the job to finish.
|
|
388
|
+
</p>
|
|
389
|
+
<p><a class="source-toggle" href="#"
|
|
390
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
|
391
|
+
<div class="method-source-code" id="M000037-source">
|
|
392
|
+
<pre>
|
|
393
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 57</span>
|
|
394
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">submit_snapshot</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">label</span>=<span class="ruby-value str">"Snapshot my store"</span>, <span class="ruby-identifier">t</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>)
|
|
395
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">store</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Jobs</span><span class="ruby-operator">::</span><span class="ruby-constant">SNAPSHOT</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">t</span>)
|
|
396
|
+
<span class="ruby-keyword kw">end</span>
|
|
397
|
+
</pre>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
<div id="method-M000042" class="method-detail">
|
|
403
|
+
<a name="M000042"></a>
|
|
404
|
+
|
|
405
|
+
<div class="method-heading">
|
|
406
|
+
<a href="#M000042" class="method-signature">
|
|
407
|
+
<span class="method-name">wait_for</span><span class="method-args">(uri, store, interval=1, &block)</span>
|
|
408
|
+
</a>
|
|
409
|
+
</div>
|
|
410
|
+
|
|
411
|
+
<div class="method-description">
|
|
412
|
+
<p>
|
|
413
|
+
Wait for the specified job to finish
|
|
414
|
+
</p>
|
|
415
|
+
<p>
|
|
416
|
+
The method will repeatedly contact the Platform to determine whether the
|
|
417
|
+
job has finished executing. The requests are made at configurable intervals
|
|
418
|
+
(once a minute by default). If a block is supplied, then it is passed a
|
|
419
|
+
reference to the <a href="Job.html">Job</a> (containing current progress
|
|
420
|
+
updates) after each request. The <a href="Job.html">Job</a> object is
|
|
421
|
+
returned once completed.
|
|
422
|
+
</p>
|
|
423
|
+
<pre>
|
|
424
|
+
uri:: URI of the job to wait for
|
|
425
|
+
store:: the store on which the job is running
|
|
426
|
+
interval:: the interval at which checks will be made, in minutes. Default is 1
|
|
427
|
+
</pre>
|
|
428
|
+
<p><a class="source-toggle" href="#"
|
|
429
|
+
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
|
|
430
|
+
<div class="method-source-code" id="M000042-source">
|
|
431
|
+
<pre>
|
|
432
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 118</span>
|
|
433
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">wait_for</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">store</span>, <span class="ruby-identifier">interval</span>=<span class="ruby-value">1</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
434
|
+
<span class="ruby-identifier">updates</span> = <span class="ruby-value">0</span>
|
|
435
|
+
<span class="ruby-identifier">job</span> = <span class="ruby-constant">Job</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">store</span>)
|
|
436
|
+
<span class="ruby-identifier">updates</span> = <span class="ruby-identifier">yield_job_update</span>(<span class="ruby-identifier">job</span>, <span class="ruby-identifier">updates</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
437
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-identifier">job</span>.<span class="ruby-identifier">completed?</span>
|
|
438
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-identifier">interval</span><span class="ruby-operator">*</span><span class="ruby-value">60</span>
|
|
439
|
+
<span class="ruby-identifier">job</span> = <span class="ruby-constant">Job</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">store</span>)
|
|
440
|
+
<span class="ruby-identifier">updates</span> = <span class="ruby-identifier">yield_job_update</span>(<span class="ruby-identifier">job</span>, <span class="ruby-identifier">updates</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
441
|
+
<span class="ruby-keyword kw">end</span>
|
|
442
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">job</span>
|
|
443
|
+
<span class="ruby-keyword kw">end</span>
|
|
444
|
+
</pre>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
</div>
|
|
448
|
+
|
|
449
|
+
<div id="method-M000041" class="method-detail">
|
|
450
|
+
<a name="M000041"></a>
|
|
451
|
+
|
|
452
|
+
<div class="method-heading">
|
|
453
|
+
<a href="#M000041" class="method-signature">
|
|
454
|
+
<span class="method-name">wait_for_submitted</span><span class="method-args">(resp, store, interval=1, &block)</span>
|
|
455
|
+
</a>
|
|
456
|
+
</div>
|
|
457
|
+
|
|
458
|
+
<div class="method-description">
|
|
459
|
+
<p>
|
|
460
|
+
Wait for a newly submitted job to finish
|
|
461
|
+
</p>
|
|
462
|
+
<p><a class="source-toggle" href="#"
|
|
463
|
+
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
|
|
464
|
+
<div class="method-source-code" id="M000041-source">
|
|
465
|
+
<pre>
|
|
466
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 100</span>
|
|
467
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">wait_for_submitted</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">store</span>, <span class="ruby-identifier">interval</span>=<span class="ruby-value">1</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
468
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">201</span>
|
|
469
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Unable to wait, job was not created. Status was #{resp.status}"</span>
|
|
470
|
+
<span class="ruby-keyword kw">end</span>
|
|
471
|
+
<span class="ruby-identifier">job_url</span> = <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">header</span>[<span class="ruby-value str">"Location"</span>].<span class="ruby-identifier">first</span>
|
|
472
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">wait_for</span>(<span class="ruby-identifier">job_url</span>, <span class="ruby-identifier">store</span>, <span class="ruby-identifier">interval</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
473
|
+
<span class="ruby-keyword kw">end</span>
|
|
474
|
+
</pre>
|
|
475
|
+
</div>
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
|
|
479
|
+
<h3 class="section-bar">Protected Class methods</h3>
|
|
480
|
+
|
|
481
|
+
<div id="method-M000043" class="method-detail">
|
|
482
|
+
<a name="M000043"></a>
|
|
483
|
+
|
|
484
|
+
<div class="method-heading">
|
|
485
|
+
<a href="#M000043" class="method-signature">
|
|
486
|
+
<span class="method-name">yield_job_update</span><span class="method-args">(job, updates) {|job, job.start_message, job.actual_start_time| ...}</span>
|
|
487
|
+
</a>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
<div class="method-description">
|
|
491
|
+
<p><a class="source-toggle" href="#"
|
|
492
|
+
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
|
|
493
|
+
<div class="method-source-code" id="M000043-source">
|
|
494
|
+
<pre>
|
|
495
|
+
<span class="ruby-comment cmt"># File lib/pho/job.rb, line 132</span>
|
|
496
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Jobs</span>.<span class="ruby-identifier">yield_job_update</span>(<span class="ruby-identifier">job</span>, <span class="ruby-identifier">updates</span>)
|
|
497
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
498
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">job</span>.<span class="ruby-identifier">started?</span>
|
|
499
|
+
|
|
500
|
+
<span class="ruby-comment cmt">#only yield start message if we've not seen any updates</span>
|
|
501
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">updates</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
502
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">job</span>, <span class="ruby-identifier">job</span>.<span class="ruby-identifier">start_message</span>, <span class="ruby-identifier">job</span>.<span class="ruby-identifier">actual_start_time</span>
|
|
503
|
+
<span class="ruby-keyword kw">end</span>
|
|
504
|
+
|
|
505
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">job</span>.<span class="ruby-identifier">progress_updates</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
506
|
+
<span class="ruby-identifier">unseen</span> = <span class="ruby-identifier">job</span>.<span class="ruby-identifier">progress_updates</span>[<span class="ruby-identifier">updates</span>, <span class="ruby-identifier">job</span>.<span class="ruby-identifier">progress_updates</span>.<span class="ruby-identifier">length</span>]
|
|
507
|
+
<span class="ruby-identifier">unseen</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">update</span><span class="ruby-operator">|</span>
|
|
508
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">job</span>, <span class="ruby-identifier">update</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">update</span>.<span class="ruby-identifier">time</span>
|
|
509
|
+
<span class="ruby-keyword kw">end</span>
|
|
510
|
+
<span class="ruby-identifier">updates</span> = <span class="ruby-identifier">job</span>.<span class="ruby-identifier">progress_updates</span>.<span class="ruby-identifier">length</span>
|
|
511
|
+
<span class="ruby-keyword kw">end</span>
|
|
512
|
+
|
|
513
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">job</span>.<span class="ruby-identifier">completed?</span>
|
|
514
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">job</span>, <span class="ruby-identifier">job</span>.<span class="ruby-identifier">completion_message</span>, <span class="ruby-identifier">job</span>.<span class="ruby-identifier">end_time</span>
|
|
515
|
+
<span class="ruby-keyword kw">end</span>
|
|
516
|
+
|
|
517
|
+
<span class="ruby-keyword kw">end</span>
|
|
518
|
+
<span class="ruby-keyword kw">end</span>
|
|
519
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">updates</span>
|
|
520
|
+
<span class="ruby-keyword kw">end</span>
|
|
521
|
+
</pre>
|
|
522
|
+
</div>
|
|
523
|
+
</div>
|
|
524
|
+
</div>
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
</div>
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
</div>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
<div id="validator-badges">
|
|
534
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
535
|
+
</div>
|
|
536
|
+
|
|
537
|
+
</body>
|
|
538
|
+
</html>
|