diff --git a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/PlaceholderProvenanceEvent.java b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/PlaceholderProvenanceEvent.java index 083b13e9d7..26696c8b17 100644 --- a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/PlaceholderProvenanceEvent.java +++ b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/PlaceholderProvenanceEvent.java @@ -20,7 +20,6 @@ package org.apache.nifi.provenance; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Set; /** * A Provenance Event that is used to replace another Provenance Event when authorizations diff --git a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardProvenanceEventRecord.java b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardProvenanceEventRecord.java index 7b0c91f7f8..34de366e12 100644 --- a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardProvenanceEventRecord.java +++ b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardProvenanceEventRecord.java @@ -104,7 +104,6 @@ public final class StandardProvenanceEventRecord implements ProvenanceEventRecor updatedAttributes = builder.updatedAttributes == null ? Collections.emptyMap() : Collections.unmodifiableMap(builder.updatedAttributes); sourceQueueIdentifier = builder.sourceQueueIdentifier; - } public String getStorageFilename() { diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/StandardValidators.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/StandardValidators.java index 2419c897e4..47d5d5034e 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/StandardValidators.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/StandardValidators.java @@ -21,14 +21,12 @@ import java.net.URI; import java.net.URL; import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; -import java.util.Collection; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; -import org.apache.nifi.controller.ControllerService; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.processor.DataUnit; @@ -710,54 +708,4 @@ public class StandardValidators { } } - /** - * Creates a validator based on existence of a {@link ControllerService}. - * - * @param serviceClass the controller service API your - * {@link ConfigurableComponent} depends on - * @return a Validator - * @deprecated As of release 0.1.0-incubating, replaced by - * {@link org.apache.nifi.components.PropertyDescriptor.Builder#identifiesControllerService(Class)} - */ - @Deprecated - public static Validator createControllerServiceExistsValidator(final Class serviceClass) { - return new Validator() { - @Override - public ValidationResult validate(final String subject, final String input, final ValidationContext context) { - if (context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input)) { - return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build(); - } - - final ControllerService svc = context.getControllerServiceLookup().getControllerService(input); - - if (svc == null) { - return new ValidationResult.Builder().valid(false).input(input).subject(subject).explanation("No Controller Service exists with this ID").build(); - } - - if (!serviceClass.isAssignableFrom(svc.getClass())) { - return new ValidationResult.Builder() - .valid(false) - .input(input) - .subject(subject) - .explanation("Controller Service with this ID is of type " + svc.getClass().getName() + " but is expected to be of type " + serviceClass.getName()) - .build(); - } - - final ValidationContext serviceValidationContext = context.getControllerServiceValidationContext(svc); - final Collection serviceValidationResults = svc.validate(serviceValidationContext); - for (final ValidationResult result : serviceValidationResults) { - if (!result.isValid()) { - return new ValidationResult.Builder() - .valid(false) - .input(input) - .subject(subject) - .explanation("Controller Service " + input + " is not valid: " + result.getExplanation()) - .build(); - } - } - - return new ValidationResult.Builder().input(input).subject(subject).valid(true).build(); - } - }; - } } diff --git a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/BooleanHolder.java b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/BooleanHolder.java deleted file mode 100644 index 8283389a2a..0000000000 --- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/BooleanHolder.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.util; - -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * @deprecated As of release 1.0.1. Please use {@link AtomicBoolean} - * - * Wraps an Boolean value so that it can be declared final and still be accessed from inner classes; - * the functionality is similar to that of an AtomicBoolean, but operations on this class - * are not atomic. This results in greater performance when the atomicity is not needed. - * - */ - -@Deprecated -public class BooleanHolder extends ObjectHolder { - - public BooleanHolder(final boolean initialValue) { - super(initialValue); - } - -} diff --git a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/IntegerHolder.java b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/IntegerHolder.java deleted file mode 100644 index 8abfdb153f..0000000000 --- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/IntegerHolder.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.util; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @deprecated As of release 1.0.1. Please use {@link AtomicInteger} - * - * Wraps an Integer value so that it can be declared final and still be accessed from inner classes; - * the functionality is similar to that of an AtomicInteger, but operations on this class - * are not atomic. This results in greater performance when the atomicity is not needed. - * - */ - -@Deprecated -public class IntegerHolder extends ObjectHolder { - - public IntegerHolder(final int initialValue) { - super(initialValue); - } - - public int addAndGet(final int delta) { - final int curValue = get(); - final int newValue = curValue + delta; - set(newValue); - return newValue; - } - - public int getAndAdd(final int delta) { - final int curValue = get(); - final int newValue = curValue + delta; - set(newValue); - return curValue; - } - - public int incrementAndGet() { - return addAndGet(1); - } - - public int getAndIncrement() { - return getAndAdd(1); - } - - public int decrementAndGet() { - return addAndGet(-1); - } - -} diff --git a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/LongHolder.java b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/LongHolder.java deleted file mode 100644 index 723463a135..0000000000 --- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/LongHolder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.util; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @deprecated As of release 1.0.1. Please use {@link AtomicLong} - * - * Wraps a Long value so that it can be declared final and still be accessed from inner classes; - * the functionality is similar to that of an AtomicLong, but operations on this class - * are not atomic. This results in greater performance when the atomicity is not needed. - */ - -@Deprecated -public class LongHolder extends ObjectHolder { - - public LongHolder(final long initialValue) { - super(initialValue); - } - - public long addAndGet(final long delta) { - final long curValue = get(); - final long newValue = curValue + delta; - set(newValue); - return newValue; - } - - public long getAndAdd(final long delta) { - final long curValue = get(); - final long newValue = curValue + delta; - set(newValue); - return curValue; - } - - public long incrementAndGet() { - return addAndGet(1); - } - - public long getAndIncrement() { - return getAndAdd(1); - } - - public long decrementAndGet() { - return addAndGet(-1L); - } - - public long getAndDecrement() { - return getAndAdd(-1L); - } -} diff --git a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/ObjectHolder.java b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/ObjectHolder.java deleted file mode 100644 index c577d6f5cd..0000000000 --- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/ObjectHolder.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.util; - -import java.util.concurrent.atomic.AtomicReference; - -/** - * @deprecated As of release 0.7.0. Please use {@link AtomicReference} - * - * A bean that holds a single value of type T. - * - */ - -@Deprecated -public class ObjectHolder { - - private T value; - - public ObjectHolder(final T initialValue) { - this.value = initialValue; - } - - public T get() { - return value; - } - - public void set(T value) { - this.value = value; - } -} diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java b/nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java index 02806b0e8d..516c8a44b7 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java @@ -28,7 +28,6 @@ import java.nio.file.StandardOpenOption; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.UUID; diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java index 7d49f0f236..b80c09f1d7 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java @@ -65,7 +65,6 @@ import org.apache.nifi.processor.ProcessSessionFactory; import org.apache.nifi.processor.Processor; import org.apache.nifi.processor.Relationship; import org.apache.nifi.provenance.ProvenanceEventRecord; -import org.apache.nifi.provenance.ProvenanceReporter; import org.apache.nifi.reporting.InitializationException; import org.apache.nifi.state.MockStateManager; import org.junit.Assert; @@ -459,15 +458,6 @@ public class StandardProcessorTestRunner implements TestRunner { return flowFiles; } - /** - * @deprecated The ProvenanceReporter should not be accessed through the test runner, as it does not expose the events that were emitted. - */ - @Override - @Deprecated - public ProvenanceReporter getProvenanceReporter() { - return sharedState.getProvenanceReporter(); - } - @Override public QueueSize getQueueSize() { return flowFileQueue.size(); @@ -584,13 +574,6 @@ public class StandardProcessorTestRunner implements TestRunner { @Override public void addControllerService(final String identifier, final ControllerService service, final Map properties) throws InitializationException { - // hold off on failing due to deprecated annotation for now... will introduce later. - // for ( final Method method : service.getClass().getMethods() ) { - // if ( method.isAnnotationPresent(org.apache.nifi.controller.annotation.OnConfigured.class) ) { - // Assert.fail("Controller Service " + service + " is using deprecated Annotation " + org.apache.nifi.controller.annotation.OnConfigured.class + " for method " + method); - // } - // } - final MockComponentLog logger = new MockComponentLog(identifier, service); controllerServiceLoggers.put(identifier, logger); final MockStateManager serviceStateManager = new MockStateManager(service); diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java index c3bedb1915..44d7f9fb9c 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java @@ -33,7 +33,6 @@ import org.apache.nifi.processor.ProcessSessionFactory; import org.apache.nifi.processor.Processor; import org.apache.nifi.processor.Relationship; import org.apache.nifi.provenance.ProvenanceEventRecord; -import org.apache.nifi.provenance.ProvenanceReporter; import org.apache.nifi.reporting.InitializationException; import org.apache.nifi.state.MockStateManager; @@ -485,12 +484,6 @@ public interface TestRunner { */ List getPenalizedFlowFiles(); - /** - * @return the {@link ProvenanceReporter} that will be used by the - * configured {@link Processor} for reporting Provenance Events - */ - ProvenanceReporter getProvenanceReporter(); - /** * @return the current size of the Processor's Input Queue */ diff --git a/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java b/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java index 0e41e89f26..f5b28aaf87 100644 --- a/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java +++ b/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java @@ -110,26 +110,6 @@ public class TestStandardProcessorTestRunner { runner.assertAllFlowFilesContainAttribute(AddAttributeProcessor.KEY); } - @org.apache.nifi.annotation.documentation.Tags({"deprecated"}) - private static class NewAnnotation extends AbstractProcessor { - - @Override - public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - } - } - - private static class NewMethodAnnotation extends AbstractProcessor { - - @org.apache.nifi.annotation.lifecycle.OnScheduled - public void dummy() { - - } - - @Override - public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - } - } - private static class ProcessorWithOnStop extends AbstractProcessor { private int callsWithContext = 0; diff --git a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java index 38e3a0dfc0..ac6936f1d4 100644 --- a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java +++ b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java @@ -27,6 +27,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; import org.apache.avro.file.CodecFactory; import org.apache.avro.file.DataFileConstants; @@ -57,7 +58,6 @@ import org.apache.nifi.processor.io.InputStreamCallback; import org.apache.nifi.processor.io.OutputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; import org.apache.nifi.stream.io.BufferedOutputStream; -import org.apache.nifi.util.ObjectHolder; @SideEffectFree @SupportsBatching @@ -231,7 +231,7 @@ public class SplitAvro extends AbstractProcessor { @Override public List split(final ProcessSession session, final FlowFile originalFlowFile, final SplitWriter splitWriter) { final List childFlowFiles = new ArrayList<>(); - final ObjectHolder recordHolder = new ObjectHolder<>(null); + final AtomicReference recordHolder = new AtomicReference<>(null); session.read(originalFlowFile, new InputStreamCallback() { @Override @@ -239,7 +239,7 @@ public class SplitAvro extends AbstractProcessor { try (final InputStream in = new BufferedInputStream(rawIn); final DataFileStream reader = new DataFileStream<>(in, new GenericDatumReader())) { - final ObjectHolder codec = new ObjectHolder<>(reader.getMetaString(DataFileConstants.CODEC)); + final AtomicReference codec = new AtomicReference<>(reader.getMetaString(DataFileConstants.CODEC)); if (codec.get() == null) { codec.set(DataFileConstants.NULL_CODEC); } diff --git a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java index 3182958260..ca7f690c03 100644 --- a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java +++ b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java @@ -52,7 +52,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.OutputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.LongHolder; import org.apache.nifi.util.StopWatch; import java.io.IOException; @@ -71,6 +70,7 @@ import java.util.TimeZone; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicLong; @Tags({"cassandra", "cql", "select"}) @EventDriven @@ -228,7 +228,7 @@ public class QueryCassandra extends AbstractCassandraProcessor { // and states that it is thread-safe. This is why connectionSession is not in a try-with-resources. final Session connectionSession = cassandraSession.get(); final ResultSetFuture queryFuture = connectionSession.executeAsync(selectQuery); - final LongHolder nrOfRows = new LongHolder(0L); + final AtomicLong nrOfRows = new AtomicLong(0L); fileToProcess = session.write(fileToProcess, new OutputStreamCallback() { @Override @@ -259,7 +259,7 @@ public class QueryCassandra extends AbstractCassandraProcessor { }); // set attribute how many rows were selected - fileToProcess = session.putAttribute(fileToProcess, RESULT_ROW_COUNT, nrOfRows.get().toString()); + fileToProcess = session.putAttribute(fileToProcess, RESULT_ROW_COUNT, String.valueOf(nrOfRows.get())); logger.info("{} contains {} Avro records; transferring to 'success'", new Object[]{fileToProcess, nrOfRows.get()}); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java index 5a33eecbfd..a4c267c1db 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java @@ -284,8 +284,6 @@ public class FileSystemSwapManager implements FlowFileSwapManager { } } - - @SuppressWarnings("deprecation") public static int serializeFlowFiles(final List toSwap, final FlowFileQueue queue, final String swapLocation, final OutputStream destination) throws IOException { if (toSwap == null || toSwap.isEmpty()) { return 0; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java index 76b946ffb7..80b89dd4f4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java @@ -986,7 +986,6 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R * @throws NullPointerException if either arg is null * @throws ProcessorInstantiationException if the processor cannot be instantiated for any reason */ - @SuppressWarnings("deprecation") public ProcessorNode createProcessor(final String type, String id, final boolean firstTimeAdded) throws ProcessorInstantiationException { id = id.intern(); @@ -3605,7 +3604,6 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R return replayFlowFile(record, user); } - @SuppressWarnings("deprecation") public ProvenanceEventRecord replayFlowFile(final ProvenanceEventRecord event, final NiFiUser user) throws IOException { if (event == null) { throw new NullPointerException(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java index aa77765f92..f391da5551 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java @@ -733,7 +733,6 @@ public final class StandardFlowFileQueue implements FlowFileQueue { } @Override - @SuppressWarnings("deprecation") public int compare(final FlowFileRecord f1, final FlowFileRecord f2) { int returnVal = 0; final boolean f1Penalized = f1.isPenalized(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java index b232f26538..9d2c45cf02 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java @@ -139,7 +139,6 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable processor.getClass().getSimpleName(), processor.getClass().getCanonicalName()); } - @SuppressWarnings("deprecation") public StandardProcessorNode(final Processor processor, final String uuid, final ValidationContextFactory validationContextFactory, final ProcessScheduler scheduler, final ControllerServiceProvider controllerServiceProvider, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java index 210fcca57c..673440fa6e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java @@ -70,7 +70,6 @@ import org.apache.nifi.stream.io.ByteCountingOutputStream; import org.apache.nifi.stream.io.StreamUtils; import org.apache.nifi.stream.io.SynchronizedByteCountingOutputStream; import org.apache.nifi.util.FormatUtils; -import org.apache.nifi.util.LongHolder; import org.apache.nifi.util.NiFiProperties; import org.apache.nifi.util.StopWatch; import org.apache.nifi.util.file.FileUtils; @@ -297,7 +296,7 @@ public class FileSystemRepository implements ContentRepository { final Callable scanContainer = new Callable() { @Override public Long call() throws IOException { - final LongHolder oldestDateHolder = new LongHolder(0L); + final AtomicLong oldestDateHolder = new AtomicLong(0L); // the path already exists, so scan the path to find any files and update maxIndex to the max of // all filenames seen. diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java index 1e2d634919..0a2f8c9e7a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java @@ -54,7 +54,6 @@ import org.apache.nifi.controller.repository.io.DisableOnCloseOutputStream; import org.apache.nifi.controller.repository.io.FlowFileAccessInputStream; import org.apache.nifi.controller.repository.io.FlowFileAccessOutputStream; import org.apache.nifi.controller.repository.io.LimitedInputStream; -import org.apache.nifi.controller.repository.io.LongHolder; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; import org.apache.nifi.processor.FlowFileFilter; @@ -120,8 +119,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE private int removedCount = 0; // number of flowfiles removed in this session private long removedBytes = 0L; // size of all flowfiles removed in this session - private final LongHolder bytesRead = new LongHolder(0L); - private final LongHolder bytesWritten = new LongHolder(0L); + private final AtomicLong bytesRead = new AtomicLong(0L); + private final AtomicLong bytesWritten = new AtomicLong(0L); private int flowFilesIn = 0, flowFilesOut = 0; private long contentSizeIn = 0L, contentSizeOut = 0L; @@ -966,8 +965,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE final Connectable connectable = context.getConnectable(); final StandardFlowFileEvent flowFileEvent = new StandardFlowFileEvent(connectable.getIdentifier()); - flowFileEvent.setBytesRead(bytesRead.getValue()); - flowFileEvent.setBytesWritten(bytesWritten.getValue()); + flowFileEvent.setBytesRead(bytesRead.get()); + flowFileEvent.setBytesWritten(bytesWritten.get()); // update event repository try { @@ -1055,8 +1054,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE flowFilesOut = 0; removedCount = 0; removedBytes = 0L; - bytesRead.setValue(0L); - bytesWritten.setValue(0L); + bytesRead.set(0L); + bytesWritten.set(0L); connectionCounts.clear(); createdFlowFiles.clear(); removedFlowFiles.clear(); @@ -1822,7 +1821,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE } currentReadClaim = claim; - currentReadClaimStream = new ByteCountingInputStream(rawInStream, new LongHolder(0L)); + currentReadClaimStream = new ByteCountingInputStream(rawInStream, new AtomicLong(0L)); StreamUtils.skip(currentReadClaimStream, offset); // Use a non-closeable stream because we want to keep it open after the callback has finished so that we can @@ -2069,8 +2068,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE writtenCount += footer.length; } } finally { - bytesWritten.increment(writtenCount); - bytesRead.increment(readCount); + bytesWritten.getAndAdd(writtenCount); + bytesRead.getAndAdd(readCount); } } catch (final ContentNotFoundException nfe) { destroyContent(newClaim); @@ -2111,7 +2110,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE final StandardRepositoryRecord record = records.get(source); ContentClaim newClaim = null; - final LongHolder writtenHolder = new LongHolder(0L); + final AtomicLong writtenHolder = new AtomicLong(0L); try { newClaim = context.getContentRepository().create(context.getConnectable().isLossTolerant()); claimLog.debug("Creating ContentClaim {} for 'write' for {}", newClaim, source); @@ -2142,7 +2141,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE destroyContent(newClaim); throw t; } finally { - bytesWritten.increment(writtenHolder.getValue()); + bytesWritten.getAndAdd(writtenHolder.get()); } removeTemporaryClaim(record); @@ -2150,7 +2149,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE .fromFlowFile(record.getCurrent()) .contentClaim(newClaim) .contentClaimOffset(0) - .size(writtenHolder.getValue()) + .size(writtenHolder.get()) .build(); record.setWorking(newFile); @@ -2178,7 +2177,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE final OutputStream rawOutStream = context.getContentRepository().write(newClaim); final OutputStream bufferedOutStream = new BufferedOutputStream(rawOutStream); - outStream = new ByteCountingOutputStream(bufferedOutStream, new LongHolder(0L)); + outStream = new ByteCountingOutputStream(bufferedOutStream, new AtomicLong(0L)); originalByteWrittenCount = 0; appendableStreams.put(newClaim, outStream); @@ -2224,7 +2223,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE } finally { if (outStream != null) { final long bytesWrittenThisIteration = outStream.getBytesWritten() - originalByteWrittenCount; - bytesWritten.increment(bytesWrittenThisIteration); + bytesWritten.getAndAdd(bytesWrittenThisIteration); } } @@ -2313,7 +2312,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE final ContentClaim currClaim = record.getCurrentClaim(); ContentClaim newClaim = null; - final LongHolder writtenHolder = new LongHolder(0L); + final AtomicLong writtenHolder = new AtomicLong(0L); try { newClaim = context.getContentRepository().create(context.getConnectable().isLossTolerant()); claimLog.debug("Creating ContentClaim {} for 'write' for {}", newClaim, source); @@ -2365,7 +2364,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE destroyContent(newClaim); throw t; } finally { - bytesWritten.increment(writtenHolder.getValue()); + bytesWritten.getAndAdd(writtenHolder.get()); } removeTemporaryClaim(record); @@ -2373,7 +2372,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE .fromFlowFile(record.getCurrent()) .contentClaim(newClaim) .contentClaimOffset(0L) - .size(writtenHolder.getValue()) + .size(writtenHolder.get()) .build(); record.setWorking(newFile); @@ -2405,8 +2404,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE long newSize = 0L; try { newSize = context.getContentRepository().importFrom(source, newClaim); - bytesWritten.increment(newSize); - bytesRead.increment(newSize); + bytesWritten.getAndAdd(newSize); + bytesRead.getAndAdd(newSize); } catch (final Throwable t) { destroyContent(newClaim); throw new FlowFileAccessException("Failed to import data from " + source + " for " + destination + " due to " + t.toString(), t); @@ -2439,7 +2438,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE claimLog.debug("Creating ContentClaim {} for 'importFrom' for {}", newClaim, destination); newSize = context.getContentRepository().importFrom(source, newClaim); - bytesWritten.increment(newSize); + bytesWritten.getAndAdd(newSize); } catch (final IOException e) { throw new FlowFileAccessException("Unable to create ContentClaim due to " + e.toString(), e); } @@ -2465,8 +2464,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE ensureNotAppending(record.getCurrentClaim()); final long copyCount = context.getContentRepository().exportTo(record.getCurrentClaim(), destination, append, record.getCurrentClaimOffset(), source.getSize()); - bytesRead.increment(copyCount); - bytesWritten.increment(copyCount); + bytesRead.getAndAdd(copyCount); + bytesWritten.getAndAdd(copyCount); } catch (final ContentNotFoundException nfe) { handleContentNotFound(nfe, record); } catch (final Throwable t) { @@ -2640,7 +2639,6 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE // When creating a new FlowFile from multiple parents, we need to add all of the Lineage Identifiers // and use the earliest lineage start date long lineageStartDate = 0L; - final Set lineageIdentifiers = new HashSet<>(); for (final FlowFile parent : parents) { final long parentLineageStartDate = parent.getLineageStartDate(); @@ -2785,8 +2783,8 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE this.removedCount += session.removedCount; this.removedBytes += session.removedBytes; - this.bytesRead += session.bytesRead.getValue(); - this.bytesWritten += session.bytesWritten.getValue(); + this.bytesRead += session.bytesRead.get(); + this.bytesWritten += session.bytesWritten.get(); this.flowFilesIn += session.flowFilesIn; this.flowFilesOut += session.flowFilesOut; this.contentSizeIn += session.contentSizeIn; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingInputStream.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingInputStream.java index 6cd5d4a432..7de25accec 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingInputStream.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingInputStream.java @@ -18,14 +18,15 @@ package org.apache.nifi.controller.repository.io; import java.io.IOException; import java.io.InputStream; +import java.util.concurrent.atomic.AtomicLong; public class ByteCountingInputStream extends InputStream { - private final LongHolder bytesReadHolder; + private final AtomicLong bytesReadHolder; private final InputStream in; private long bytesSkipped = 0L; - public ByteCountingInputStream(final InputStream in, final LongHolder longHolder) { + public ByteCountingInputStream(final InputStream in, final AtomicLong longHolder) { this.in = in; this.bytesReadHolder = longHolder; } @@ -34,7 +35,7 @@ public class ByteCountingInputStream extends InputStream { public int read() throws IOException { final int fromSuper = in.read(); if (fromSuper >= 0) { - bytesReadHolder.increment(1); + bytesReadHolder.getAndIncrement(); } return fromSuper; } @@ -43,7 +44,7 @@ public class ByteCountingInputStream extends InputStream { public int read(byte[] b, int off, int len) throws IOException { final int fromSuper = in.read(b, off, len); if (fromSuper >= 0) { - bytesReadHolder.increment(fromSuper); + bytesReadHolder.getAndAdd(fromSuper); } return fromSuper; @@ -87,7 +88,7 @@ public class ByteCountingInputStream extends InputStream { } public long getBytesRead() { - return bytesReadHolder.getValue(); + return bytesReadHolder.get(); } public long getBytesSkipped() { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingOutputStream.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingOutputStream.java index 4e727e9a23..7c778a28b9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingOutputStream.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/ByteCountingOutputStream.java @@ -18,13 +18,14 @@ package org.apache.nifi.controller.repository.io; import java.io.IOException; import java.io.OutputStream; +import java.util.concurrent.atomic.AtomicLong; public class ByteCountingOutputStream extends OutputStream { - private final LongHolder bytesWrittenHolder; + private final AtomicLong bytesWrittenHolder; private final OutputStream out; - public ByteCountingOutputStream(final OutputStream out, final LongHolder longHolder) { + public ByteCountingOutputStream(final OutputStream out, final AtomicLong longHolder) { this.out = out; this.bytesWrittenHolder = longHolder; } @@ -32,7 +33,7 @@ public class ByteCountingOutputStream extends OutputStream { @Override public void write(int b) throws IOException { out.write(b); - bytesWrittenHolder.increment(1); + bytesWrittenHolder.getAndIncrement(); } @Override @@ -43,11 +44,11 @@ public class ByteCountingOutputStream extends OutputStream { @Override public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len); - bytesWrittenHolder.increment(len); + bytesWrittenHolder.getAndAdd(len); } public long getBytesWritten() { - return bytesWrittenHolder.getValue(); + return bytesWrittenHolder.get(); } @Override diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/LongHolder.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/LongHolder.java deleted file mode 100644 index bd5fec13fd..0000000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/io/LongHolder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.controller.repository.io; - -/** - * Class to hold a long value that can be incremented and decremented. This allows the abstraction of passing a long value by reference, rather than by value, without the overhead of synchronization - * required by the use of an AtomicLong. - */ -public class LongHolder { - - private long value; - - public LongHolder() { - value = 0L; - } - - public LongHolder(final long initialValue) { - value = initialValue; - } - - public void increment(long value) { - this.value += value; - } - - public long getValue() { - return value; - } - - public void setValue(final long value) { - this.value = value; - } -} diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java index d3410cca50..262ac77c81 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java @@ -270,7 +270,6 @@ public class EventDrivenSchedulingAgent extends AbstractSchedulingAgent { } } - @SuppressWarnings("deprecation") private void trigger(final Connectable worker, final ScheduleState scheduleState, final ConnectableProcessContext processContext, final ProcessSessionFactory sessionFactory) { final int newThreadCount = scheduleState.incrementActiveThreadCount(); if (newThreadCount > worker.getMaxConcurrentTasks() && worker.getMaxConcurrentTasks() > 0) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java index 1729d4ac65..53fc726351 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java @@ -181,7 +181,6 @@ public final class StandardProcessScheduler implements ProcessScheduler { scheduleState.setScheduled(true); final Runnable startReportingTaskRunnable = new Runnable() { - @SuppressWarnings("deprecation") @Override public void run() { final long lastStopTime = scheduleState.getLastStopTime(); @@ -243,7 +242,6 @@ public final class StandardProcessScheduler implements ProcessScheduler { taskNode.setScheduledState(ScheduledState.STOPPED); final Runnable unscheduleReportingTaskRunnable = new Runnable() { - @SuppressWarnings("deprecation") @Override public void run() { final ConfigurationContext configurationContext = taskNode.getConfigurationContext(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java index 22ee5cfd13..2c8d258eec 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java @@ -30,6 +30,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.annotation.lifecycle.OnAdded; @@ -56,7 +57,6 @@ import org.apache.nifi.processor.SimpleProcessLogger; import org.apache.nifi.processor.StandardValidationContextFactory; import org.apache.nifi.reporting.BulletinRepository; import org.apache.nifi.reporting.Severity; -import org.apache.nifi.util.ObjectHolder; import org.apache.nifi.util.ReflectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -144,7 +144,7 @@ public class StandardControllerServiceProvider implements ControllerServiceProvi final Class controllerServiceClass = rawClass.asSubclass(ControllerService.class); final ControllerService originalService = controllerServiceClass.newInstance(); - final ObjectHolder serviceNodeHolder = new ObjectHolder<>(null); + final AtomicReference serviceNodeHolder = new AtomicReference<>(null); final InvocationHandler invocationHandler = new InvocationHandler() { @Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunConnectableTask.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunConnectableTask.java index 8bc7d994a3..8f1623ed31 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunConnectableTask.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunConnectableTask.java @@ -54,7 +54,6 @@ public class ContinuallyRunConnectableTask implements Callable { } @Override - @SuppressWarnings("deprecation") public Boolean call() { if (!scheduleState.isScheduled()) { return false; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ReportingTaskWrapper.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ReportingTaskWrapper.java index 1dc08c2b2f..eb087a4331 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ReportingTaskWrapper.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ReportingTaskWrapper.java @@ -34,7 +34,6 @@ public class ReportingTaskWrapper implements Runnable { this.scheduleState = scheduleState; } - @SuppressWarnings("deprecation") @Override public synchronized void run() { scheduleState.incrementActiveThreadCount(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java index c8d9d25234..8017abdff8 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java @@ -333,7 +333,6 @@ public final class StandardProcessGroup implements ProcessGroup { return flowController.getStateManagerProvider().getStateManager(componentId); } - @SuppressWarnings("deprecation") private void shutdown(final ProcessGroup procGroup) { for (final ProcessorNode node : procGroup.getProcessors()) { try (final NarCloseable x = NarCloseable.withNarLoader()) { @@ -688,7 +687,6 @@ public final class StandardProcessGroup implements ProcessGroup { } @Override - @SuppressWarnings("deprecation") public void removeProcessor(final ProcessorNode processor) { final String id = requireNonNull(processor).getIdentifier(); writeLock.lock(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFileSystemSwapManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFileSystemSwapManager.java index 50bc874797..4a590f210b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFileSystemSwapManager.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFileSystemSwapManager.java @@ -69,7 +69,6 @@ public class TestFileSystemSwapManager { } @Test - @SuppressWarnings("deprecation") public void testRoundTripSerializeDeserialize() throws IOException { final List toSwap = new ArrayList<>(10000); final Map attrs = new HashMap<>(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java index 6e368de16b..32c1dc6dbf 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java @@ -564,7 +564,6 @@ public class TestStandardFlowFileQueue { } @Override - @SuppressWarnings("deprecation") public SwapSummary getSwapSummary(String swapLocation) throws IOException { final List flowFiles = swappedOut.get(swapLocation); if (flowFiles == null) { @@ -668,7 +667,6 @@ public class TestStandardFlowFileQueue { } @Override - @SuppressWarnings("deprecation") public int compareTo(final FlowFile o) { return Long.compare(id, o.getId()); } 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 4094ca4b2d..55b7426016 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 @@ -157,7 +157,6 @@ public class TestWriteAheadFlowFileRepository { } @Test - @SuppressWarnings("deprecation") public void testRestartWithOneRecord() throws IOException { final Path path = Paths.get("target/test-repo"); if (Files.exists(path)) { @@ -305,7 +304,6 @@ public class TestWriteAheadFlowFileRepository { } @Override - @SuppressWarnings("deprecation") public SwapSummary getSwapSummary(String swapLocation) throws IOException { List records = null; for (final Map> swapMap : swappedRecords.values()) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/util/FileUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/util/FileUtils.java index c02b83f044..a9943b8d3d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/util/FileUtils.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/util/FileUtils.java @@ -95,77 +95,6 @@ public class FileUtils { return isGone; } - /** - * Deletes all files (not directories..) in the given directory (non - * recursive) that match the given filename filter. If any file cannot be - * deleted then this is printed at warn to the given logger. - * - * @param directory to delete contents of - * @param filter if null then no filter is used - * @param logger to notify - * @deprecated As of release 0.6.0, replaced by - * {@link #deleteFilesInDirectory(File, FilenameFilter, Logger)} - */ - @Deprecated - public static void deleteFilesInDir(final File directory, final FilenameFilter filter, final Logger logger) { - FileUtils.deleteFilesInDir(directory, filter, logger, false); - } - - /** - * Deletes all files (not directories) in the given directory (recursive) - * that match the given filename filter. If any file cannot be deleted then - * this is printed at warn to the given logger. - * - * @param directory to delete contents of - * @param filter if null then no filter is used - * @param logger to notify - * @param recurse true if should recurse - * @deprecated As of release 0.6.0, replaced by - * {@link #deleteFilesInDirectory(File, FilenameFilter, Logger, boolean)} - */ - @Deprecated - public static void deleteFilesInDir(final File directory, final FilenameFilter filter, final Logger logger, final boolean recurse) { - FileUtils.deleteFilesInDir(directory, filter, logger, recurse, false); - } - - /** - * Deletes all files (not directories) in the given directory (recursive) - * that match the given filename filter. If any file cannot be deleted then - * this is printed at warn to the given logger. - * - * @param directory to delete contents of - * @param filter if null then no filter is used - * @param logger to notify - * @param recurse will look for contents of sub directories. - * @param deleteEmptyDirectories default is false; if true will delete - * directories found that are empty - * @deprecated As of release 0.6.0, replaced by - * {@link #deleteFilesInDirectory(File, FilenameFilter, Logger, boolean, boolean)} - */ - @Deprecated - public static void deleteFilesInDir(final File directory, final FilenameFilter filter, final Logger logger, final boolean recurse, final boolean deleteEmptyDirectories) { - // ensure the specified directory is actually a directory and that it exists - if (null != directory && directory.isDirectory()) { - final File ingestFiles[] = directory.listFiles(); - if (ingestFiles == null) { - // null if abstract pathname does not denote a directory, or if an I/O error occurs - logger.error("Unable to list directory content in: " + directory.getAbsolutePath()); - } - for (File ingestFile : ingestFiles) { - boolean process = (filter == null) ? true : filter.accept(directory, ingestFile.getName()); - if (ingestFile.isFile() && process) { - FileUtils.deleteFile(ingestFile, logger, 3); - } - if (ingestFile.isDirectory() && recurse) { - FileUtils.deleteFilesInDir(ingestFile, filter, logger, recurse, deleteEmptyDirectories); - if (deleteEmptyDirectories && ingestFile.list().length == 0) { - FileUtils.deleteFile(ingestFile, logger, 3); - } - } - } - } - } - /** * Deletes all files (not directories..) in the given directory (non * recursive) that match the given filename filter. If any file cannot be diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java index 7396a34214..e22ba4bd0b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java @@ -1927,23 +1927,14 @@ public final class DtoFactory { /** * Gets the capability description from the specified class. */ - @SuppressWarnings("deprecation") private String getCapabilityDescription(final Class cls) { final CapabilityDescription capabilityDesc = cls.getAnnotation(CapabilityDescription.class); - if (capabilityDesc != null) { - return capabilityDesc.value(); - } - - final org.apache.nifi.processor.annotation.CapabilityDescription deprecatedCapabilityDesc - = cls.getAnnotation(org.apache.nifi.processor.annotation.CapabilityDescription.class); - - return (deprecatedCapabilityDesc == null) ? null : deprecatedCapabilityDesc.value(); + return capabilityDesc == null ? null : capabilityDesc.value(); } /** * Gets the tags from the specified class. */ - @SuppressWarnings("deprecation") private Set getTags(final Class cls) { final Set tags = new HashSet<>(); final Tags tagsAnnotation = cls.getAnnotation(Tags.class); @@ -1951,13 +1942,6 @@ public final class DtoFactory { for (final String tag : tagsAnnotation.value()) { tags.add(tag); } - } else { - final org.apache.nifi.processor.annotation.Tags deprecatedTagsAnnotation = cls.getAnnotation(org.apache.nifi.processor.annotation.Tags.class); - if (deprecatedTagsAnnotation != null) { - for (final String tag : deprecatedTagsAnnotation.value()) { - tags.add(tag); - } - } } return tags; @@ -2129,7 +2113,6 @@ public final class DtoFactory { * @param node node * @return dto */ - @SuppressWarnings("deprecation") public ProvenanceNodeDTO createProvenanceEventNodeDTO(final ProvenanceEventLineageNode node) { final ProvenanceNodeDTO dto = new ProvenanceNodeDTO(); dto.setId(node.getIdentifier()); @@ -2140,7 +2123,6 @@ public final class DtoFactory { dto.setFlowFileUuid(node.getFlowFileUuid()); dto.setParentUuids(node.getParentUuids()); dto.setChildUuids(node.getChildUuids()); - dto.setClusterNodeIdentifier(node.getClusterNodeIdentifier()); return dto; } @@ -2150,7 +2132,6 @@ public final class DtoFactory { * @param node node * @return dto */ - @SuppressWarnings("deprecation") public ProvenanceNodeDTO createFlowFileNodeDTO(final LineageNode node) { final ProvenanceNodeDTO dto = new ProvenanceNodeDTO(); dto.setId(node.getIdentifier()); @@ -2158,7 +2139,6 @@ public final class DtoFactory { dto.setTimestamp(new Date(node.getTimestamp())); dto.setMillis(node.getTimestamp()); dto.setFlowFileUuid(node.getFlowFileUuid()); - dto.setClusterNodeIdentifier(node.getClusterNodeIdentifier()); return dto; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/src/main/java/org/apache/nifi/web/OptimisticLockingManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/src/main/java/org/apache/nifi/web/OptimisticLockingManager.java deleted file mode 100644 index b205590497..0000000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/src/main/java/org/apache/nifi/web/OptimisticLockingManager.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.web; - -import org.apache.nifi.web.revision.RevisionManager; - -/** - * A manager for optimistic locking based on revisions. A revision is composed - * of a client ID and a version number. Two revisions are considered equal if - * either their version numbers match or their client IDs match. - * - * @deprecated This class has been deprecated in favor of {@link RevisionManager} - */ -@Deprecated -public interface OptimisticLockingManager { - - /** - * Attempts to execute the specified configuration request using the - * specified revision within a lock. - * - * @param type of snapshot - * @param revision revision - * @param configurationRequest request - * @return snapshot - */ - ConfigurationSnapshot configureFlow(Revision revision, ConfigurationRequest configurationRequest); - - /** - * Updates the revision using the specified revision within a lock. - * - * @param updateRevision new revision - */ - void setRevision(UpdateRevision updateRevision); - - /** - * Returns the last flow modification. This is a combination of the revision - * and the user who performed the modification. - * - * @return the last modification - */ - FlowModification getLastModification(); - -} diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/ListHDFS.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/ListHDFS.java index f5daef2772..4cb8d25ef1 100644 --- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/ListHDFS.java +++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/ListHDFS.java @@ -31,10 +31,8 @@ import org.apache.nifi.annotation.behavior.WritesAttributes; import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.SeeAlso; import org.apache.nifi.annotation.documentation.Tags; -import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.components.PropertyDescriptor; 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.distributed.cache.client.DistributedMapCacheClient; import org.apache.nifi.flowfile.FlowFile; @@ -46,8 +44,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.util.StandardValidators; import org.apache.nifi.processors.hadoop.util.HDFSListing; -import org.apache.nifi.processors.hadoop.util.HDFSListing.StateKeys; -import org.apache.nifi.processors.hadoop.util.StringSerDe; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; @@ -124,7 +120,6 @@ public class ListHDFS extends AbstractHadoopProcessor { private volatile long latestTimestampListed = -1L; private volatile long latestTimestampEmitted = -1L; - private volatile boolean electedPrimaryNodeSinceLastIteration = false; private volatile long lastRunTimestamp = -1L; static final String LISTING_TIMESTAMP_KEY = "listing.timestamp"; @@ -175,80 +170,6 @@ public class ListHDFS extends AbstractHadoopProcessor { return mapper.readValue(jsonNode, HDFSListing.class); } - /** - * Transitions state from the Distributed cache service to the state manager. This will be - * removed in NiFi 1.x - * - * @param context the ProcessContext - * @throws IOException if unable to communicate with state manager or controller service - */ - @Deprecated - @OnScheduled - public void moveStateToStateManager(final ProcessContext context) throws IOException { - final StateManager stateManager = context.getStateManager(); - final StateMap stateMap = stateManager.getState(Scope.CLUSTER); - - // Check if we have already stored state in the cluster state manager. - if (stateMap.getVersion() == -1L) { - final HDFSListing serviceListing = getListingFromService(context); - if (serviceListing != null) { - context.getStateManager().setState(serviceListing.toMap(), Scope.CLUSTER); - } - } - } - - @Deprecated - private HDFSListing getListingFromService(final ProcessContext context) throws IOException { - final DistributedMapCacheClient client = context.getProperty(DISTRIBUTED_CACHE_SERVICE).asControllerService(DistributedMapCacheClient.class); - if (client == null) { - return null; - } - - final String directory = context.getProperty(DIRECTORY).getValue(); - final String remoteValue = client.get(getKey(directory), new StringSerDe(), new StringSerDe()); - if (remoteValue == null) { - return null; - } - - try { - return deserialize(remoteValue); - } catch (final Exception e) { - getLogger().error("Failed to retrieve state from Distributed Map Cache because the content that was retrieved could not be understood", e); - return null; - } - } - - /** - * Restores state information from the 'old' style of storing state. This is deprecated and will no longer be supported - * in the 1.x NiFi baseline - * - * @param directory the directory that the listing was performed against - * @param remoteListing the remote listing - * @return the minimum timestamp that should be used for new entries - */ - @Deprecated - private Long restoreTimestampFromOldStateFormat(final String directory, final HDFSListing remoteListing) { - // No cluster-wide state has been recovered. Just use whatever values we already have. - if (remoteListing == null) { - return latestTimestampListed; - } - - // If our local timestamp is already later than the remote listing's timestamp, use our local info. - Long minTimestamp = latestTimestampListed; - if (minTimestamp != null && minTimestamp > remoteListing.getLatestTimestamp().getTime()) { - return minTimestamp; - } - - // Use the remote listing's information. - if (minTimestamp == null || electedPrimaryNodeSinceLastIteration) { - this.latestTimestampListed = remoteListing.getLatestTimestamp().getTime(); - this.latestTimestampEmitted = this.latestTimestampListed; - } - - return minTimestamp; - } - - /** * Determines which of the given FileStatus's describes a File that should be listed. * @@ -339,13 +260,7 @@ public class ListHDFS extends AbstractHadoopProcessor { } else { // Determine if state is stored in the 'new' format or the 'old' format final String emittedString = stateMap.get(EMITTED_TIMESTAMP_KEY); - if (emittedString == null && stateMap.get(StateKeys.TIMESTAMP) != null) { - // state is stored in the old format with XML - final Map stateValues = stateMap.toMap(); - final HDFSListing stateListing = HDFSListing.fromMap(stateValues); - getLogger().debug("Found old-style state stored"); - restoreTimestampFromOldStateFormat(directory, stateListing); - } else if (emittedString == null) { + if (emittedString == null) { latestTimestampEmitted = -1L; latestTimestampListed = -1L; getLogger().debug("Found no recognized state keys; assuming no relevant state and resetting listing/emitted time to -1"); diff --git a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/GetHBase.java b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/GetHBase.java index 3cd81a3f5b..6002c3cc39 100644 --- a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/GetHBase.java +++ b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/GetHBase.java @@ -34,6 +34,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -73,7 +74,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.OutputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.ObjectHolder; @TriggerWhenEmpty @TriggerSerially @@ -274,8 +274,8 @@ public class GetHBase extends AbstractProcessor { final Map> cellsMatchingTimestamp = new HashMap<>(); - final ObjectHolder rowsPulledHolder = new ObjectHolder<>(0L); - final ObjectHolder latestTimestampHolder = new ObjectHolder<>(minTime); + final AtomicReference rowsPulledHolder = new AtomicReference<>(0L); + final AtomicReference latestTimestampHolder = new AtomicReference<>(minTime); hBaseClientService.scan(tableName, columns, filterExpression, minTime, new ResultHandler() { diff --git a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/PutHBaseJSON.java b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/PutHBaseJSON.java index 9a57d6e446..4c4c2073c5 100644 --- a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/PutHBaseJSON.java +++ b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/PutHBaseJSON.java @@ -26,6 +26,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.annotation.behavior.EventDriven; @@ -46,7 +47,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.InputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.ObjectHolder; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.map.ObjectMapper; @@ -166,7 +166,7 @@ public class PutHBaseJSON extends AbstractPutHBase { // Parse the JSON document final ObjectMapper mapper = new ObjectMapper(); - final ObjectHolder rootNodeRef = new ObjectHolder<>(null); + final AtomicReference rootNodeRef = new AtomicReference<>(null); try { session.read(flowFile, new InputStreamCallback() { @Override @@ -189,13 +189,13 @@ public class PutHBaseJSON extends AbstractPutHBase { } final Collection columns = new ArrayList<>(); - final ObjectHolder rowIdHolder = new ObjectHolder<>(null); + final AtomicReference rowIdHolder = new AtomicReference<>(null); // convert each field/value to a column for the put, skip over nulls and arrays final Iterator fieldNames = rootNode.getFieldNames(); while (fieldNames.hasNext()) { final String fieldName = fieldNames.next(); - final ObjectHolder fieldValueHolder = new ObjectHolder<>(null); + final AtomicReference fieldValueHolder = new AtomicReference<>(null); final JsonNode fieldNode = rootNode.get(fieldName); if (fieldNode.isNull()) { diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java index 77ded36da4..9c0ebef394 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java @@ -28,6 +28,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; import org.apache.nifi.annotation.behavior.EventDriven; import org.apache.nifi.annotation.behavior.InputRequirement; @@ -47,7 +48,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.OutputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.LongHolder; import org.apache.nifi.util.StopWatch; import org.apache.nifi.util.hive.HiveJdbcCommon; @@ -157,7 +157,7 @@ public class SelectHiveQL extends AbstractHiveQLProcessor { try (final Connection con = dbcpService.getConnection(); final Statement st = con.createStatement()) { - final LongHolder nrOfRows = new LongHolder(0L); + final AtomicLong nrOfRows = new AtomicLong(0L); if (fileToProcess == null) { fileToProcess = session.create(); } @@ -182,7 +182,7 @@ public class SelectHiveQL extends AbstractHiveQLProcessor { }); // set attribute how many rows were selected - fileToProcess = session.putAttribute(fileToProcess, RESULT_ROW_COUNT, nrOfRows.get().toString()); + fileToProcess = session.putAttribute(fileToProcess, RESULT_ROW_COUNT, String.valueOf(nrOfRows.get())); // Set MIME type on output document and add extension if (AVRO.equals(outputFormat)) { diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertAvroSchema.java b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertAvroSchema.java index ffcd653539..a8244d2129 100644 --- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertAvroSchema.java +++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertAvroSchema.java @@ -53,7 +53,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.StreamCallback; import org.apache.nifi.processors.kite.AvroRecordConverter.AvroConversionException; -import org.apache.nifi.util.LongHolder; import org.kitesdk.data.DatasetException; import org.kitesdk.data.DatasetIOException; import org.kitesdk.data.SchemaNotFoundException; @@ -63,6 +62,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import java.util.concurrent.atomic.AtomicLong; @Tags({ "avro", "convert", "kite" }) @CapabilityDescription("Convert records from one Avro schema to another, including support for flattening and simple type conversions") @@ -291,7 +291,7 @@ public class ConvertAvroSchema extends AbstractKiteProcessor { failureWriter.setCodec(CodecFactory.snappyCodec()); try { - final LongHolder written = new LongHolder(0L); + final AtomicLong written = new AtomicLong(0L); final FailureTracker failures = new FailureTracker(); final List badRecords = Lists.newLinkedList(); diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertCSVToAvro.java b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertCSVToAvro.java index 43b33ff453..de4130ff67 100644 --- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertCSVToAvro.java +++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertCSVToAvro.java @@ -47,7 +47,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.StreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.LongHolder; import org.kitesdk.data.DatasetException; import org.kitesdk.data.DatasetIOException; import org.kitesdk.data.DatasetRecordException; @@ -59,6 +58,7 @@ import org.kitesdk.data.spi.filesystem.CSVProperties; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import java.util.concurrent.atomic.AtomicLong; @Tags({"kite", "csv", "avro"}) @InputRequirement(Requirement.INPUT_REQUIRED) @@ -224,7 +224,7 @@ public class ConvertCSVToAvro extends AbstractKiteProcessor { writer.setCodec(CodecFactory.snappyCodec()); try { - final LongHolder written = new LongHolder(0L); + final AtomicLong written = new AtomicLong(0L); final FailureTracker failures = new FailureTracker(); FlowFile badRecords = session.clone(incomingCSV); diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertJSONToAvro.java b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertJSONToAvro.java index af120bfa53..6245362d06 100644 --- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertJSONToAvro.java +++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/ConvertJSONToAvro.java @@ -39,7 +39,6 @@ import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.StreamCallback; -import org.apache.nifi.util.LongHolder; import org.kitesdk.data.DatasetException; import org.kitesdk.data.DatasetIOException; import org.kitesdk.data.DatasetRecordException; @@ -50,6 +49,7 @@ import org.kitesdk.data.spi.filesystem.JSONFileReader; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import java.util.concurrent.atomic.AtomicLong; @Tags({"kite", "json", "avro"}) @InputRequirement(Requirement.INPUT_REQUIRED) @@ -132,7 +132,7 @@ public class ConvertJSONToAvro extends AbstractKiteProcessor { writer.setCodec(CodecFactory.snappyCodec()); try { - final LongHolder written = new LongHolder(0L); + final AtomicLong written = new AtomicLong(0L); final FailureTracker failures = new FailureTracker(); FlowFile badRecords = session.clone(incomingJSON); diff --git a/nifi-nar-bundles/nifi-media-bundle/nifi-media-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java b/nifi-nar-bundles/nifi-media-bundle/nifi-media-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java index 1dd9241185..06dd52b735 100644 --- a/nifi-nar-bundles/nifi-media-bundle/nifi-media-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java +++ b/nifi-nar-bundles/nifi-media-bundle/nifi-media-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java @@ -44,13 +44,13 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.InputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.ObjectHolder; import com.drew.imaging.ImageMetadataReader; import com.drew.imaging.ImageProcessingException; import com.drew.metadata.Directory; import com.drew.metadata.Metadata; import com.drew.metadata.Tag; +import java.util.concurrent.atomic.AtomicReference; @InputRequirement(Requirement.INPUT_REQUIRED) @Tags({"Exif", "Exchangeable", "image", "file", "format", "JPG", "GIF", "PNG", "BMP", "metadata","IPTC", "XMP"}) @@ -116,7 +116,7 @@ public class ExtractImageMetadata extends AbstractProcessor { } final ComponentLog logger = this.getLogger(); - final ObjectHolder value = new ObjectHolder<>(null); + final AtomicReference value = new AtomicReference<>(null); final Integer max = context.getProperty(MAX_NUMBER_OF_ATTRIBUTES).asInteger(); try { diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java index c6c4b159bf..0d7886db26 100644 --- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java +++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java @@ -113,7 +113,6 @@ import java.util.stream.Collectors; public class PersistentProvenanceRepository implements ProvenanceEventRepository { - public static final String DEPRECATED_CLASS_NAME = "nifi.controller.repository.provenance.PersistentProvenanceRepository"; public static final String EVENT_CATEGORY = "Provenance Repository"; private static final String FILE_EXTENSION = ".prov"; private static final String TEMP_FILE_SUFFIX = ".prov.part"; diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/src/main/java/org/apache/nifi/provenance/VolatileProvenanceRepository.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/src/main/java/org/apache/nifi/provenance/VolatileProvenanceRepository.java index 6e7c2f22a7..7445c5d801 100644 --- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/src/main/java/org/apache/nifi/provenance/VolatileProvenanceRepository.java +++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/src/main/java/org/apache/nifi/provenance/VolatileProvenanceRepository.java @@ -35,7 +35,6 @@ import org.apache.nifi.provenance.search.QueryResult; import org.apache.nifi.provenance.search.QuerySubmission; import org.apache.nifi.provenance.search.SearchTerm; import org.apache.nifi.provenance.search.SearchableField; -import org.apache.nifi.util.IntegerHolder; import org.apache.nifi.util.NiFiProperties; import org.apache.nifi.util.RingBuffer; import org.apache.nifi.util.RingBuffer.Filter; @@ -611,7 +610,7 @@ public class VolatileProvenanceRepository implements ProvenanceEventRepository { @Override public void run() { // Retrieve the most recent results and count the total number of matches - final IntegerHolder matchingCount = new IntegerHolder(0); + final AtomicInteger matchingCount = new AtomicInteger(0); final List matchingRecords = new ArrayList<>(maxRecords); ringBuffer.forEach(new ForEachEvaluator() { @Override diff --git a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java index 268b734957..a6eb66295b 100644 --- a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java +++ b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java @@ -49,10 +49,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.TimeZone; import java.util.UUID; import java.util.concurrent.TimeUnit; diff --git a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/PutSolrContentStream.java b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/PutSolrContentStream.java index ca1628647f..76a70d4a0f 100644 --- a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/PutSolrContentStream.java +++ b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/PutSolrContentStream.java @@ -32,6 +32,7 @@ import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import org.apache.nifi.annotation.behavior.DynamicProperty; import org.apache.nifi.annotation.behavior.InputRequirement; @@ -47,7 +48,6 @@ import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.io.InputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.util.ObjectHolder; import org.apache.nifi.util.StopWatch; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest; @@ -166,8 +166,8 @@ public class PutSolrContentStream extends SolrProcessor { return; } - final ObjectHolder error = new ObjectHolder<>(null); - final ObjectHolder connectionError = new ObjectHolder<>(null); + final AtomicReference error = new AtomicReference<>(null); + final AtomicReference connectionError = new AtomicReference<>(null); final boolean isSolrCloud = SOLR_TYPE_CLOUD.equals(context.getProperty(SOLR_TYPE).getValue()); final String collection = context.getProperty(COLLECTION).evaluateAttributeExpressions(flowFile).getValue(); diff --git a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/PutSplunk.java b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/PutSplunk.java index c461b0feb8..9e4aa125b4 100644 --- a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/PutSplunk.java +++ b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/PutSplunk.java @@ -39,7 +39,6 @@ import org.apache.nifi.stream.io.ByteArrayOutputStream; import org.apache.nifi.stream.io.ByteCountingInputStream; import org.apache.nifi.stream.io.StreamUtils; import org.apache.nifi.stream.io.util.NonThreadSafeCircularBuffer; -import org.apache.nifi.util.LongHolder; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -50,6 +49,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; @InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED) @Tags({"splunk", "logs", "tcp", "udp"}) @@ -219,7 +219,7 @@ public class PutSplunk extends AbstractPutEventProcessor { // some pattern. We can use this to search for the delimiter as we read through the stream of bytes in the FlowFile final NonThreadSafeCircularBuffer buffer = new NonThreadSafeCircularBuffer(delimiterBytes); - final LongHolder messagesSent = new LongHolder(0L); + final AtomicLong messagesSent = new AtomicLong(0L); final FlowFileMessageBatch messageBatch = new FlowFileMessageBatch(session, flowFile); activeBatches.add(messageBatch); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractJsonPathProcessor.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractJsonPathProcessor.java index 2f1ff43a4f..21172e9a53 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractJsonPathProcessor.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractJsonPathProcessor.java @@ -31,7 +31,6 @@ import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.io.InputStreamCallback; import org.apache.nifi.processors.standard.util.JsonPathExpressionValidator; import org.apache.nifi.stream.io.BufferedInputStream; -import org.apache.nifi.util.ObjectHolder; import java.io.IOException; import java.io.InputStream; @@ -39,6 +38,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; /** * Provides common functionality used for processors interacting and manipulating JSON data via JsonPath. @@ -73,7 +73,7 @@ public abstract class AbstractJsonPathProcessor extends AbstractProcessor { static DocumentContext validateAndEstablishJsonContext(ProcessSession processSession, FlowFile flowFile) { // Parse the document once into an associated context to support multiple path evaluations if specified - final ObjectHolder contextHolder = new ObjectHolder<>(null); + final AtomicReference contextHolder = new AtomicReference<>(null); processSession.read(flowFile, new InputStreamCallback() { @Override public void process(InputStream in) throws IOException { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java deleted file mode 100644 index 3df4317c33..0000000000 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.processors.standard; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Queue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import org.apache.nifi.annotation.lifecycle.OnScheduled; -import org.apache.nifi.annotation.lifecycle.OnStopped; -import org.apache.nifi.components.PropertyDescriptor; -import org.apache.nifi.components.ValidationContext; -import org.apache.nifi.components.ValidationResult; -import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ComponentLog; -import org.apache.nifi.processor.AbstractSessionFactoryProcessor; -import org.apache.nifi.processor.DataUnit; -import org.apache.nifi.processor.ProcessContext; -import org.apache.nifi.processor.ProcessSession; -import org.apache.nifi.processor.ProcessSessionFactory; -import org.apache.nifi.processor.Relationship; -import org.apache.nifi.processor.exception.ProcessException; -import org.apache.nifi.processor.util.StandardValidators; -import org.apache.nifi.processors.standard.util.Bin; -import org.apache.nifi.processors.standard.util.BinManager; -import org.apache.nifi.processors.standard.util.FlowFileSessionWrapper; - -/** - * Base class for file-binning processors, including MergeContent. - * - * @deprecated As of release 0.5.0, replaced by - * {@link org.apache.nifi.processor.util.bin.BinFiles} - */ -@Deprecated -public abstract class BinFiles extends AbstractSessionFactoryProcessor { - - public static final PropertyDescriptor MIN_SIZE = new PropertyDescriptor.Builder() - .name("Minimum Group Size") - .description("The minimum size of for the bundle") - .required(true) - .defaultValue("0 B") - .addValidator(StandardValidators.DATA_SIZE_VALIDATOR) - .build(); - public static final PropertyDescriptor MAX_SIZE = new PropertyDescriptor.Builder() - .name("Maximum Group Size") - .description("The maximum size for the bundle. If not specified, there is no maximum.") - .required(false) - .addValidator(StandardValidators.DATA_SIZE_VALIDATOR) - .build(); - - public static final PropertyDescriptor MIN_ENTRIES = new PropertyDescriptor.Builder() - .name("Minimum Number of Entries") - .description("The minimum number of files to include in a bundle") - .required(true) - .defaultValue("1") - .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) - .build(); - public static final PropertyDescriptor MAX_ENTRIES = new PropertyDescriptor.Builder() - .name("Maximum Number of Entries") - .description("The maximum number of files to include in a bundle. If not specified, there is no maximum.") - .required(false) - .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) - .build(); - - public static final PropertyDescriptor MAX_BIN_COUNT = new PropertyDescriptor.Builder() - .name("Maximum number of Bins") - .description("Specifies the maximum number of bins that can be held in memory at any one time") - .defaultValue("100") - .required(true) - .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) - .build(); - - public static final PropertyDescriptor MAX_BIN_AGE = new PropertyDescriptor.Builder() - .name("Max Bin Age") - .description("The maximum age of a Bin that will trigger a Bin to be complete. Expected format is