1
|
package eu.dnetlib.rmi.data;
|
2
|
|
3
|
import java.util.List;
|
4
|
import java.util.Map;
|
5
|
import java.util.Set;
|
6
|
import javax.jws.WebParam;
|
7
|
import javax.jws.WebService;
|
8
|
|
9
|
import eu.dnetlib.rmi.common.BaseService;
|
10
|
import eu.dnetlib.rmi.data.hbase.HBaseRowDescriptor;
|
11
|
|
12
|
/**
|
13
|
* The Interface HadoopService.
|
14
|
*/
|
15
|
@WebService(targetNamespace = "http://services.dnetlib.eu/")
|
16
|
public interface HadoopService extends BaseService {
|
17
|
|
18
|
/**
|
19
|
* List available jobs.
|
20
|
*
|
21
|
* @return the list
|
22
|
* @throws HadoopServiceException the hadoop service exception
|
23
|
*/
|
24
|
List<String> listAvailableJobs() throws HadoopServiceException;
|
25
|
|
26
|
/**
|
27
|
* List jobs.
|
28
|
*
|
29
|
* @param clusterName the cluster name
|
30
|
* @return the list
|
31
|
* @throws HadoopServiceException the hadoop service exception
|
32
|
*/
|
33
|
List<HadoopJobDescriptor> listJobs(@WebParam(name = "clusterName") String clusterName) throws HadoopServiceException;
|
34
|
|
35
|
/**
|
36
|
* Kill job.
|
37
|
*
|
38
|
* @param jobId the job id
|
39
|
* @return true, if successful
|
40
|
* @throws HadoopServiceException the hadoop service exception
|
41
|
*/
|
42
|
boolean killJob(@WebParam(name = "id") String jobId) throws HadoopServiceException;
|
43
|
|
44
|
/**
|
45
|
* List hbase tables.
|
46
|
*
|
47
|
* @param clusterName the cluster name
|
48
|
* @return the list
|
49
|
* @throws HadoopServiceException the hadoop service exception
|
50
|
*/
|
51
|
List<String> listHbaseTables(@WebParam(name = "clusterName") String clusterName) throws HadoopServiceException;
|
52
|
|
53
|
/**
|
54
|
* Ensure hbase table.
|
55
|
*
|
56
|
* @param clusterName the cluster name
|
57
|
* @param tableName the table name
|
58
|
* @param columns the columns
|
59
|
* @return true, if successful
|
60
|
* @throws HadoopServiceException the hadoop service exception
|
61
|
*/
|
62
|
boolean ensureHbaseTable(@WebParam(name = "clusterName") String clusterName,
|
63
|
@WebParam(name = "tableName") String tableName,
|
64
|
@WebParam(name = "columns") Set<String> columns) throws HadoopServiceException;
|
65
|
|
66
|
/**
|
67
|
* Creates the hbase table.
|
68
|
*
|
69
|
* @param clusterName the cluster name
|
70
|
* @param tableName the table name
|
71
|
* @param columns the columns
|
72
|
* @return true, if successful
|
73
|
* @throws HadoopServiceException the hadoop service exception
|
74
|
*/
|
75
|
boolean createHbaseTable(@WebParam(name = "clusterName") String clusterName,
|
76
|
@WebParam(name = "tableName") String tableName,
|
77
|
@WebParam(name = "columns") Set<String> columns) throws HadoopServiceException;
|
78
|
|
79
|
/**
|
80
|
* Creates the hbase table.
|
81
|
*
|
82
|
* @param clusterName the cluster name
|
83
|
* @param tableName the table name
|
84
|
* @param tableConfiguration the table configuration: columns and region splits
|
85
|
* @return true, if successful
|
86
|
* @throws HadoopServiceException the hadoop service exception
|
87
|
*/
|
88
|
boolean createConfiguredHbaseTable(@WebParam(name = "clusterName") String clusterName,
|
89
|
@WebParam(name = "tableName") String tableName,
|
90
|
@WebParam(name = "tableConfiguration") String tableConfiguration) throws HadoopServiceException;
|
91
|
|
92
|
/**
|
93
|
* Truncate hbase table.
|
94
|
*
|
95
|
* @param clusterName the cluster name
|
96
|
* @param tableName the table name
|
97
|
* @return true, if successful
|
98
|
* @throws HadoopServiceException the hadoop service exception
|
99
|
*/
|
100
|
boolean truncateHbaseTable(@WebParam(name = "clusterName") String clusterName, @WebParam(name = "tableName") String tableName)
|
101
|
throws HadoopServiceException;
|
102
|
|
103
|
/**
|
104
|
* Drop hbase table.
|
105
|
*
|
106
|
* @param clusterName the cluster name
|
107
|
* @param tableName the table name
|
108
|
* @return true, if successful
|
109
|
* @throws HadoopServiceException the hadoop service exception
|
110
|
*/
|
111
|
boolean dropHbaseTable(@WebParam(name = "clusterName") String clusterName, @WebParam(name = "tableName") String tableName) throws HadoopServiceException;
|
112
|
|
113
|
/**
|
114
|
* Exist hbase table.
|
115
|
*
|
116
|
* @param clusterName the cluster name
|
117
|
* @param tableName the table name
|
118
|
* @return true, if successful
|
119
|
* @throws HadoopServiceException the hadoop service exception
|
120
|
*/
|
121
|
boolean existHbaseTable(@WebParam(name = "clusterName") String clusterName, @WebParam(name = "tableName") String tableName) throws HadoopServiceException;
|
122
|
|
123
|
/**
|
124
|
* Describe hbase table.
|
125
|
*
|
126
|
* @param clusterName the cluster name
|
127
|
* @param tableName the table name
|
128
|
* @return the list of columns defined for that table.
|
129
|
* @throws HadoopServiceException the hadoop service exception
|
130
|
*/
|
131
|
List<String> describeHbaseTable(@WebParam(name = "clusterName") String clusterName, @WebParam(name = "tableName") String tableName)
|
132
|
throws HadoopServiceException;
|
133
|
|
134
|
/**
|
135
|
* Gets the cluster configuration.
|
136
|
*
|
137
|
* @param clusterName the cluster name
|
138
|
* @return the cluster configuration
|
139
|
* @throws HadoopServiceException the hadoop service exception
|
140
|
*/
|
141
|
Map<String, String> getClusterConfiguration(@WebParam(name = "clusterName") String clusterName) throws HadoopServiceException;
|
142
|
|
143
|
/**
|
144
|
* Deletes a path on HDFS
|
145
|
*
|
146
|
* @param clusterName the cluster name
|
147
|
* @param path the path to be deleted
|
148
|
* @return true in case of success
|
149
|
* @throws HadoopServiceException
|
150
|
*/
|
151
|
boolean deleteHdfsPath(@WebParam(name = "clusterName") String clusterName, @WebParam(name = "path") String path)
|
152
|
throws HadoopServiceException;
|
153
|
|
154
|
/**
|
155
|
* Creates a directory on HDFS, eventually deleteing its content.
|
156
|
*
|
157
|
* @param clusterName the cluster name
|
158
|
* @param path the path to be created
|
159
|
* @param force force delete before create
|
160
|
* @return true in case of success
|
161
|
* @throws HadoopServiceException
|
162
|
*/
|
163
|
boolean createHdfsDirectory(@WebParam(name = "clusterName") String clusterName,
|
164
|
@WebParam(name = "path") String path,
|
165
|
@WebParam(name = "force") boolean force)
|
166
|
throws HadoopServiceException;
|
167
|
|
168
|
/**
|
169
|
* List the configured cluster names.
|
170
|
*
|
171
|
* @return the list of configured cluster names.
|
172
|
* @throws HadoopServiceException shouldn't happen
|
173
|
*/
|
174
|
List<String> listClusters() throws HadoopServiceException;
|
175
|
|
176
|
/**
|
177
|
* Get the columns defined in a given row
|
178
|
*
|
179
|
* @param clusterName
|
180
|
* @param tableName
|
181
|
* @param rowKey
|
182
|
* @return
|
183
|
*/
|
184
|
HBaseRowDescriptor describeHBaseColumn(@WebParam(name = "clusterName") String clusterName,
|
185
|
@WebParam(name = "tableName") String tableName,
|
186
|
@WebParam(name = "rowKey") String rowKey) throws HadoopServiceException;
|
187
|
|
188
|
/**
|
189
|
* Get the columns defined in a given set of row
|
190
|
*
|
191
|
* @param clusterName
|
192
|
* @param tableName
|
193
|
* @param rowKeys
|
194
|
* @return
|
195
|
*/
|
196
|
Map<String, HBaseRowDescriptor> describeHBaseColumns(@WebParam(name = "clusterName") String clusterName,
|
197
|
@WebParam(name = "tableName") String tableName,
|
198
|
@WebParam(name = "rowKeys") List<String> rowKeys) throws HadoopServiceException;
|
199
|
|
200
|
/**
|
201
|
* Get the HBase table schema and the region splits configuration
|
202
|
*
|
203
|
* @param clusterName
|
204
|
* @param tableName
|
205
|
* @return
|
206
|
*/
|
207
|
String describeHBaseTableConfiguration(@WebParam(name = "clusterName") String clusterName,
|
208
|
@WebParam(name = "tableName") String tableName) throws HadoopServiceException;
|
209
|
|
210
|
/**
|
211
|
* Remove from an HBase table the values identified by a row descriptor.
|
212
|
*
|
213
|
* @param clusterName
|
214
|
* @param tableName
|
215
|
* @param column
|
216
|
* @return
|
217
|
*/
|
218
|
boolean deleteHBaseColumn(@WebParam(name = "clusterName") String clusterName,
|
219
|
@WebParam(name = "tableName") String tableName,
|
220
|
@WebParam(name = "column") HBaseRowDescriptor column) throws HadoopServiceException;
|
221
|
|
222
|
/**
|
223
|
* Remove from an HBase table the values identified by a row descriptor.
|
224
|
*
|
225
|
* @param clusterName
|
226
|
* @param tableName
|
227
|
* @param column
|
228
|
* @return
|
229
|
*/
|
230
|
boolean deleteHBaseColumns(@WebParam(name = "clusterName") String clusterName,
|
231
|
@WebParam(name = "tableName") String tableName,
|
232
|
@WebParam(name = "column") List<HBaseRowDescriptor> column) throws HadoopServiceException;
|
233
|
|
234
|
}
|