Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.nio.charset.StandardCharsets;
import java.util.Map;

@Deprecated(since = "2.12.0", forRemoval = true)
public class FlowFilePackagerV1 implements FlowFilePackager {

public static final String FILENAME_ATTRIBUTES = "flowfile.attributes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
* 64 21
* </pre>
*/
@Deprecated(since = "2.12.0", forRemoval = true)
public class FlowFilePackagerV2 implements FlowFilePackager {

private static final int MAX_VALUE_2_BYTES = 65535;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Properties;
import java.util.stream.Collectors;

@Deprecated(since = "2.12.0", forRemoval = true)
public class FlowFileUnpackagerV1 implements FlowFileUnpackager {

private int flowFilesRead = 0;
Expand All @@ -40,17 +41,17 @@
}

final Map<String, String> attributes;
if (attribEntry.getName().equals(FlowFilePackagerV1.FILENAME_ATTRIBUTES)) {

Check warning on line 44 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / MacOS Zulu JDK 21 JP

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 44 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 25 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 44 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 21 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 44 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Scan

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 44 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Windows Zulu JDK 21 FR

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal
attributes = getAttributes(tarIn);
} else {
throw new IOException("Expected two tar entries: "
+ FlowFilePackagerV1.FILENAME_CONTENT + " and "

Check warning on line 48 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / MacOS Zulu JDK 21 JP

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 48 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 25 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 48 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 21 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 48 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Scan

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 48 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Windows Zulu JDK 21 FR

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal
+ FlowFilePackagerV1.FILENAME_ATTRIBUTES);

Check warning on line 49 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / MacOS Zulu JDK 21 JP

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 49 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 25 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 49 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 21 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 49 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Scan

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 49 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Windows Zulu JDK 21 FR

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal
}

final TarArchiveEntry contentEntry = tarIn.getNextEntry();

if (contentEntry != null && contentEntry.getName().equals(FlowFilePackagerV1.FILENAME_CONTENT)) {

Check warning on line 54 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / MacOS Zulu JDK 21 JP

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 54 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 25 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 54 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 21 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 54 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Scan

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 54 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Windows Zulu JDK 21 FR

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal
final byte[] buffer = new byte[512 << 10]; //512KB
int bytesRead = 0;
while ((bytesRead = tarIn.read(buffer)) != -1) { //still more data to read
Expand All @@ -61,8 +62,8 @@
out.flush();
} else {
throw new IOException("Expected two tar entries: "
+ FlowFilePackagerV1.FILENAME_CONTENT + " and "

Check warning on line 65 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / MacOS Zulu JDK 21 JP

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 65 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 25 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 65 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 21 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 65 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Scan

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 65 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Windows Zulu JDK 21 FR

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal
+ FlowFilePackagerV1.FILENAME_ATTRIBUTES);

Check warning on line 66 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / MacOS Zulu JDK 21 JP

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 66 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 25 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 66 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Ubuntu Corretto JDK 21 EN

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 66 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Scan

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal

Check warning on line 66 in nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java

View workflow job for this annotation

GitHub Actions / Windows Zulu JDK 21 FR

[removal] FlowFilePackagerV1 in org.apache.nifi.util has been deprecated and marked for removal
}

return attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.Map;

@Deprecated(since = "2.12.0", forRemoval = true)
public class FlowFileUnpackagerV2 implements FlowFileUnpackager {

private final byte[] readBuffer = new byte[8192];
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,12 @@
<version>42.7.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-deprecation-log</artifactId>
<version>2.12.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ protected void setUpBinManager(final BinManager binManager, final ProcessContext
protected BinProcessingResult processBin(final Bin bin, final ProcessContext context) throws ProcessException {
final BinProcessingResult binProcessingResult = new BinProcessingResult(true);

@SuppressWarnings("removal")
MergeBin merger = switch (context.getProperty(MERGE_FORMAT).asAllowableValue(MergeFormat.class)) {
case TAR -> new TarMerge();
case ZIP -> new ZipMerge(context.getProperty(COMPRESSION_LEVEL).asInteger());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import org.apache.nifi.annotation.lifecycle.OnStopped;
import org.apache.nifi.components.DescribedValue;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.deprecation.log.DeprecationLogger;
import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.flowfile.attributes.CoreAttributes;
import org.apache.nifi.flowfile.attributes.FragmentAttributes;
Expand Down Expand Up @@ -227,6 +229,8 @@ public class UnpackContent extends AbstractProcessor {
REL_ORIGINAL
);

private static final DeprecationLogger deprecationLogger = DeprecationLoggerFactory.getLogger(UnpackContent.class);

private Pattern fileFilter;

private Unpacker tarUnpacker;
Expand All @@ -249,9 +253,14 @@ public void onStopped() {

@OnScheduled
public void onScheduled(ProcessContext context) throws ProcessException {
if (fileFilter == null) {
final PackageFormat packageFormat = context.getProperty(PACKAGING_FORMAT).asAllowableValue(PackageFormat.class);
final PackageFormat packageFormat = context.getProperty(PACKAGING_FORMAT).asAllowableValue(PackageFormat.class);
if (PackageFormat.FLOWFILE_STREAM_FORMAT_V2 == packageFormat) {
deprecationLogger.warn("FlowFile Stream V2 is deprecated for removal");
} else if (PackageFormat.FLOWFILE_TAR_FORMAT == packageFormat) {
deprecationLogger.warn("FlowFile TAR V1 is deprecated for removal");
}

if (fileFilter == null) {
fileFilter = Pattern.compile(context.getProperty(FILE_FILTER).getValue());

tarUnpacker = switch (packageFormat) {
Expand Down Expand Up @@ -311,6 +320,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
}
}

@SuppressWarnings("removal")
final Unpacker unpacker = switch (packagingFormat) {
case TAR_FORMAT -> tarUnpacker;
case ZIP_FORMAT -> zipUnpacker;
Expand Down Expand Up @@ -743,8 +753,8 @@ protected enum PackageFormat implements DescribedValue {
TAR_FORMAT(TAR_FORMAT_NAME, null, "application/x-tar"),
ZIP_FORMAT(ZIP_FORMAT_NAME, null, "application/zip"),
FLOWFILE_STREAM_FORMAT_V3(FLOWFILE_STREAM_FORMAT_V3_NAME, null, StandardFlowFileMediaType.VERSION_3.getMediaType()),
FLOWFILE_STREAM_FORMAT_V2(FLOWFILE_STREAM_FORMAT_V2_NAME, null, StandardFlowFileMediaType.VERSION_2.getMediaType()),
FLOWFILE_TAR_FORMAT(FLOWFILE_TAR_FORMAT_NAME, null, StandardFlowFileMediaType.VERSION_1.getMediaType());
FLOWFILE_STREAM_FORMAT_V2(FLOWFILE_STREAM_FORMAT_V2_NAME, "FlowFile Stream V2 is deprecated", StandardFlowFileMediaType.VERSION_2.getMediaType()),
FLOWFILE_TAR_FORMAT(FLOWFILE_TAR_FORMAT_NAME, "FlowFile TAR V1 is deprecated", StandardFlowFileMediaType.VERSION_1.getMediaType());

private final String value;
private final String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ private void processRecord(InputStream in, FlowFile flowFile, OutputStream out)
}
}

@SuppressWarnings("removal")
private FlowFileUnpackager getFlowFileUnpackager(String contentType) {
final FlowFileUnpackager unpackager;
if (StandardFlowFileMediaType.VERSION_3.getMediaType().equals(contentType)) {
Expand Down
Loading