mirror of https://github.com/apache/nifi.git
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
|
||||
public DataSetRefs analyze(AnalysisContext context, ProvenanceEventRecord event) {
|
||||
if (event.getTransitUri() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final URI uri = parseUri(event.getTransitUri());
|
||||
final String clusterName = context.getClusterResolver().fromHostNames(uri.getHost());
|
||||
|
@ -55,6 +58,6 @@ public class PutHiveStreaming extends AbstractHiveAnalyzer {
|
|||
|
||||
@Override
|
||||
public String targetComponentTypePattern() {
|
||||
return "^PutHiveStreaming$";
|
||||
return "^PutHive(3)?Streaming$";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,16 @@ import static org.mockito.Mockito.when;
|
|||
public class TestPutHiveStreaming {
|
||||
|
||||
@Test
|
||||
public void testTableLineage() {
|
||||
final String processorName = "PutHiveStreaming";
|
||||
public void testTableLineageHive1() {
|
||||
testTableLineage("PutHiveStreaming");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTableLineageHive3() {
|
||||
testTableLineage("PutHive3Streaming");
|
||||
}
|
||||
|
||||
private void testTableLineage(String processorName) {
|
||||
final String transitUri = "thrift://0.example.com:9083";
|
||||
final ProvenanceEventRecord record = Mockito.mock(ProvenanceEventRecord.class);
|
||||
when(record.getComponentType()).thenReturn(processorName);
|
||||
|
|
Loading…
Reference in New Issue