protected String getTransitUri(PutFlowFile putFlowFile) { return clientService.toTransitUri(putFlowFile.getTableName(), new String(putFlowFile.getRow(), StandardCharsets.UTF_8)); }
private void finalizeFlowFile(final ProcessSession session, final HBaseClientService hBaseClientService, FlowFile flowFile, final String tableName, Long rowsPulled, Exception e) { Relationship rel = REL_SUCCESS; flowFile = session.putAttribute(flowFile, HBASE_ROWS_COUNT_ATTR, rowsPulled.toString()); final AtomicReference<IOException> ioe = new AtomicReference<>(null); flowFile = session.append(flowFile, (out) -> { try{ out.write("]".getBytes()); }catch(IOException ei){ ioe.set(ei); } }); if (e != null || ioe.get() != null) { flowFile = session.putAttribute(flowFile, "scanhbase.error", (e==null?e:ioe.get()).toString()); rel = REL_FAILURE; } else { session.getProvenanceReporter().receive(flowFile, hBaseClientService.toTransitUri(tableName, "{ids}")); } session.transfer(flowFile, rel); }
private String doDeleteFromAttribute(FlowFile flowFile, ProcessContext context, String tableName, String charset, String visibility) throws Exception { String rowKey = context.getProperty(ROW_ID).evaluateAttributeExpressions(flowFile).getValue(); clientService.delete(tableName, rowKey.getBytes(charset), visibility); return clientService.toTransitUri(tableName, rowKey); }
clientService.deleteCells(tableName, deletes); for (int index = 0; index < rowKeys.size(); index++) { //Could be many row keys in one flowfile. session.getProvenanceReporter().invokeRemoteProcess(input, clientService.toTransitUri(tableName, rowKeys.get(index)));
flowFile = session.putAllAttributes(flowFile, attributes); session.getProvenanceReporter().receive(flowFile, hBaseClientService.toTransitUri(tableName, rowKeyString)); session.transfer(flowFile, REL_SUCCESS); getLogger().debug("Received {} from HBase with row key {}", new Object[]{flowFile, rowKeyString});
session.transfer(flowFile, REL_FAILURE); } else { final String transitUrl = clientService.toTransitUri(tableName, flowFile.getAttribute(ROWKEY_END)); session.transfer(flowFile, REL_SUCCESS); session.getProvenanceReporter().invokeRemoteProcess(flowFile, transitUrl);
final String transitUri = hBaseClientService.toTransitUri(tableName, rowId);