mirror of
https://github.com/apache/nifi.git
synced 2025-02-10 12:05:22 +00:00
NIFI-7248: Atlas reporting task handles PutHive3Streaming
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #4138.
This commit is contained in:
parent
d4a2afc25c
commit
dfaef38805
@ -37,6 +37,9 @@ public class PutHiveStreaming extends AbstractHiveAnalyzer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSetRefs analyze(AnalysisContext context, ProvenanceEventRecord event) {
|
public DataSetRefs analyze(AnalysisContext context, ProvenanceEventRecord event) {
|
||||||
|
if (event.getTransitUri() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
final URI uri = parseUri(event.getTransitUri());
|
final URI uri = parseUri(event.getTransitUri());
|
||||||
final String clusterName = context.getClusterResolver().fromHostNames(uri.getHost());
|
final String clusterName = context.getClusterResolver().fromHostNames(uri.getHost());
|
||||||
@ -55,6 +58,6 @@ public class PutHiveStreaming extends AbstractHiveAnalyzer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String targetComponentTypePattern() {
|
public String targetComponentTypePattern() {
|
||||||
return "^PutHiveStreaming$";
|
return "^PutHive(3)?Streaming$";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,16 @@ import static org.mockito.Mockito.when;
|
|||||||
public class TestPutHiveStreaming {
|
public class TestPutHiveStreaming {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTableLineage() {
|
public void testTableLineageHive1() {
|
||||||
final String processorName = "PutHiveStreaming";
|
testTableLineage("PutHiveStreaming");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTableLineageHive3() {
|
||||||
|
testTableLineage("PutHive3Streaming");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testTableLineage(String processorName) {
|
||||||
final String transitUri = "thrift://0.example.com:9083";
|
final String transitUri = "thrift://0.example.com:9083";
|
||||||
final ProvenanceEventRecord record = Mockito.mock(ProvenanceEventRecord.class);
|
final ProvenanceEventRecord record = Mockito.mock(ProvenanceEventRecord.class);
|
||||||
when(record.getComponentType()).thenReturn(processorName);
|
when(record.getComponentType()).thenReturn(processorName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user