You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2020/03/06 17:46:40 UTC
[nifi] branch master updated (7c57e75 -> f283c11)
This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git.
from 7c57e75 NIFI-7226: Add Connection Factory configuration properties to PublishJMS and ConsumeJMS processors
new 20dda05 NIFI-7232 if users do not supply a remote path PutSFTP with conflict resolution will fail with an NPE
new f283c11 Fixed unit test failed with NIFI-7232
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../nifi/provenance/index/lucene/TestLuceneEventIndex.java | 12 ++++++++++--
.../org/apache/nifi/processors/standard/PutFileTransfer.java | 5 +++--
.../apache/nifi/processors/standard/util/SFTPTransfer.java | 1 +
3 files changed, 14 insertions(+), 4 deletions(-)
[nifi] 02/02: Fixed unit test failed with NIFI-7232
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
commit f283c1191ca207217f3e22c24574e340b10db580
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Fri Mar 6 11:46:16 2020 -0500
Fixed unit test failed with NIFI-7232
This closes #4117.
Signed-off-by: Joe Witt <jo...@apache.org>
---
.../nifi/provenance/index/lucene/TestLuceneEventIndex.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/index/lucene/TestLuceneEventIndex.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/index/lucene/TestLuceneEventIndex.java
index 69be483..d3733bd 100644
--- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/index/lucene/TestLuceneEventIndex.java
+++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/index/lucene/TestLuceneEventIndex.java
@@ -40,6 +40,7 @@ import org.apache.nifi.provenance.store.ArrayListEventStore;
import org.apache.nifi.provenance.store.EventStore;
import org.apache.nifi.provenance.store.StorageResult;
import org.apache.nifi.util.Tuple;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
@@ -83,6 +84,11 @@ public class TestLuceneEventIndex {
return System.getProperty("os.name").toLowerCase().startsWith("windows");
}
+ @Before
+ public void setup() {
+ idGenerator.set(0L);
+ }
+
@Test
public void testGetTimeRange() {
final long now = System.currentTimeMillis();
@@ -170,7 +176,7 @@ public class TestLuceneEventIndex {
}
@Test(timeout = 60000)
- public void testUnauthorizedEventsGetPlaceholdersForExpandChildren() throws InterruptedException {
+ public void testUnauthorizedEventsGetPlaceholdersForExpandChildren() throws InterruptedException, IOException {
assumeFalse(isWindowsEnvironment());
final RepositoryConfiguration repoConfig = createConfig(1);
repoConfig.setDesiredIndexSize(1L);
@@ -224,13 +230,15 @@ public class TestLuceneEventIndex {
List<LineageNode> nodes = Collections.emptyList();
while (nodes.size() < 5) {
- final ComputeLineageSubmission submission = index.submitExpandChildren(1L, user, allowForkEvents);
+ final ComputeLineageSubmission submission = index.submitExpandChildren(fork.getEventId(), user, allowForkEvents);
assertTrue(submission.getResult().awaitCompletion(15, TimeUnit.SECONDS));
nodes = submission.getResult().getNodes();
Thread.sleep(25L);
}
+ nodes.forEach(System.out::println);
+
assertEquals(5, nodes.size());
assertEquals(1L, nodes.stream().filter(n -> n.getNodeType() == LineageNodeType.FLOWFILE_NODE).count());
[nifi] 01/02: NIFI-7232 if users do not supply a remote path
PutSFTP with conflict resolution will fail with an NPE
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
commit 20dda05f2622fe9153c50989d36d7fa0268136e9
Author: Joe Witt <jo...@apache.org>
AuthorDate: Fri Mar 6 10:32:12 2020 -0500
NIFI-7232 if users do not supply a remote path PutSFTP with conflict resolution will fail with an NPE
---
.../java/org/apache/nifi/processors/standard/PutFileTransfer.java | 5 +++--
.../java/org/apache/nifi/processors/standard/util/SFTPTransfer.java | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java
index 20e2c5a..3b9af1a 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java
@@ -39,6 +39,7 @@ import org.apache.nifi.processors.standard.util.FileInfo;
import org.apache.nifi.processors.standard.util.FileTransfer;
import org.apache.nifi.processors.standard.util.SFTPTransfer;
import org.apache.nifi.util.StopWatch;
+import org.apache.nifi.util.StringUtils;
/**
* Base class for PutFTP & PutSFTP
@@ -102,8 +103,8 @@ public abstract class PutFileTransfer<T extends FileTransfer> extends AbstractPr
do {
final String rootPath = context.getProperty(FileTransfer.REMOTE_PATH).evaluateAttributeExpressions(flowFile).getValue();
final String workingDirPath;
- if (rootPath == null) {
- workingDirPath = null;
+ if (StringUtils.isBlank(rootPath)) {
+ workingDirPath = transfer.getHomeDirectory(flowFile);
} else {
workingDirPath = transfer.getAbsolutePath(flowFile, rootPath);
}
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
index 3a341bc..870867f 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
@@ -631,6 +631,7 @@ public class SFTPTransfer implements FileTransfer {
try {
this.homeDir = sftpClient.canonicalize("");
} catch (IOException e) {
+ this.homeDir = "";
// For some combination of server configuration and user home directory, getHome() can fail with "2: File not found"
// Since homeDir is only used tor SEND provenance event transit uri, this is harmless. Log and continue.
logger.debug("Failed to retrieve {} home directory due to {}", new Object[]{username, e.getMessage()});