Search in sources :

Example 6 with ResultCell

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

the class TestJsonFullRowSerializer method getResultCell.

private ResultCell getResultCell(byte[] fam, byte[] qual, byte[] val, long timestamp) {
    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);
    cell.setTimestamp(timestamp);
    return cell;
}
Also used : ResultCell(org.apache.nifi.hbase.scan.ResultCell)

Example 7 with ResultCell

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

the class TestJsonQualifierAndValueRowSerializer method getResultCell.

private ResultCell getResultCell(byte[] fam, byte[] qual, byte[] val, long timestamp) {
    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);
    cell.setTimestamp(timestamp);
    return cell;
}
Also used : ResultCell(org.apache.nifi.hbase.scan.ResultCell)

Example 8 with ResultCell

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

the class TestJsonQualifierAndValueRowSerializer 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 9 with ResultCell

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

the class TestJsonRowSerializer method setup.

@Before
public void setup() {
    final byte[] cell1Fam = "colFam1".getBytes(StandardCharsets.UTF_8);
    final byte[] cell1Qual = "colQual1".getBytes(StandardCharsets.UTF_8);
    final byte[] cell1Val = "val1".getBytes(StandardCharsets.UTF_8);
    final byte[] cell2Fam = "colFam2".getBytes(StandardCharsets.UTF_8);
    final byte[] cell2Qual = "colQual2".getBytes(StandardCharsets.UTF_8);
    final byte[] cell2Val = "val2".getBytes(StandardCharsets.UTF_8);
    final ResultCell cell1 = getResultCell(cell1Fam, cell1Qual, cell1Val);
    final ResultCell cell2 = getResultCell(cell2Fam, cell2Qual, cell2Val);
    cells = new ResultCell[] { cell1, cell2 };
}
Also used : ResultCell(org.apache.nifi.hbase.scan.ResultCell) Before(org.junit.Before)

Example 10 with ResultCell

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

the class HBase_1_1_2_ClientService method getResultCell.

private ResultCell getResultCell(Cell cell) {
    final ResultCell resultCell = new ResultCell();
    resultCell.setRowArray(cell.getRowArray());
    resultCell.setRowOffset(cell.getRowOffset());
    resultCell.setRowLength(cell.getRowLength());
    resultCell.setFamilyArray(cell.getFamilyArray());
    resultCell.setFamilyOffset(cell.getFamilyOffset());
    resultCell.setFamilyLength(cell.getFamilyLength());
    resultCell.setQualifierArray(cell.getQualifierArray());
    resultCell.setQualifierOffset(cell.getQualifierOffset());
    resultCell.setQualifierLength(cell.getQualifierLength());
    resultCell.setTimestamp(cell.getTimestamp());
    resultCell.setTypeByte(cell.getTypeByte());
    resultCell.setSequenceId(cell.getSequenceId());
    resultCell.setValueArray(cell.getValueArray());
    resultCell.setValueOffset(cell.getValueOffset());
    resultCell.setValueLength(cell.getValueLength());
    resultCell.setTagsArray(cell.getTagsArray());
    resultCell.setTagsOffset(cell.getTagsOffset());
    resultCell.setTagsLength(cell.getTagsLength());
    return resultCell;
}
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