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
The following commit(s) were added to refs/heads/master by this push:
new 78d9f13 NIFI-6416: This closes #3654. Removing swap locations on
SWAP_IN
78d9f13 is described below
commit 78d9f13ded17901741ffe72801611c4a59f0489a
Author: Brandon <[email protected]>
AuthorDate: Fri Aug 16 13:24:13 2019 +0000
NIFI-6416: This closes #3654. Removing swap locations on SWAP_IN
Signed-off-by: Joe Witt <[email protected]>
---
.../nifi/controller/repository/WriteAheadFlowFileRepository.java | 2 +-
.../nifi/controller/repository/TestWriteAheadFlowFileRepository.java | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/WriteAheadFlowFileRepository.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/WriteAheadFlowFileRepository.java
index 1337511..779c29c 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/WriteAheadFlowFileRepository.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/WriteAheadFlowFileRepository.java
@@ -515,7 +515,7 @@ public class WriteAheadFlowFileRepository implements
FlowFileRepository, SyncLis
updateRepository(repoRecords, true);
synchronized (this.swapLocationSuffixes) {
- this.swapLocationSuffixes.add(normalizeSwapLocation(swapLocation));
+
this.swapLocationSuffixes.remove(normalizeSwapLocation(swapLocation));
}
logger.info("Repository updated to reflect that {} FlowFiles were
swapped in to {}", new Object[]{swapRecords.size(), queue});
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestWriteAheadFlowFileRepository.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestWriteAheadFlowFileRepository.java
index b5196e7..a18b43a 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestWriteAheadFlowFileRepository.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestWriteAheadFlowFileRepository.java
@@ -490,6 +490,10 @@ public class TestWriteAheadFlowFileRepository {
assertFalse(repo.isValidSwapLocationSuffix("swap123"));
repo.updateRepository(records);
assertTrue(repo.isValidSwapLocationSuffix("swap123"));
+
+ repo.swapFlowFilesIn("/tmp/swap123",
Collections.singletonList(flowFileRecord), queue);
+ assertFalse(repo.isValidSwapLocationSuffix("swap123"));
+
repo.close();
}