1
|
package eu.dnetlib.data.hadoop.rmi;
|
2
|
|
3
|
import java.util.Arrays;
|
4
|
import java.util.List;
|
5
|
import java.util.Set;
|
6
|
|
7
|
import com.google.common.base.Function;
|
8
|
import com.google.common.collect.Iterables;
|
9
|
import com.google.common.collect.Lists;
|
10
|
import com.google.common.collect.Sets;
|
11
|
|
12
|
/**
|
13
|
* Enum of supported hadoop job types.
|
14
|
*
|
15
|
* @author claudio
|
16
|
*/
|
17
|
public enum HadoopJobType {
|
18
|
|
19
|
/** The mapreduce. */
|
20
|
mapreduce,
|
21
|
|
22
|
/** The admin. */
|
23
|
admin,
|
24
|
|
25
|
/** The oozie. */
|
26
|
oozie;
|
27
|
|
28
|
/**
|
29
|
* The Enum AdminJobType.
|
30
|
*/
|
31
|
public enum AdminJobType {
|
32
|
|
33
|
/**
|
34
|
* The copytable job.
|
35
|
*
|
36
|
* <pre>
|
37
|
* {@code
|
38
|
* bin/hbase org.apache.hadoop.hbase.mapreduce.CopyTable --starttime=1265875194289 --endtime=1265878794289
|
39
|
* --peer.adr=server1,server2,server3:2181:/hbase --families=myOldCf:myNewCf,cf2,cf3 TestTable <code>
|
40
|
*
|
41
|
* Options:
|
42
|
* rs.class hbase.regionserver.class of the peer cluster,
|
43
|
* specify if different from current cluster
|
44
|
* rs.impl hbase.regionserver.impl of the peer cluster,
|
45
|
* startrow the start row
|
46
|
* stoprow the stop row
|
47
|
* starttime beginning of the time range (unixtime in millis)
|
48
|
* without endtime means from starttime to forever
|
49
|
* endtime end of the time range. Ignored if no starttime specified.
|
50
|
* versions number of cell versions to copy
|
51
|
* new.name new table's name
|
52
|
* peer.adr Address of the peer cluster given in the format
|
53
|
* hbase.zookeeer.quorum:hbase.zookeeper.client.port:zookeeper.znode.parent
|
54
|
* families comma-separated list of families to copy
|
55
|
* To copy from cf1 to cf2, give sourceCfName:destCfName.
|
56
|
* To keep the same name, just give "cfName"
|
57
|
* all.cells also copy delete markers and deleted cells
|
58
|
*
|
59
|
* Args:
|
60
|
* tablename Name of the table to copy
|
61
|
* }
|
62
|
* </pre>
|
63
|
*
|
64
|
* */
|
65
|
copytable;
|
66
|
|
67
|
public static Set<String> asStringSet() {
|
68
|
return Sets.newHashSet(asStringList());
|
69
|
}
|
70
|
|
71
|
public static List<String> asStringList() {
|
72
|
return Lists.newArrayList(Iterables.transform(asList(), new Function<AdminJobType, String>() {
|
73
|
|
74
|
@Override
|
75
|
public String apply(final AdminJobType type) {
|
76
|
return type.toString();
|
77
|
}
|
78
|
}));
|
79
|
}
|
80
|
|
81
|
public static List<AdminJobType> asList() {
|
82
|
return Arrays.asList(AdminJobType.values());
|
83
|
}
|
84
|
|
85
|
}
|
86
|
}
|