Search in sources :

Example 16 with PutColumn

use of org.apache.nifi.hbase.put.PutColumn in project nifi by apache.

the class TestPutHBaseRecord method innertTest.

private void innertTest(PutColumn[] columns) {
    PutColumn name = columns[0];
    PutColumn code = columns[1];
    String nameVal = Bytes.toString(name.getBuffer());
    String codeVal = Bytes.toString(code.getBuffer());
    Assert.assertTrue("Name was not found", NAMES.contains(nameVal));
    Assert.assertTrue("Code was not found ", CODES.contains(new Long(codeVal)));
}
Also used : PutColumn(org.apache.nifi.hbase.put.PutColumn)

Example 17 with PutColumn

use of org.apache.nifi.hbase.put.PutColumn in project nifi by apache.

the class TestPutHBaseRecord method testByteEncodedPut.

@Test
public void testByteEncodedPut() throws Exception {
    basicPutSetup(PutHBaseRecord.BYTES_ENCODING_VALUE, (PutColumn[] columns) -> {
        PutColumn name = columns[0];
        PutColumn code = columns[1];
        String nameVal = Bytes.toString(name.getBuffer());
        Long codeVal = Bytes.toLong(code.getBuffer());
        Assert.assertTrue("Name was not found", NAMES.contains(nameVal));
        Assert.assertTrue("Code was not found ", CODES.contains(codeVal));
    });
}
Also used : PutColumn(org.apache.nifi.hbase.put.PutColumn) Test(org.junit.Test)

Aggregations

PutColumn (org.apache.nifi.hbase.put.PutColumn)17 PutFlowFile (org.apache.nifi.hbase.put.PutFlowFile)9 ArrayList (java.util.ArrayList)7 Put (org.apache.hadoop.hbase.client.Put)6 Table (org.apache.hadoop.hbase.client.Table)5 TestRunner (org.apache.nifi.util.TestRunner)4 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 List (java.util.List)3 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 Map (java.util.Map)2 InputStreamCallback (org.apache.nifi.processor.io.InputStreamCallback)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 BufferedInputStream (java.io.BufferedInputStream)1 LinkedHashMap (java.util.LinkedHashMap)1 NavigableMap (java.util.NavigableMap)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Cell (org.apache.hadoop.hbase.Cell)1