Search in sources :

Example 1 with JsonQualifierAndValueRowSerializer

use of org.apache.nifi.hbase.io.JsonQualifierAndValueRowSerializer in project nifi by apache.

the class ScanHBase method onScheduled.

@OnScheduled
public void onScheduled(ProcessContext context) {
    this.decodeCharset = Charset.forName(context.getProperty(DECODE_CHARSET).getValue());
    this.encodeCharset = Charset.forName(context.getProperty(ENCODE_CHARSET).getValue());
    final String jsonFormat = context.getProperty(JSON_FORMAT).getValue();
    if (jsonFormat.equals(JSON_FORMAT_FULL_ROW.getValue())) {
        this.serializer = new JsonFullRowSerializer(decodeCharset, encodeCharset);
    } else {
        this.serializer = new JsonQualifierAndValueRowSerializer(decodeCharset, encodeCharset);
    }
}
Also used : JsonFullRowSerializer(org.apache.nifi.hbase.io.JsonFullRowSerializer) JsonQualifierAndValueRowSerializer(org.apache.nifi.hbase.io.JsonQualifierAndValueRowSerializer) OnScheduled(org.apache.nifi.annotation.lifecycle.OnScheduled)

Example 2 with JsonQualifierAndValueRowSerializer

use of org.apache.nifi.hbase.io.JsonQualifierAndValueRowSerializer in project nifi by apache.

the class FetchHBaseRow method onScheduled.

@OnScheduled
public void onScheduled(ProcessContext context) {
    this.decodeCharset = Charset.forName(context.getProperty(DECODE_CHARSET).getValue());
    this.encodeCharset = Charset.forName(context.getProperty(ENCODE_CHARSET).getValue());
    final String jsonFormat = context.getProperty(JSON_FORMAT).getValue();
    if (jsonFormat.equals(JSON_FORMAT_FULL_ROW.getValue())) {
        this.regularRowSerializer = new JsonFullRowSerializer(decodeCharset, encodeCharset);
        this.base64RowSerializer = new JsonFullRowSerializer(decodeCharset, encodeCharset, true);
    } else {
        this.regularRowSerializer = new JsonQualifierAndValueRowSerializer(decodeCharset, encodeCharset);
        this.base64RowSerializer = new JsonQualifierAndValueRowSerializer(decodeCharset, encodeCharset, true);
    }
}
Also used : JsonFullRowSerializer(org.apache.nifi.hbase.io.JsonFullRowSerializer) JsonQualifierAndValueRowSerializer(org.apache.nifi.hbase.io.JsonQualifierAndValueRowSerializer) OnScheduled(org.apache.nifi.annotation.lifecycle.OnScheduled)

Aggregations

OnScheduled (org.apache.nifi.annotation.lifecycle.OnScheduled)2 JsonFullRowSerializer (org.apache.nifi.hbase.io.JsonFullRowSerializer)2 JsonQualifierAndValueRowSerializer (org.apache.nifi.hbase.io.JsonQualifierAndValueRowSerializer)2