Search in sources :

Example 16 with ResultCell

use of org.apache.nifi.hbase.scan.ResultCell in project nifi by apache.

the class TestJsonFullRowSerializer method setup.

@Before
public void setup() {
    final byte[] cell1Fam = FAM1.getBytes(StandardCharsets.UTF_8);
    final byte[] cell1Qual = QUAL1.getBytes(StandardCharsets.UTF_8);
    final byte[] cell1Val = VAL1.getBytes(StandardCharsets.UTF_8);
    final byte[] cell2Fam = FAM2.getBytes(StandardCharsets.UTF_8);
    final byte[] cell2Qual = QUAL2.getBytes(StandardCharsets.UTF_8);
    final byte[] cell2Val = VAL2.getBytes(StandardCharsets.UTF_8);
    final ResultCell cell1 = getResultCell(cell1Fam, cell1Qual, cell1Val, TS1);
    final ResultCell cell2 = getResultCell(cell2Fam, cell2Qual, cell2Val, TS2);
    cells = new ResultCell[] { cell1, cell2 };
}
Also used : ResultCell(org.apache.nifi.hbase.scan.ResultCell) Before(org.junit.Before)

Example 17 with ResultCell

use of org.apache.nifi.hbase.scan.ResultCell in project nifi by apache.

the class TestJsonRowSerializer method getResultCell.

private ResultCell getResultCell(byte[] fam, byte[] qual, byte[] val) {
    final ResultCell cell = new ResultCell();
    cell.setFamilyArray(fam);
    cell.setFamilyOffset(0);
    cell.setFamilyLength((byte) fam.length);
    cell.setQualifierArray(qual);
    cell.setQualifierOffset(0);
    cell.setQualifierLength(qual.length);
    cell.setValueArray(val);
    cell.setValueOffset(0);
    cell.setValueLength(val.length);
    return cell;
}
Also used : ResultCell(org.apache.nifi.hbase.scan.ResultCell)

Aggregations

ResultCell (org.apache.nifi.hbase.scan.ResultCell)17 HashMap (java.util.HashMap)4 Table (org.apache.hadoop.hbase.client.Table)4 IOException (java.io.IOException)3 Cell (org.apache.hadoop.hbase.Cell)3 Result (org.apache.hadoop.hbase.client.Result)3 ResultScanner (org.apache.hadoop.hbase.client.ResultScanner)3 ValidationResult (org.apache.nifi.components.ValidationResult)3 Before (org.junit.Before)3 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 PutColumn (org.apache.nifi.hbase.put.PutColumn)2 Column (org.apache.nifi.hbase.scan.Column)2 OutputStream (java.io.OutputStream)1 Charset (java.nio.charset.Charset)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 Set (java.util.Set)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Filter (org.apache.hadoop.hbase.filter.Filter)1