Java Code Examples for org.apache.hadoop.hbase.client.HTable#exists()

The following examples show how to use org.apache.hadoop.hbase.client.HTable#exists() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: udtfCheck.java    From Transwarp-Sample-Code with MIT License 6 votes vote down vote up
@Override
public void process(Object[] record) throws HiveException {
    final String document = (String) stringOI.getPrimitiveJavaObject(record[0]);

    if (document == null) {
        return;
    }

    String[] tokens = document.split(",");
    String[] results = tokens[1].split(" ");

    try {
        hTable = new HTable(conf, "bi");
        Get get = new Get(Bytes.toBytes(tokens[0]));
        result = hTable.exists(get);
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (!result) {
        for (String r : results) {
            forward(new Object[]{tokens[0], r});
        }
    }
}
 
Example 2
Source File: udfCheck.java    From Transwarp-Sample-Code with MIT License 5 votes vote down vote up
public static boolean evaluate(String rowkey) {
    try {
        hTable = new HTable(conf, "bi");
        Get get = new Get(Bytes.toBytes(rowkey));
        result = hTable.exists(get);
        return result;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return false;
}