1
|
package eu.dnetlib.data.mapreduce.hbase.openorgs;
|
2
|
|
3
|
import java.nio.charset.Charset;
|
4
|
|
5
|
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
|
6
|
|
7
|
public class OpenOrgsCommon {
|
8
|
|
9
|
public static final String OPENORGS_MESH_PREFIX = "openorgsmesh::";
|
10
|
public static final String OPENORGS_MAIN_PREFIX = "openorgs____::";
|
11
|
public static final String OPENORGS_CORDA_FP7_PREFIX = "corda_______::";
|
12
|
public static final String OPENORGS_CORDA_H2020_PREFIX = "corda__h2020::";
|
13
|
|
14
|
public static boolean isOpenOrgsMesh(final ImmutableBytesWritable k) {
|
15
|
return new String(k.copyBytes(), Charset.forName("UTF-8")).startsWith("20|" + OPENORGS_MESH_PREFIX);
|
16
|
}
|
17
|
|
18
|
public static boolean isOpenOrgs(final ImmutableBytesWritable k) {
|
19
|
return new String(k.copyBytes(), Charset.forName("UTF-8")).startsWith("20|" + OPENORGS_MAIN_PREFIX);
|
20
|
}
|
21
|
|
22
|
public static boolean isCordaFp7(final ImmutableBytesWritable k) {
|
23
|
return new String(k.copyBytes(), Charset.forName("UTF-8")).startsWith("20|" + OPENORGS_CORDA_FP7_PREFIX);
|
24
|
}
|
25
|
|
26
|
public static boolean isCordaH2020(final ImmutableBytesWritable k) {
|
27
|
return new String(k.copyBytes(), Charset.forName("UTF-8")).startsWith("20|" + OPENORGS_CORDA_H2020_PREFIX);
|
28
|
}
|
29
|
|
30
|
}
|