You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by tu...@apache.org on 2024/09/09 12:11:05 UTC

(nifi) branch main updated: NIFI-13703 Remove deprecated property DISTRIBUTED_CACHE_SERVICE in AbstractListProcessor

This is an automated email from the ASF dual-hosted git repository.

turcsanyi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new bb7cce50d2 NIFI-13703 Remove deprecated property DISTRIBUTED_CACHE_SERVICE in AbstractListProcessor
bb7cce50d2 is described below

commit bb7cce50d27da5618a4eefc80ad9cfa39e94c6bd
Author: EndzeitBegins <16...@users.noreply.github.com>
AuthorDate: Wed Sep 4 21:36:30 2024 +0200

    NIFI-13703 Remove deprecated property DISTRIBUTED_CACHE_SERVICE in AbstractListProcessor
    
    This closes #9246.
    
    Signed-off-by: Peter Turcsanyi <tu...@apache.org>
---
 .../processor/util/list/AbstractListProcessor.java | 130 +--------------------
 .../util/list/TestAbstractListProcessor.java       | 116 ++----------------
 .../apache/nifi/processors/standard/ListFTP.java   |   1 -
 .../apache/nifi/processors/standard/ListSFTP.java  |   1 -
 .../nifi/processors/standard/TestListFile.java     |  11 +-
 5 files changed, 17 insertions(+), 242 deletions(-)

diff --git a/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/main/java/org/apache/nifi/processor/util/list/AbstractListProcessor.java b/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/main/java/org/apache/nifi/processor/util/list/AbstractListProcessor.java
index d09950c52a..36faec3706 100644
--- a/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/main/java/org/apache/nifi/processor/util/list/AbstractListProcessor.java
+++ b/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/main/java/org/apache/nifi/processor/util/list/AbstractListProcessor.java
@@ -17,7 +17,6 @@
 
 package org.apache.nifi.processor.util.list;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.nifi.annotation.behavior.Stateful;
 import org.apache.nifi.annotation.behavior.TriggerSerially;
 import org.apache.nifi.annotation.lifecycle.OnScheduled;
@@ -34,14 +33,10 @@ import org.apache.nifi.components.state.Scope;
 import org.apache.nifi.components.state.StateManager;
 import org.apache.nifi.components.state.StateMap;
 import org.apache.nifi.context.PropertyContext;
-import org.apache.nifi.distributed.cache.client.Deserializer;
-import org.apache.nifi.distributed.cache.client.DistributedMapCacheClient;
-import org.apache.nifi.distributed.cache.client.Serializer;
-import org.apache.nifi.distributed.cache.client.exception.DeserializationException;
-import org.apache.nifi.distributed.cache.client.exception.SerializationException;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
 import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.migration.PropertyConfiguration;
 import org.apache.nifi.processor.AbstractProcessor;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessSession;
@@ -55,11 +50,8 @@ import org.apache.nifi.serialization.WriteResult;
 import org.apache.nifi.serialization.record.RecordSchema;
 import org.apache.nifi.util.StringUtils;
 
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -68,7 +60,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.Properties;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
@@ -171,17 +162,6 @@ public abstract class AbstractListProcessor<T extends ListableEntity> extends Ab
 
     private static final Long IGNORE_MIN_TIMESTAMP_VALUE = 0L;
 
-    public static final PropertyDescriptor DISTRIBUTED_CACHE_SERVICE = new Builder()
-            .name("Distributed Cache Service")
-            .description("NOTE: This property is used merely for migration from old NiFi version before state management was introduced at version 0.5.0. "
-                    + "The stored value in the cache service will be migrated into the state when this processor is started at the first time. "
-                    + "The specified Controller Service was used to maintain state about what had been pulled from the remote server so that if a new node "
-                    + "begins pulling data, it won't duplicate all of the work that has been done. If not specified, the information was not shared across the cluster. "
-                    + "This property did not need to be set for standalone instances of NiFi but was supposed to be configured if NiFi had been running within a cluster.")
-            .required(false)
-            .identifiesControllerService(DistributedMapCacheClient.class)
-            .build();
-
     public static final AllowableValue PRECISION_AUTO_DETECT = new AllowableValue("auto-detect", "Auto Detect",
             "Automatically detect time unit deterministically based on candidate entries timestamp."
                     + " Please note that this option may take longer to list entities unnecessarily, if none of entries has a precise precision timestamp."
@@ -290,8 +270,9 @@ public abstract class AbstractListProcessor<T extends ListableEntity> extends Ab
     static final String LAST_PROCESSED_LATEST_ENTRY_TIMESTAMP_KEY = "processed.timestamp";
     static final String IDENTIFIER_PREFIX = "id";
 
-    public File getPersistenceFile() {
-        return new File("conf/state/" + getIdentifier());
+    @Override
+    public void migrateProperties(PropertyConfiguration config) {
+        config.removeProperty("Distributed Cache Service");
     }
 
     @Override
@@ -391,20 +372,7 @@ public abstract class AbstractListProcessor<T extends ListableEntity> extends Ab
 
     @OnScheduled
     public final void updateState(final ProcessContext context) throws IOException {
-        final String path = getPath(context);
-        final DistributedMapCacheClient client = context.getProperty(DISTRIBUTED_CACHE_SERVICE).asControllerService(DistributedMapCacheClient.class);
-
-        // Check if state already exists for this path. If so, we have already migrated the state.
         final StateMap stateMap = context.getStateManager().getState(getStateScope(context));
-        if (stateMap.getStateVersion().isEmpty()) {
-            try {
-                // Migrate state from the old way of managing state (distributed cache service and local file)
-                // to the new mechanism (State Manager).
-                migrateState(path, client, context.getStateManager(), getStateScope(context));
-            } catch (final IOException ioe) {
-                throw new IOException("Failed to properly migrate state to State Manager", ioe);
-            }
-        }
 
         // When scheduled to run, check if the associated timestamp is null, signifying a clearing of state and reset the internal timestamp
         if (lastListedLatestEntryTimestampMillis != null && stateMap.get(LATEST_LISTED_ENTRY_TIMESTAMP_KEY) == null) {
@@ -418,75 +386,9 @@ public abstract class AbstractListProcessor<T extends ListableEntity> extends Ab
         }
     }
 
-    /**
-     * This processor used to use the DistributedMapCacheClient in order to store cluster-wide state, before the introduction of
-     * the StateManager. This method will migrate state from that DistributedMapCacheClient, or from a local file, to the StateManager,
-     * if any state already exists. More specifically, this will extract out the relevant timestamp for when the processor last ran
-     *
-     * @param path         the path to migrate state for
-     * @param client       the DistributedMapCacheClient that is capable of obtaining the current state
-     * @param stateManager the StateManager to use in order to store the new state
-     * @param scope        the scope to use
-     * @throws IOException if unable to retrieve or store the state
-     */
-    private void migrateState(final String path, final DistributedMapCacheClient client, final StateManager stateManager, final Scope scope) throws IOException {
-        Long minTimestamp = null;
-
-        // Retrieve state from Distributed Cache Client, establishing the latest file seen
-        if (client != null) {
-            final StringSerDe serde = new StringSerDe();
-            final String serializedState = client.get(getKey(path), serde, serde);
-            if (serializedState != null && !serializedState.isEmpty()) {
-                final EntityListing listing = deserialize(serializedState);
-                minTimestamp = listing.getLatestTimestamp().getTime();
-            }
-
-            // remove entry from distributed cache server
-            try {
-                client.remove(path, new StringSerDe());
-            } catch (final IOException ioe) {
-                getLogger().warn("Failed to remove entry from Distributed Cache Service. However, the state has already been migrated to use the new "
-                    + "State Management service, so the Distributed Cache Service is no longer needed.");
-            }
-        }
-
-        // Retrieve state from locally persisted file, and compare these to the minTimestamp established from the distributedCache, if there was one
-        final File persistenceFile = getPersistenceFile();
-        if (persistenceFile.exists()) {
-            final Properties props = new Properties();
-
-            try (final FileInputStream fis = new FileInputStream(persistenceFile)) {
-                props.load(fis);
-            }
-
-            final String locallyPersistedValue = props.getProperty(path);
-            if (locallyPersistedValue != null) {
-                final EntityListing listing = deserialize(locallyPersistedValue);
-                final long localTimestamp = listing.getLatestTimestamp().getTime();
-                // if the local file's latest timestamp is beyond that of the value provided from the cache, replace
-                if (minTimestamp == null || localTimestamp > minTimestamp) {
-                    minTimestamp = localTimestamp;
-                    latestIdentifiersProcessed.clear();
-                    latestIdentifiersProcessed.addAll(listing.getMatchingIdentifiers());
-                }
-            }
-
-            // delete the local file, since it is no longer needed
-            if (persistenceFile.exists() && !persistenceFile.delete()) {
-                getLogger().warn("Migrated state but failed to delete local persistence file");
-            }
-        }
-
-        if (minTimestamp != null) {
-            final Map<String, String> updatedState = createStateMap(minTimestamp, minTimestamp, latestIdentifiersProcessed);
-            stateManager.setState(updatedState, scope);
-        }
-    }
-
     private Map<String, String> createStateMap(final long latestListedEntryTimestampThisCycleMillis,
                                                final long lastProcessedLatestEntryTimestampMillis,
-                                               final List<String> processedIdentifiesWithLatestTimestamp) throws IOException {
-
+                                               final List<String> processedIdentifiesWithLatestTimestamp) {
         final Map<String, String> updatedState = new HashMap<>(processedIdentifiesWithLatestTimestamp.size() + 2);
         updatedState.put(LATEST_LISTED_ENTRY_TIMESTAMP_KEY, String.valueOf(latestListedEntryTimestampThisCycleMillis));
         updatedState.put(LAST_PROCESSED_LATEST_ENTRY_TIMESTAMP_KEY, String.valueOf(lastProcessedLatestEntryTimestampMillis));
@@ -509,11 +411,6 @@ public abstract class AbstractListProcessor<T extends ListableEntity> extends Ab
         return getIdentifier() + ".lastListingTime." + directory;
     }
 
-    private EntityListing deserialize(final String serializedState) throws IOException {
-        final ObjectMapper mapper = new ObjectMapper();
-        return mapper.readValue(serializedState, EntityListing.class);
-    }
-
     @Override
     public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
 
@@ -1073,23 +970,6 @@ public abstract class AbstractListProcessor<T extends ListableEntity> extends Ab
      */
     protected abstract String getListingContainerName(final ProcessContext context);
 
-    private static class StringSerDe implements Serializer<String>, Deserializer<String> {
-
-        @Override
-        public String deserialize(final byte[] value) throws DeserializationException, IOException {
-            if (value == null) {
-                return null;
-            }
-
-            return new String(value, StandardCharsets.UTF_8);
-        }
-        @Override
-        public void serialize(final String value, final OutputStream out) throws SerializationException, IOException {
-            out.write(value.getBytes(StandardCharsets.UTF_8));
-        }
-
-    }
-
     @OnScheduled
     public void initListedEntityTracker(ProcessContext context) {
         final boolean isTrackingEntityStrategy = BY_ENTITIES.getValue().equals(context.getProperty(LISTING_STRATEGY).getValue());
diff --git a/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/test/java/org/apache/nifi/processor/util/list/TestAbstractListProcessor.java b/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/test/java/org/apache/nifi/processor/util/list/TestAbstractListProcessor.java
index 0c5008f497..68e8cb4be7 100644
--- a/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/test/java/org/apache/nifi/processor/util/list/TestAbstractListProcessor.java
+++ b/nifi-extension-bundles/nifi-extension-utils/nifi-listed-entity/src/test/java/org/apache/nifi/processor/util/list/TestAbstractListProcessor.java
@@ -23,7 +23,6 @@ import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.components.PropertyValue;
 import org.apache.nifi.components.Validator;
 import org.apache.nifi.components.state.Scope;
-import org.apache.nifi.components.state.StateManager;
 import org.apache.nifi.components.state.StateMap;
 import org.apache.nifi.context.PropertyContext;
 import org.apache.nifi.controller.AbstractControllerService;
@@ -52,10 +51,7 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 
-import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -63,13 +59,11 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestAbstractListProcessor {
@@ -124,27 +118,6 @@ public class TestAbstractListProcessor {
         runner.assertAllFlowFilesTransferred(AbstractListProcessor.REL_SUCCESS, 1);
     }
 
-    @Test
-    public void testStateMigratedFromCacheService() throws InitializationException {
-
-        final DistributedCache cache = new DistributedCache();
-        runner.addControllerService("cache", cache);
-        runner.enableControllerService(cache);
-        runner.setProperty(AbstractListProcessor.DISTRIBUTED_CACHE_SERVICE, "cache");
-
-        final String serviceState = "{\"latestTimestamp\":1492,\"matchingIdentifiers\":[\"id\"]}";
-        final String cacheKey = runner.getProcessor().getIdentifier() + ".lastListingTime./path";
-        cache.stored.put(cacheKey, serviceState);
-
-        runner.run();
-
-        final MockStateManager stateManager = runner.getStateManager();
-        final Map<String, String> expectedState = Map.of(
-            AbstractListProcessor.LATEST_LISTED_ENTRY_TIMESTAMP_KEY, "1492",
-            AbstractListProcessor.LAST_PROCESSED_LATEST_ENTRY_TIMESTAMP_KEY, "1492");
-        stateManager.assertStateEquals(expectedState, Scope.CLUSTER);
-    }
-
     @Test
     public void testNoStateToMigrate() {
         runner.run();
@@ -154,50 +127,6 @@ public class TestAbstractListProcessor {
         stateManager.assertStateEquals(expectedState, Scope.CLUSTER);
     }
 
-    @Test
-    public void testStateMigratedFromLocalFile() throws Exception {
-
-        // Create a file that we will populate with the desired state
-        File persistenceFile = testFolder.resolve(proc.persistenceFilename).toFile();
-        // Override the processor's internal persistence file
-        proc.persistenceFile = persistenceFile;
-
-        // Local File persistence was a properties file format of <key>=<JSON entity listing representation>
-        // Our ConcreteListProcessor is centered around files which are provided for a given path
-        final String serviceState = proc.getPath(runner.getProcessContext()) + "={\"latestTimestamp\":1492,\"matchingIdentifiers\":[\"id\"]}";
-
-        // Create a persistence file of the format anticipated
-        try (FileOutputStream fos = new FileOutputStream(persistenceFile)) {
-            fos.write(serviceState.getBytes(StandardCharsets.UTF_8));
-        }
-
-        runner.run();
-
-        // Verify the local persistence file is removed
-        assertFalse(persistenceFile.exists(), "Failed to remove persistence file");
-
-        // Verify the state manager now maintains the associated state
-        final Map<String, String> expectedState = new HashMap<>();
-        // Ensure timestamp and identifies are migrated
-        expectedState.put(AbstractListProcessor.LATEST_LISTED_ENTRY_TIMESTAMP_KEY, "1492");
-        expectedState.put(AbstractListProcessor.LAST_PROCESSED_LATEST_ENTRY_TIMESTAMP_KEY, "1492");
-        expectedState.put(AbstractListProcessor.IDENTIFIER_PREFIX + ".0", "id");
-        runner.getStateManager().assertStateEquals(expectedState, Scope.CLUSTER);
-    }
-
-    @Test
-    public void testFetchOnStart() throws InitializationException {
-
-        final DistributedCache cache = new DistributedCache();
-        runner.addControllerService("cache", cache);
-        runner.enableControllerService(cache);
-        runner.setProperty(AbstractListProcessor.DISTRIBUTED_CACHE_SERVICE, "cache");
-
-        runner.run();
-
-        assertEquals(1, cache.fetchCount);
-    }
-
     @Test
     public void testWriteRecords() throws InitializationException {
         final RecordSetWriterFactory writerFactory = new MockRecordWriter("id,name,timestamp,size", false);
@@ -306,20 +235,20 @@ public class TestAbstractListProcessor {
         proc.currentTimestamp.set(1L);
         runner.clearTransferState();
         // Prior to running the processor, we should expect 3 objects during verification
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 1 object.  Of that, 1 matches the filter.");
         runner.run();
         assertEquals(1, runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).size());
         runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).get(0)
             .assertAttributeEquals(CoreAttributes.FILENAME.key(), "one");
         // The object is now tracked, so it's no longer considered new
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 1 object.  Of that, 1 matches the filter.");
 
         // Should not list any entity.
         proc.currentTimestamp.set(2L);
         runner.clearTransferState();
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 1 object.  Of that, 1 matches the filter.");
         runner.run();
         assertEquals(0, runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).size());
@@ -329,7 +258,7 @@ public class TestAbstractListProcessor {
         proc.addEntity("five", "five", 5, 5);
         proc.addEntity("six", "six", 6, 6);
         runner.clearTransferState();
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 3 objects.  Of those, 3 match the filter.");
         runner.run();
         assertEquals(2, runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).size());
@@ -346,7 +275,7 @@ public class TestAbstractListProcessor {
         proc.addEntity("three", "three", 3, 3);
         proc.addEntity("four", "four", 4, 4);
         runner.clearTransferState();
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 6 objects.  Of those, 6 match the filter.");
         runner.run();
         assertEquals(2, runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).size());
@@ -361,7 +290,7 @@ public class TestAbstractListProcessor {
         proc.addEntity("five", "five", 7, 5);
         proc.addEntity("six", "six", 6, 16);
         runner.clearTransferState();
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 6 objects.  Of those, 6 match the filter.");
         runner.run();
         assertEquals(2, runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).size());
@@ -380,7 +309,7 @@ public class TestAbstractListProcessor {
         runner.clearTransferState();
 
         // Prior to running the processor, we should expect 3 objects during verification
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 6 objects.  Of those, 6 match the filter.");
         runner.run();
 
@@ -399,14 +328,14 @@ public class TestAbstractListProcessor {
         runner.setProperty(ConcreteListProcessor.RESET_STATE, "2");
         runner.clearTransferState();
 
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 6 objects.  Of those, 6 match the filter.");
 
         runner.run();
         // All entities should be picked, one to six.
         assertEquals(6, runner.getFlowFilesForRelationship(AbstractListProcessor.REL_SUCCESS).size());
         // Now all are tracked, so none are new
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 6 objects.  Of those, 6 match the filter.");
 
         // Reset state again.
@@ -418,7 +347,7 @@ public class TestAbstractListProcessor {
         runner.clearTransferState();
 
         // Time window is now 5ms - 25ms, so only 5 and 6 fall in the window, so only 1 of the 2 filtered entities are considered 'new'
-        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*.json.*" +
+        assertVerificationOutcome(Outcome.SUCCESSFUL, "Successfully listed contents of .*\\.\\s*" +
                 "Found 6 objects.  Of those, 2 match the filter.");
     }
 
@@ -477,10 +406,6 @@ public class TestAbstractListProcessor {
     static class ConcreteListProcessor extends AbstractListProcessor<ListableEntity> {
         final Map<String, ListableEntity> entities = new HashMap<>();
 
-        final String persistenceFilename = "ListProcessor-local-state-" + UUID.randomUUID() + ".json";
-        String persistenceFolder = "target/";
-        File persistenceFile = new File(persistenceFolder + persistenceFilename);
-
         private static final PropertyDescriptor RESET_STATE = new PropertyDescriptor.Builder()
                 .name("reset-state")
                 .addValidator(Validator.VALID)
@@ -504,7 +429,6 @@ public class TestAbstractListProcessor {
             final List<PropertyDescriptor> properties = new ArrayList<>();
             properties.add(LISTING_STRATEGY);
             properties.add(RECORD_WRITER);
-            properties.add(DISTRIBUTED_CACHE_SERVICE);
             properties.add(TARGET_SYSTEM_TIMESTAMP_PRECISION);
             properties.add(ListedEntityTracker.TRACKING_STATE_CACHE);
             properties.add(ListedEntityTracker.TRACKING_TIME_WINDOW);
@@ -514,11 +438,6 @@ public class TestAbstractListProcessor {
             return properties;
         }
 
-        @Override
-        public File getPersistenceFile() {
-            return persistenceFile;
-        }
-
         public void addEntity(final String name, final String identifier, final long timestamp) {
             addEntity(name, identifier, timestamp, 0);
         }
@@ -596,7 +515,7 @@ public class TestAbstractListProcessor {
 
         @Override
         protected String getListingContainerName(final ProcessContext context) {
-            return persistenceFilename;
+            return String.format("In-memory entity collection [%s]", entities);
         }
 
         @Override
@@ -613,18 +532,5 @@ public class TestAbstractListProcessor {
             fields.add(new RecordField("size", RecordFieldType.LONG.getDataType()));
             return new SimpleRecordSchema(fields);
         }
-
-        private void persist(final long latestListedEntryTimestampThisCycleMillis,
-                             final long lastProcessedLatestEntryTimestampMillis,
-                             final List<String> processedIdentifiesWithLatestTimestamp,
-                             final StateManager stateManager, final Scope scope) throws IOException {
-            final Map<String, String> updatedState = new HashMap<>(processedIdentifiesWithLatestTimestamp.size() + 2);
-            updatedState.put(LATEST_LISTED_ENTRY_TIMESTAMP_KEY, String.valueOf(latestListedEntryTimestampThisCycleMillis));
-            updatedState.put(LAST_PROCESSED_LATEST_ENTRY_TIMESTAMP_KEY, String.valueOf(lastProcessedLatestEntryTimestampMillis));
-            for (int i = 0; i < processedIdentifiesWithLatestTimestamp.size(); i++) {
-                updatedState.put(IDENTIFIER_PREFIX + "." + i, processedIdentifiesWithLatestTimestamp.get(i));
-            }
-            stateManager.setState(updatedState, scope);
-        }
     }
 }
diff --git a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java
index 197db10422..829392c429 100644
--- a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java
+++ b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java
@@ -81,7 +81,6 @@ public class ListFTP extends ListFileTransfer {
             FTPTransfer.PASSWORD,
             REMOTE_PATH,
             RECORD_WRITER,
-            DISTRIBUTED_CACHE_SERVICE,
             FTPTransfer.RECURSIVE_SEARCH,
             FTPTransfer.FOLLOW_SYMLINK,
             FTPTransfer.FILE_FILTER_REGEX,
diff --git a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListSFTP.java b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListSFTP.java
index 96bf97775c..db2adb2591 100644
--- a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListSFTP.java
+++ b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListSFTP.java
@@ -89,7 +89,6 @@ public class ListSFTP extends ListFileTransfer {
             SFTPTransfer.PRIVATE_KEY_PASSPHRASE,
             REMOTE_PATH,
             RECORD_WRITER,
-            DISTRIBUTED_CACHE_SERVICE,
             SFTPTransfer.RECURSIVE_SEARCH,
             SFTPTransfer.FOLLOW_SYMLINK,
             SFTPTransfer.FILE_FILTER_REGEX,
diff --git a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListFile.java b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListFile.java
index b874e9a041..4d605217c3 100644
--- a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListFile.java
+++ b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListFile.java
@@ -116,17 +116,8 @@ public class TestListFile {
         resetAges();
     }
 
-    public void tearDown() throws Exception {
+    public void tearDown() {
         deleteDirectory(testDir);
-        File tempFile = processor.getPersistenceFile();
-        if (tempFile.exists()) {
-            File[] stateFiles = tempFile.getParentFile().listFiles();
-            if (stateFiles != null) {
-                for (File stateFile : stateFiles) {
-                    assertTrue(stateFile.delete());
-                }
-            }
-        }
     }
 
     private List<File> listFiles(final File file) {