-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboa.install
More file actions
248 lines (237 loc) · 7.95 KB
/
boa.install
File metadata and controls
248 lines (237 loc) · 7.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<?php
/**
* Implements hook_install().
*/
function boa_install() {
$roles = user_roles(TRUE);
if (!in_array('boa_user', $roles)) {
$role1 = new stdClass();
$role1->name = 'boa_user';
user_role_save($role1);
}
if (!in_array('boa_admin', $roles)) {
$role2 = new stdClass();
$role2->name = 'boa_admin';
user_role_save($role2);
}
$users = array(1); // for now, just target the first user, who is always an admin
$boa_user_role = user_role_load_by_name('boa_user');
$boa_admin_role = user_role_load_by_name('boa_admin');
user_multiple_role_edit($users, 'add_role', $boa_user_role->rid);
user_multiple_role_edit($users, 'add_role', $boa_admin_role->rid);
$query = db_insert('boa_input');
$query->fields(array(
'id' => 1,
'name' => '--live data--',
'path' => 'live',
'run_opts' => NULL,
'compiler_path' => 'live',
'enabled' => 1,
));
$query->execute();
}
/**
* Implements hook_schema().
*/
function boa_schema() {
$schema['boa_input'] = array(
'description' => 'Boa input datasets.',
'primary key' => array(
'id',
),
'fields' => array(
'id' => array(
'description' => 'Unique input dataset ID.',
'type' => 'serial',
'size' => 'big',
'not null' => TRUE,
),
'name' => array(
'description' => 'The dataset name, shown on the web.',
'type' => 'varchar',
'length' => 50,
),
'path' => array(
'description' => 'Directory name in HDFS of the dataset.',
'type' => 'varchar',
'length' => 255,
),
'run_opts' => array(
'description' => 'Command-line options passed to the Hadoop jar.',
'type' => 'varchar',
'length' => 4096,
),
'compiler_path' => array(
'description' => 'Directory name for the Boa compiler.',
'type' => 'varchar',
'length' => 255,
),
'enabled' => array(
'description' => 'Is the dataset enabled (1) or not (0).',
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
),
);
$schema['boa_jobs'] = array(
'description' => 'A Boa job.',
'primary key' => array(
'id',
),
'fields' => array(
'id' => array(
'description' => 'Unique job ID.',
'type' => 'serial',
'not null' => TRUE,
),
'uid' => array(
'description' => 'The user ID owning this job.',
'type' => 'int',
'not null' => TRUE,
),
'deleted' => array(
'description' => 'If this job is deleted (1) or not (0).',
'type' => 'int',
'size' => 'tiny',
'default' => 0,
),
'public' => array(
'description' => 'If this job is public (1) or private (0).',
'type' => 'int',
'size' => 'tiny',
'default' => 0,
),
'source' => array(
'description' => 'The source code of the query.',
'type' => 'text',
'size' => 'big',
),
'created' => array(
'description' => 'The time the job was originally created.',
'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP',
'not null' => TRUE,
),
'submitted' => array(
'description' => 'The time the job was last submitted.',
'mysql_type' => 'timestamp NULL',
'default' => null,
),
'input' => array(
'description' => 'The input dataset ID.',
'type' => 'int',
),
'compiler_status' => array(
'description' => 'Current status of the compiler. 0/not started 1/??? 2/??? 3/???.',
'type' => 'int',
'size' => 'tiny',
'default' => 0,
),
'compile_start' => array(
'description' => 'The time the compiler started.',
'mysql_type' => 'timestamp',
'default' => '1970-01-01 00:00:01',
),
'compile_end' => array(
'description' => 'The time the compiler finished.',
'mysql_type' => 'timestamp',
'default' => '1970-01-01 00:00:01',
),
'compiler_output' => array(
'description' => 'The standard output/log of the compiler.',
'type' => 'text',
'size' => 'medium',
),
'hadoop_status' => array(
'description' => 'Current status of the Hadoop job. 0/not started 1/??? 2/??? 3/???',
'type' => 'int',
'size' => 'tiny',
'default' => 0,
),
'hadoop_start' => array(
'description' => 'The time the Hadoop job started.',
'mysql_type' => 'timestamp',
'default' => '1970-01-01 00:00:01',
),
'hadoop_end' => array(
'description' => 'The time the Hadoop job finished.',
'mysql_type' => 'timestamp',
'default' => '1970-01-01 00:00:01',
),
'hadoop_output' => array(
'description' => 'The Hadoop job standard output/logs.',
'type' => 'text',
'size' => 'big',
),
'hadoop_id' => array(
'description' => 'The Hadoop job ID, if any.',
'type' => 'varchar',
'length' => 25,
),
'parent_id' => array(
'description' => 'The parent ID of this job, if any.',
'type' => 'int',
'size' => 'big',
),
),
'indexes' => array(
'uid' => array(
'uid',
),
'children' => array(
'parent_id',
),
'job_poller' => array(
'compiler_status',
'input',
),
'hadoop_status' => array(
'hadoop_status',
),
'caching_job' => array(
'input',
array('source', 200),
),
'publicjobs' => array(
'public',
'deleted',
),
),
);
// maybe TODO ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16
$schema['boa_output'] = array(
'description' => 'Information about the output/results of a job after Hadoop runs.',
'primary key' => array(
'id',
),
'fields' => array(
'id' => array(
'description' => 'Job ID of this output.',
'type' => 'int',
'size' => 'big',
'not null' => TRUE,
),
'length' => array(
'description' => 'How many bytes is the full output.',
'type' => 'int',
'size' => 'big',
),
'hash' => array(
'description' => 'Hash of the output, used by API to get file contents.',
'type' => 'char',
'length' => '32',
),
'web_result' => array(
'description' => 'First part of the output, to display on the web.',
'type' => 'text',
),
'cacheid' => array(
'description' => 'Job ID of job this one cached from, if any.',
'type' => 'int',
'size' => 'big',
),
),
);
return $schema;
}
?>