You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by tk...@apache.org on 2015/11/09 05:26:35 UTC
[01/50] [abbrv] nifi git commit: NIFI-1051 Allowed
FileSystemRepository to skip un-readable entries. The exception was caused
due to basic file permissions. This fix overrides 'visitFileFailed' method of
SimpleFileVisitor to log WARN message and allow Fi
Repository: nifi
Updated Branches:
refs/heads/NIFI-1073 2fa02f31c -> 313fc2ec7
NIFI-1051 Allowed FileSystemRepository to skip un-readable entries.
The exception was caused due to basic file permissions. This fix overrides
'visitFileFailed' method of SimpleFileVisitor to log WARN message and allow
FileSystemRepository to continue.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/5c4042bd
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/5c4042bd
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/5c4042bd
Branch: refs/heads/NIFI-1073
Commit: 5c4042bd7c39dd92b1fba665c7b03c670346be8f
Parents: c4f0cb1
Author: Oleg Zhurakousky <ol...@suitcase.io>
Authored: Thu Oct 29 16:31:17 2015 -0400
Committer: Oleg Zhurakousky <ol...@suitcase.io>
Committed: Thu Oct 29 16:31:17 2015 -0400
----------------------------------------------------------------------
.../repository/FileSystemRepository.java | 6 ++++++
.../repository/TestFileSystemRepository.java | 18 ++++++++++++++++++
2 files changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/5c4042bd/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
----------------------------------------------------------------------
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 72a50ec..2ce0947 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
@@ -309,6 +309,12 @@ public class FileSystemRepository implements ContentRepository {
// the path already exists, so scan the path to find any files and update maxIndex to the max of
// all filenames seen.
Files.walkFileTree(realPath, new SimpleFileVisitor<Path>() {
+
+ public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
+ LOG.warn("Content repository contains un-readable file or directory '" + file.getFileName() + "'. Skipping. ", exc);
+ return FileVisitResult.SKIP_SUBTREE;
+ }
+
@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
if (attrs.isDirectory()) {
http://git-wip-us.apache.org/repos/asf/nifi/blob/5c4042bd/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
index 88f572b..95e1f40 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
@@ -71,6 +71,24 @@ public class TestFileSystemRepository {
public void shutdown() throws IOException {
repository.shutdown();
}
+
+ @Test
+ public void testBogusFile() throws IOException {
+ repository.shutdown();
+ System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
+
+ File bogus = new File(rootFile, "bogus");
+ try {
+ bogus.mkdir();
+ bogus.setReadable(false);
+
+ repository = new FileSystemRepository();
+ repository.initialize(new StandardResourceClaimManager());
+ } finally {
+ bogus.setReadable(true);
+ assertTrue(bogus.delete());
+ }
+ }
@Test
public void testCreateContentClaim() throws IOException {
[35/50] [abbrv] nifi git commit: NIFI-1110: Fixed bug that caused
queue size to become negative when FlowFiles are expired
Posted by tk...@apache.org.
NIFI-1110: Fixed bug that caused queue size to become negative when FlowFiles are expired
Signed-off-by: Mark Payne <ma...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/98f5a1ab
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/98f5a1ab
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/98f5a1ab
Branch: refs/heads/NIFI-1073
Commit: 98f5a1ab779eb3d49f95eda36844d1398af1a1f6
Parents: 4ac52bf
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Nov 4 14:24:08 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Thu Nov 5 12:12:02 2015 -0500
----------------------------------------------------------------------
.../nifi/controller/StandardFlowFileQueue.java | 41 ++++++++++++++++----
.../controller/TestStandardFlowFileQueue.java | 29 ++++++++++++++
2 files changed, 63 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/98f5a1ab/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
----------------------------------------------------------------------
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 3986ca8..0b3c661 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
@@ -395,7 +395,6 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
migrateSwapToActive();
final boolean queueFullAtStart = queueFullRef.get();
- int expiredRecordCount = 0;
long expiredBytes = 0L;
do {
@@ -404,8 +403,8 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
isExpired = isLaterThan(getExpirationDate(flowFile, expirationMillis));
if (isExpired) {
expiredRecords.add(flowFile);
- expiredRecordCount++;
expiredBytes += flowFile.getSize();
+ flowFile = null;
if (expiredRecords.size() >= MAX_EXPIRED_RECORDS_PER_ITERATION) {
break;
@@ -419,12 +418,12 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
if (flowFile != null) {
incrementActiveQueueSize(-1, -flowFile.getSize());
}
-
- if (expiredRecordCount > 0) {
- incrementActiveQueueSize(-expiredRecordCount, -expiredBytes);
- }
} while (isExpired);
+ if (!expiredRecords.isEmpty()) {
+ incrementActiveQueueSize(-expiredRecords.size(), -expiredBytes);
+ }
+
// if at least 1 FlowFile was expired & the queue was full before we started, then
// we need to determine whether or not the queue is full again. If no FlowFile was expired,
// then the queue will still be full until the appropriate #acknowledge method is called.
@@ -432,7 +431,7 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
queueFullRef.set(determineIfFull());
}
- return isExpired ? null : flowFile;
+ return flowFile;
}
@Override
@@ -1198,6 +1197,10 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
final FlowFileQueueSize newSize = new FlowFileQueueSize(original.activeQueueCount + count, original.activeQueueBytes + bytes,
original.swappedCount, original.swappedBytes, original.unacknowledgedCount, original.unacknowledgedBytes);
updated = size.compareAndSet(original, newSize);
+
+ if (updated) {
+ logIfNegative(original, newSize, "active");
+ }
}
}
@@ -1208,6 +1211,10 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
final FlowFileQueueSize newSize = new FlowFileQueueSize(original.activeQueueCount, original.activeQueueBytes,
original.swappedCount + count, original.swappedBytes + bytes, original.unacknowledgedCount, original.unacknowledgedBytes);
updated = size.compareAndSet(original, newSize);
+
+ if (updated) {
+ logIfNegative(original, newSize, "swap");
+ }
}
}
@@ -1218,6 +1225,19 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
final FlowFileQueueSize newSize = new FlowFileQueueSize(original.activeQueueCount, original.activeQueueBytes,
original.swappedCount, original.swappedBytes, original.unacknowledgedCount + count, original.unacknowledgedBytes + bytes);
updated = size.compareAndSet(original, newSize);
+
+ if (updated) {
+ logIfNegative(original, newSize, "Unacknowledged");
+ }
+ }
+ }
+
+ private void logIfNegative(final FlowFileQueueSize original, final FlowFileQueueSize newSize, final String counterName) {
+ if (newSize.activeQueueBytes < 0 || newSize.activeQueueCount < 0 || newSize.swappedBytes < 0 || newSize.swappedCount < 0 ||
+ newSize.unacknowledgedBytes < 0 || newSize.unacknowledgedCount < 0) {
+
+ logger.error("Updated Size of Queue " + counterName + " from " + original + " to " + newSize, new RuntimeException("Cannot create negative queue size"));
+
}
}
@@ -1259,5 +1279,12 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
public QueueSize swapQueueSize() {
return new QueueSize(swappedCount, swappedBytes);
}
+
+ @Override
+ public String toString() {
+ return "FlowFile Queue Size[ ActiveQueue=[" + activeQueueCount + ", " + activeQueueBytes +
+ " Bytes], Swap Queue=[" + swappedCount + ", " + swappedBytes +
+ " Bytes], Unacknowledged=[" + unacknowledgedCount + ", " + unacknowledgedBytes + " Bytes] ]";
+ }
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/98f5a1ab/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java
----------------------------------------------------------------------
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 7ef5fc8..8b8c678 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
@@ -19,6 +19,7 @@ package org.apache.nifi.controller;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
@@ -76,6 +77,34 @@ public class TestStandardFlowFileQueue {
TestFlowFile.idGenerator.set(0L);
}
+ @Test
+ public void testExpire() {
+ queue.setFlowFileExpiration("1 ms");
+
+ for (int i = 0; i < 100; i++) {
+ queue.put(new TestFlowFile());
+ }
+
+ // just make sure that the flowfiles have time to expire.
+ try {
+ Thread.sleep(100L);
+ } catch (final InterruptedException ie) {
+ }
+
+ final Set<FlowFileRecord> expiredRecords = new HashSet<>(100);
+ final FlowFileRecord pulled = queue.poll(expiredRecords);
+
+ assertNull(pulled);
+ assertEquals(100, expiredRecords.size());
+
+ final QueueSize activeSize = queue.getActiveQueueSize();
+ assertEquals(0, activeSize.getObjectCount());
+ assertEquals(0L, activeSize.getByteCount());
+
+ final QueueSize unackSize = queue.getUnacknowledgedQueueSize();
+ assertEquals(0, unackSize.getObjectCount());
+ assertEquals(0L, unackSize.getByteCount());
+ }
@Test
public void testSwapOutOccurs() {
[50/50] [abbrv] nifi git commit: NIFI-1073 fixed unused import
Posted by tk...@apache.org.
NIFI-1073 fixed unused import
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/313fc2ec
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/313fc2ec
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/313fc2ec
Branch: refs/heads/NIFI-1073
Commit: 313fc2ec77ebc2760772b7830e3a1b212e53d99e
Parents: 598e32f 2fa02f3
Author: Tony Kurc <tr...@gmail.com>
Authored: Sun Nov 8 23:04:48 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 23:04:48 2015 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/nifi/web/server/JettyServer.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/313fc2ec/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
----------------------------------------------------------------------
diff --cc nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
index 983ffd4,73cf7c5..393a4fe
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
@@@ -51,7 -51,7 +51,6 @@@ import org.apache.nifi.nar.ExtensionMap
import org.apache.nifi.nar.NarClassLoaders;
import org.apache.nifi.services.FlowService;
import org.apache.nifi.util.NiFiProperties;
--import org.apache.nifi.util.file.FileUtils;
import org.apache.nifi.web.NiFiWebContext;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
[30/50] [abbrv] nifi git commit: NIFI-274 Adding ListenSyslog and
PutSyslog to standard processors. - Refactoring connection handling on put
side,
removing number of buffers from properties and basing it off concurrent tasks
for the processor. - Refactor
Posted by tk...@apache.org.
NIFI-274 Adding ListenSyslog and PutSyslog to standard processors.
- Refactoring connection handling on put side, removing number of buffers from properties and basing it off concurrent tasks for the processor.
- Refactoring some of the TCP handling so it keeps reading from a connection until the client closes it
- Adding an error queue
- Adding a sender field on the syslog event to record the system that sent the message
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/9c542432
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/9c542432
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/9c542432
Branch: refs/heads/NIFI-1073
Commit: 9c542432da7c9df6087a180cd939820dcce7008d
Parents: 201eac0
Author: Bryan Bende <bb...@apache.org>
Authored: Tue Oct 13 09:48:19 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Wed Nov 4 17:56:13 2015 -0500
----------------------------------------------------------------------
.../standard/AbstractSyslogProcessor.java | 81 +++
.../nifi/processors/standard/ListenSyslog.java | 527 +++++++++++++++++++
.../nifi/processors/standard/PutSyslog.java | 460 ++++++++++++++++
.../processors/standard/util/SyslogEvent.java | 180 +++++++
.../processors/standard/util/SyslogParser.java | 165 ++++++
.../org.apache.nifi.processor.Processor | 2 +
.../processors/standard/TestListenSyslog.java | 426 +++++++++++++++
.../nifi/processors/standard/TestPutSyslog.java | 398 ++++++++++++++
.../standard/util/TestSyslogParser.java | 253 +++++++++
nifi-nar-bundles/pom.xml | 4 +-
10 files changed, 2494 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
new file mode 100644
index 0000000..f7d5eeb
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
@@ -0,0 +1,81 @@
+/*
+ * 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 org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.attributes.FlowFileAttributeKey;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.util.StandardValidators;
+
+/**
+ * Base class for Syslog processors.
+ */
+public abstract class AbstractSyslogProcessor extends AbstractProcessor {
+
+ public static final AllowableValue TCP_VALUE = new AllowableValue("TCP", "TCP");
+ public static final AllowableValue UDP_VALUE = new AllowableValue("UDP", "UDP");
+
+ public static final PropertyDescriptor PROTOCOL = new PropertyDescriptor
+ .Builder().name("Protocol")
+ .description("The protocol for Syslog communication, either TCP or UDP.")
+ .required(true)
+ .allowableValues(TCP_VALUE, UDP_VALUE)
+ .defaultValue(UDP_VALUE.getValue())
+ .build();
+ public static final PropertyDescriptor PORT = new PropertyDescriptor
+ .Builder().name("Port")
+ .description("The port for Syslog communication.")
+ .required(true)
+ .addValidator(StandardValidators.PORT_VALIDATOR)
+ .build();
+ public static final PropertyDescriptor CHARSET = new PropertyDescriptor.Builder()
+ .name("Character Set")
+ .description("Specifies which character set of the Syslog messages")
+ .required(true)
+ .defaultValue("UTF-8")
+ .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
+ .build();
+
+
+ /**
+ * FlowFile Attributes for each Syslog message.
+ */
+ public enum SyslogAttributes implements FlowFileAttributeKey {
+ PRIORITY("syslog.priority"),
+ SEVERITY("syslog.severity"),
+ FACILITY("syslog.facility"),
+ VERSION("syslog.version"),
+ TIMESTAMP("syslog.timestamp"),
+ HOSTNAME("syslog.hostname"),
+ SENDER("syslog.sender"),
+ BODY("syslog.body"),
+ VALID("syslog.valid");
+
+ private String key;
+
+ SyslogAttributes(String key) {
+ this.key = key;
+ }
+
+ @Override
+ public String key() {
+ return key;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
new file mode 100644
index 0000000..9f57c9f
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
@@ -0,0 +1,527 @@
+/*
+ * 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 org.apache.commons.io.IOUtils;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnUnscheduled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.io.nio.BufferPool;
+import org.apache.nifi.logging.ProcessorLog;
+import org.apache.nifi.processor.DataUnit;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+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.processors.standard.util.SyslogEvent;
+import org.apache.nifi.processors.standard.util.SyslogParser;
+import org.apache.nifi.stream.io.ByteArrayOutputStream;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.StandardSocketOptions;
+import java.nio.ByteBuffer;
+import java.nio.channels.ClosedByInterruptException;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+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.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+@Tags({"syslog", "listen", "udp", "tcp", "logs"})
+@CapabilityDescription("Listens for Syslog messages being sent to a given port over TCP or UDP. Incoming messages are checked against regular " +
+ "expressions for RFC5424 and RFC3164 formatted messages. The format of each message is: (<PRIORITY>)(VERSION )(TIMESTAMP) (HOSTNAME) (BODY) " +
+ "where version is optional. The timestamp can be an RFC5424 timestamp with a format of \"yyyy-MM-dd'T'HH:mm:ss.SZ\" or \"yyyy-MM-dd'T'HH:mm:ss.S+hh:mm\", " +
+ "or it can be an RFC3164 timestamp with a format of \"MMM d HH:mm:ss\". If an incoming messages matches one of these patterns, the message will be " +
+ "parsed and the individual pieces will be placed in FlowFile attributes, with the original message in the content of the FlowFile. If an incoming " +
+ "message does not match one of these patterns it will not be parsed and the syslog.valid attribute will be set to false with the original message " +
+ "in the content of the FlowFile. Valid messages will be transferred on the success relationship, and invalid messages will be transferred on the " +
+ "invalid relationship.")
+@WritesAttributes({ @WritesAttribute(attribute="syslog.priority", description="The priority of the Syslog message."),
+ @WritesAttribute(attribute="syslog.severity", description="The severity of the Syslog message derived from the priority."),
+ @WritesAttribute(attribute="syslog.facility", description="The facility of the Syslog message derived from the priority."),
+ @WritesAttribute(attribute="syslog.version", description="The optional version from the Syslog message."),
+ @WritesAttribute(attribute="syslog.timestamp", description="The timestamp of the Syslog message."),
+ @WritesAttribute(attribute="syslog.hostname", description="The hostname of the Syslog message."),
+ @WritesAttribute(attribute="syslog.sender", description="The hostname of the Syslog server that sent the message."),
+ @WritesAttribute(attribute="syslog.body", description="The body of the Syslog message, everything after the hostname."),
+ @WritesAttribute(attribute="syslog.valid", description="An indicator of whether this message matched the expected formats. " +
+ "If this value is false, the other attributes will be empty and only the original message will be available in the content."),
+ @WritesAttribute(attribute="mime.type", description="The mime.type of the FlowFile which will be text/plain for Syslog messages.")})
+public class ListenSyslog extends AbstractSyslogProcessor {
+
+ public static final PropertyDescriptor RECV_BUFFER_SIZE = new PropertyDescriptor.Builder()
+ .name("Receive Buffer Size")
+ .description("The size of each buffer used to receive Syslog messages. Adjust this value appropriately based on the expected size of the " +
+ "incoming Syslog messages. When UDP is selected each buffer will hold one Syslog message. When TCP is selected messages are read " +
+ "from an incoming connection until the buffer is full, or the connection is closed. ")
+ .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
+ .defaultValue("65507 KB")
+ .required(true)
+ .build();
+ public static final PropertyDescriptor MAX_SOCKET_BUFFER_SIZE = new PropertyDescriptor.Builder()
+ .name("Max Size of Socket Buffer")
+ .description("The maximum size of the socket buffer that should be used. This is a suggestion to the Operating System " +
+ "to indicate how big the socket buffer should be. If this value is set too low, the buffer may fill up before " +
+ "the data can be read, and incoming data will be dropped.")
+ .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
+ .defaultValue("1 MB")
+ .required(true)
+ .build();
+
+
+ public static final Relationship REL_SUCCESS = new Relationship.Builder()
+ .name("success")
+ .description("Syslog messages that match one of the expected formats will be sent out this relationship as a FlowFile per message.")
+ .build();
+ public static final Relationship REL_INVALID = new Relationship.Builder()
+ .name("invalid")
+ .description("Syslog messages that do not match one of the expected formats will be sent out this relationship as a FlowFile per message.")
+ .build();
+
+ private Set<Relationship> relationships;
+ private List<PropertyDescriptor> descriptors;
+
+ private volatile BufferPool bufferPool;
+ private volatile ChannelReader channelReader;
+ private volatile SyslogParser parser;
+ private volatile BlockingQueue<SyslogEvent> syslogEvents;
+ private volatile BlockingQueue<SyslogEvent> errorEvents;
+
+ @Override
+ protected void init(final ProcessorInitializationContext context) {
+ final List<PropertyDescriptor> descriptors = new ArrayList<>();
+ descriptors.add(PROTOCOL);
+ descriptors.add(PORT);
+ descriptors.add(RECV_BUFFER_SIZE);
+ descriptors.add(MAX_SOCKET_BUFFER_SIZE);
+ descriptors.add(CHARSET);
+ this.descriptors = Collections.unmodifiableList(descriptors);
+
+ final Set<Relationship> relationships = new HashSet<>();
+ relationships.add(REL_SUCCESS);
+ relationships.add(REL_INVALID);
+ this.relationships = Collections.unmodifiableSet(relationships);
+ }
+
+ @Override
+ public Set<Relationship> getRelationships() {
+ return this.relationships;
+ }
+
+ @Override
+ public final List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+ return descriptors;
+ }
+
+ @Override
+ public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) {
+ // since properties were changed, clear any events that were queued
+ if (syslogEvents != null) {
+ syslogEvents.clear();
+ }
+ if (errorEvents != null) {
+ errorEvents.clear();
+ }
+ }
+
+ @OnScheduled
+ public void onScheduled(final ProcessContext context) throws IOException {
+ final int port = context.getProperty(PORT).asInteger();
+ final int bufferSize = context.getProperty(RECV_BUFFER_SIZE).asDataSize(DataUnit.B).intValue();
+ final int maxChannelBufferSize = context.getProperty(MAX_SOCKET_BUFFER_SIZE).asDataSize(DataUnit.B).intValue();
+ final String protocol = context.getProperty(PROTOCOL).getValue();
+ final String charSet = context.getProperty(CHARSET).getValue();
+
+ parser = new SyslogParser(Charset.forName(charSet));
+ bufferPool = new BufferPool(context.getMaxConcurrentTasks(), bufferSize, false, Integer.MAX_VALUE);
+ syslogEvents = new LinkedBlockingQueue<>(10);
+ errorEvents = new LinkedBlockingQueue<>(context.getMaxConcurrentTasks());
+
+ // create either a UDP or TCP reader and call open() to bind to the given port
+ channelReader = createChannelReader(protocol, bufferPool, parser, syslogEvents);
+ channelReader.open(port, maxChannelBufferSize);
+
+ final Thread readerThread = new Thread(channelReader);
+ readerThread.setName("ListenSyslog [" + getIdentifier() + "]");
+ readerThread.setDaemon(true);
+ readerThread.start();
+ }
+
+ // visible for testing to be overridden and provide a mock ChannelReader if desired
+ protected ChannelReader createChannelReader(final String protocol, final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents)
+ throws IOException {
+ if (protocol.equals(UDP_VALUE.getValue())) {
+ return new DatagramChannelReader(bufferPool, syslogParser, syslogEvents, getLogger());
+ } else {
+ return new SocketChannelReader(bufferPool, syslogParser, syslogEvents, getLogger());
+ }
+ }
+
+ // used for testing to access the random port that was selected
+ protected int getPort() {
+ return channelReader == null ? 0 : channelReader.getPort();
+ }
+
+ @OnUnscheduled
+ public void onUnscheduled() {
+ if (channelReader != null) {
+ channelReader.stop();
+ channelReader.close();
+ }
+ }
+
+ @Override
+ public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
+ // try to pull from the error queue first, if empty then pull from main queue
+ SyslogEvent initialEvent = errorEvents.poll();
+ if (initialEvent == null) {
+ initialEvent = syslogEvents.poll();
+ }
+
+ // if nothing in either queue then just return
+ if (initialEvent == null) {
+ return;
+ }
+
+ final SyslogEvent event = initialEvent;
+
+ final Map<String,String> attributes = new HashMap<>();
+ attributes.put(SyslogAttributes.PRIORITY.key(), event.getPriority());
+ attributes.put(SyslogAttributes.SEVERITY.key(), event.getSeverity());
+ attributes.put(SyslogAttributes.FACILITY.key(), event.getFacility());
+ attributes.put(SyslogAttributes.VERSION.key(), event.getVersion());
+ attributes.put(SyslogAttributes.TIMESTAMP.key(), event.getTimeStamp());
+ attributes.put(SyslogAttributes.HOSTNAME.key(), event.getHostName());
+ attributes.put(SyslogAttributes.SENDER.key(), event.getSender());
+ attributes.put(SyslogAttributes.BODY.key(), event.getMsgBody());
+ attributes.put(SyslogAttributes.VALID.key(), String.valueOf(event.isValid()));
+ attributes.put(CoreAttributes.MIME_TYPE.key(), "text/plain");
+
+ FlowFile flowFile = session.create();
+ flowFile = session.putAllAttributes(flowFile, attributes);
+
+ try {
+ // write the raw bytes of the message as the FlowFile content
+ flowFile = session.write(flowFile, new OutputStreamCallback() {
+ @Override
+ public void process(OutputStream out) throws IOException {
+ out.write(event.getRawMessage());
+ }
+ });
+
+ if (event.isValid()) {
+ getLogger().info("Transferring {} to success", new Object[]{flowFile});
+ session.transfer(flowFile, REL_SUCCESS);
+ } else {
+ getLogger().info("Transferring {} to invalid", new Object[]{flowFile});
+ session.transfer(flowFile, REL_INVALID);
+ }
+
+ } catch (ProcessException e) {
+ getLogger().error("Error processing Syslog message", e);
+ errorEvents.offer(event);
+ session.remove(flowFile);
+ }
+ }
+
+ /**
+ * Reads messages from a channel until told to stop.
+ */
+ public interface ChannelReader extends Runnable {
+
+ void open(int port, int maxBufferSize) throws IOException;
+
+ int getPort();
+
+ void stop();
+
+ void close();
+ }
+
+ /**
+ * Reads from the Datagram channel into an available buffer. If data is read then the buffer is queued for
+ * processing, otherwise the buffer is returned to the buffer pool.
+ */
+ public static class DatagramChannelReader implements ChannelReader {
+
+ private final BufferPool bufferPool;
+ private final SyslogParser syslogParser;
+ private final BlockingQueue<SyslogEvent> syslogEvents;
+ private final ProcessorLog logger;
+ private DatagramChannel datagramChannel;
+ private volatile boolean stopped = false;
+
+ public DatagramChannelReader(final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents,
+ final ProcessorLog logger) {
+ this.bufferPool = bufferPool;
+ this.syslogParser = syslogParser;
+ this.syslogEvents = syslogEvents;
+ this.logger = logger;
+ }
+
+ @Override
+ public void open(final int port, int maxBufferSize) throws IOException {
+ datagramChannel = DatagramChannel.open();
+ datagramChannel.configureBlocking(false);
+ if (maxBufferSize > 0) {
+ datagramChannel.setOption(StandardSocketOptions.SO_RCVBUF, maxBufferSize);
+ final int actualReceiveBufSize = datagramChannel.getOption(StandardSocketOptions.SO_RCVBUF);
+ if (actualReceiveBufSize < maxBufferSize) {
+ logMaxBufferWarning(logger, maxBufferSize, actualReceiveBufSize);
+ }
+ }
+ datagramChannel.socket().bind(new InetSocketAddress(port));
+ }
+
+ @Override
+ public void run() {
+ while (!stopped) {
+ final ByteBuffer buffer = bufferPool.poll();
+ try {
+ if (buffer == null) {
+ Thread.sleep(10L);
+ logger.debug("no available buffers, continuing...");
+ continue;
+ }
+
+ final SocketAddress sender = datagramChannel.receive(buffer);
+ if (sender == null) {
+ Thread.sleep(1000L); // nothing to do so wait...
+ } else {
+ final SyslogEvent event = syslogParser.parseEvent(buffer); // TODO parse with sender?
+ logger.trace(event.getFullMessage());
+ syslogEvents.put(event); // block until space is available
+ }
+ } catch (InterruptedException e) {
+ stop();
+ } catch (IOException e) {
+ logger.error("Error reading from DatagramChannel", e);
+ } finally {
+ if (buffer != null) {
+ bufferPool.returnBuffer(buffer, 0);
+ }
+ }
+ }
+ }
+
+ @Override
+ public int getPort() {
+ return datagramChannel == null ? 0 : datagramChannel.socket().getLocalPort();
+ }
+
+ @Override
+ public void stop() {
+ stopped = true;
+ }
+
+ @Override
+ public void close() {
+ IOUtils.closeQuietly(datagramChannel);
+ }
+ }
+
+ /**
+ * Accepts Socket connections on the given port and creates a handler for each connection to
+ * be executed by a thread pool.
+ */
+ public static class SocketChannelReader implements ChannelReader {
+
+ private final BufferPool bufferPool;
+ private final SyslogParser syslogParser;
+ private final BlockingQueue<SyslogEvent> syslogEvents;
+ private final ProcessorLog logger;
+ private ServerSocketChannel serverSocketChannel;
+ private ExecutorService executor = Executors.newFixedThreadPool(2);
+ private volatile boolean stopped = false;
+
+ public SocketChannelReader(final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents,
+ final ProcessorLog logger) {
+ this.bufferPool = bufferPool;
+ this.syslogParser = syslogParser;
+ this.syslogEvents = syslogEvents;
+ this.logger = logger;
+ }
+
+ @Override
+ public void open(final int port, int maxBufferSize) throws IOException {
+ serverSocketChannel = ServerSocketChannel.open();
+ serverSocketChannel.configureBlocking(false);
+ if (maxBufferSize > 0) {
+ serverSocketChannel.setOption(StandardSocketOptions.SO_RCVBUF, maxBufferSize);
+ final int actualReceiveBufSize = serverSocketChannel.getOption(StandardSocketOptions.SO_RCVBUF);
+ if (actualReceiveBufSize < maxBufferSize) {
+ logMaxBufferWarning(logger, maxBufferSize, actualReceiveBufSize);
+ }
+ }
+ serverSocketChannel.socket().bind(new InetSocketAddress(port));
+ }
+
+ @Override
+ public void run() {
+ while (!stopped) {
+ try {
+ final SocketChannel socketChannel = serverSocketChannel.accept();
+ if (socketChannel == null) {
+ Thread.sleep(1000L); // wait for an incoming connection...
+ } else {
+ final SocketChannelHandler handler = new SocketChannelHandler(
+ bufferPool, socketChannel, syslogParser, syslogEvents, logger);
+ logger.debug("Accepted incoming connection");
+ executor.submit(handler);
+ }
+ } catch (IOException e) {
+ logger.error("Error accepting connection from SocketChannel", e);
+ } catch (InterruptedException e) {
+ stop();
+ }
+ }
+ }
+
+ @Override
+ public int getPort() {
+ return serverSocketChannel == null ? 0 : serverSocketChannel.socket().getLocalPort();
+ }
+
+ @Override
+ public void stop() {
+ stopped = true;
+ }
+
+ @Override
+ public void close() {
+ IOUtils.closeQuietly(serverSocketChannel);
+ executor.shutdown();
+ try {
+ // Wait a while for existing tasks to terminate
+ if (!executor.awaitTermination(1000L, TimeUnit.MILLISECONDS)) {
+ executor.shutdownNow();
+ }
+ } catch (InterruptedException ie) {
+ // (Re-)Cancel if current thread also interrupted
+ executor.shutdownNow();
+ // Preserve interrupt status
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ }
+
+ /**
+ * Reads from the given SocketChannel into the provided buffer. If data is read then the buffer is queued for
+ * processing, otherwise the buffer is returned to the buffer pool.
+ */
+ public static class SocketChannelHandler implements Runnable {
+
+ private final BufferPool bufferPool;
+ private final SocketChannel socketChannel;
+ private final SyslogParser syslogParser;
+ private final BlockingQueue<SyslogEvent> syslogEvents;
+ private final ProcessorLog logger;
+ private final ByteArrayOutputStream currBytes = new ByteArrayOutputStream(4096);
+
+ public SocketChannelHandler(final BufferPool bufferPool, final SocketChannel socketChannel, final SyslogParser syslogParser,
+ final BlockingQueue<SyslogEvent> syslogEvents, final ProcessorLog logger) {
+ this.bufferPool = bufferPool;
+ this.socketChannel = socketChannel;
+ this.syslogParser = syslogParser;
+ this.syslogEvents = syslogEvents;
+ this.logger = logger;
+ }
+
+ @Override
+ public void run() {
+ try {
+ int bytesRead = 0;
+ while (bytesRead >= 0 && !Thread.interrupted()) {
+
+ final ByteBuffer buffer = bufferPool.poll();
+ if (buffer == null) {
+ Thread.sleep(10L);
+ logger.debug("no available buffers, continuing...");
+ continue;
+ }
+
+ try {
+ // read until the buffer is full
+ bytesRead = socketChannel.read(buffer);
+ while (bytesRead > 0) {
+ bytesRead = socketChannel.read(buffer);
+ }
+ buffer.flip();
+
+ // go through the buffer looking for the end of each message
+ int bufferLength = buffer.limit();
+ for (int i = 0; i < bufferLength; i++) {
+ byte currByte = buffer.get(i);
+ currBytes.write(currByte);
+
+ // at the end of a message so parse an event, reset the buffer, and break out of the loop
+ if (currByte == '\n') {
+ final SyslogEvent event = syslogParser.parseEvent(currBytes.toByteArray(),
+ socketChannel.socket().getInetAddress().toString());
+ logger.trace(event.getFullMessage());
+ syslogEvents.put(event); // block until space is available
+ currBytes.reset();
+ }
+ }
+ } finally {
+ bufferPool.returnBuffer(buffer, 0);
+ }
+ }
+
+ logger.debug("done handling SocketChannel");
+ } catch (ClosedByInterruptException | InterruptedException e) {
+ // nothing to do here
+ } catch (IOException e) {
+ logger.error("Error reading from channel", e);
+ } finally {
+ IOUtils.closeQuietly(socketChannel);
+ }
+ }
+
+ }
+
+ static void logMaxBufferWarning(final ProcessorLog logger, int maxBufferSize, int actualReceiveBufSize) {
+ logger.warn("Attempted to set Socket Buffer Size to " + maxBufferSize + " bytes but could only set to "
+ + actualReceiveBufSize + "bytes. You may want to consider changing the Operating System's "
+ + "maximum receive buffer");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
new file mode 100644
index 0000000..502b26f
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
@@ -0,0 +1,460 @@
+/*
+ * 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 org.apache.commons.io.IOUtils;
+import org.apache.nifi.annotation.behavior.TriggerWhenEmpty;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.DataUnit;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+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.SyslogParser;
+import org.apache.nifi.util.ObjectHolder;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@TriggerWhenEmpty
+@Tags({"syslog", "put", "udp", "tcp", "logs"})
+@CapabilityDescription("Sends Syslog messages to a given host and port over TCP or UDP. Messages are constructed from the \"Message ___\" properties of the processor " +
+ "which can use expression language to generate messages from incoming FlowFiles. The properties are used to construct messages of the form: " +
+ "(<PRIORITY>)(VERSION )(TIMESTAMP) (HOSTNAME) (BODY) where version is optional. The constructed messages are checked against regular expressions for " +
+ "RFC5424 and RFC3164 formatted messages. The timestamp can be an RFC5424 timestamp with a format of \"yyyy-MM-dd'T'HH:mm:ss.SZ\" or \"yyyy-MM-dd'T'HH:mm:ss.S+hh:mm\", " +
+ "or it can be an RFC3164 timestamp with a format of \"MMM d HH:mm:ss\". If a message is constructed that does not form a valid Syslog message according to the " +
+ "above description, then it is routed to the invalid relationship. Valid messages are pushed to Syslog with successes routed to the success relationship, and " +
+ "failures routed to the failure relationship.")
+public class PutSyslog extends AbstractSyslogProcessor {
+
+ public static final PropertyDescriptor HOSTNAME = new PropertyDescriptor.Builder()
+ .name("Hostname")
+ .description("The ip address or hostname of the Syslog server.")
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .defaultValue("localhost")
+ .required(true)
+ .build();
+ public static final PropertyDescriptor SEND_BUFFER_SIZE = new PropertyDescriptor.Builder()
+ .name("Send Buffer Size")
+ .description("The size of each buffer used to send a Syslog message. Adjust this value appropriately based on the expected size of the " +
+ "Syslog messages being produced. Messages larger than this buffer size will still be sent, but will not make use of the buffer pool.")
+ .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
+ .defaultValue("2048 B")
+ .required(true)
+ .build();
+ public static final PropertyDescriptor BATCH_SIZE = new PropertyDescriptor
+ .Builder().name("Batch Size")
+ .description("The number of incoming FlowFiles to process in a single execution of this processor.")
+ .required(true)
+ .defaultValue("25")
+ .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
+ .build();
+ public static final PropertyDescriptor IDLE_EXPIRATION = new PropertyDescriptor
+ .Builder().name("Idle Connection Expiration")
+ .description("The amount of time a connection should be held open without being used before closing the connection.")
+ .required(true)
+ .defaultValue("5 seconds")
+ .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
+ .build();
+ public static final PropertyDescriptor MSG_PRIORITY = new PropertyDescriptor
+ .Builder().name("Message Priority")
+ .description("The priority for the Syslog messages, excluding < >.")
+ .required(true)
+ .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
+ .expressionLanguageSupported(true)
+ .build();
+ public static final PropertyDescriptor MSG_VERSION = new PropertyDescriptor
+ .Builder().name("Message Version")
+ .description("The version for the Syslog messages.")
+ .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
+ .expressionLanguageSupported(true)
+ .build();
+ public static final PropertyDescriptor MSG_TIMESTAMP = new PropertyDescriptor
+ .Builder().name("Message Timestamp")
+ .description("The timestamp for the Syslog messages. The timestamp can be an RFC5424 timestamp with a format of " +
+ "\"yyyy-MM-dd'T'HH:mm:ss.SZ\" or \"yyyy-MM-dd'T'HH:mm:ss.S+hh:mm\", \" or it can be an RFC3164 timestamp " +
+ "with a format of \"MMM d HH:mm:ss\".")
+ .required(true)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .expressionLanguageSupported(true)
+ .build();
+ public static final PropertyDescriptor MSG_HOSTNAME = new PropertyDescriptor
+ .Builder().name("Message Hostname")
+ .description("The hostname for the Syslog messages.")
+ .required(true)
+ .defaultValue("${hostname(true)}")
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .expressionLanguageSupported(true)
+ .build();
+ public static final PropertyDescriptor MSG_BODY = new PropertyDescriptor
+ .Builder().name("Message Body")
+ .description("The body for the Syslog messages.")
+ .required(true)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .expressionLanguageSupported(true)
+ .build();
+
+ public static final Relationship REL_SUCCESS = new Relationship.Builder()
+ .name("success")
+ .description("FlowFiles that are sent successfully to Syslog are sent out this relationship.")
+ .build();
+ public static final Relationship REL_FAILURE = new Relationship.Builder()
+ .name("failure")
+ .description("FlowFiles that failed to send to Syslog are sent out this relationship.")
+ .build();
+ public static final Relationship REL_INVALID = new Relationship.Builder()
+ .name("invalid")
+ .description("FlowFiles that do not form a valid Syslog message are sent out this relationship.")
+ .build();
+
+ private Set<Relationship> relationships;
+ private List<PropertyDescriptor> descriptors;
+
+ private volatile BlockingQueue<ByteBuffer> bufferPool;
+ private volatile BlockingQueue<ChannelSender> senderPool;
+
+ @Override
+ protected void init(final ProcessorInitializationContext context) {
+ final List<PropertyDescriptor> descriptors = new ArrayList<>();
+ descriptors.add(HOSTNAME);
+ descriptors.add(PROTOCOL);
+ descriptors.add(PORT);
+ descriptors.add(IDLE_EXPIRATION);
+ descriptors.add(SEND_BUFFER_SIZE);
+ descriptors.add(BATCH_SIZE);
+ descriptors.add(CHARSET);
+ descriptors.add(MSG_PRIORITY);
+ descriptors.add(MSG_VERSION);
+ descriptors.add(MSG_TIMESTAMP);
+ descriptors.add(MSG_HOSTNAME);
+ descriptors.add(MSG_BODY);
+ this.descriptors = Collections.unmodifiableList(descriptors);
+
+ final Set<Relationship> relationships = new HashSet<>();
+ relationships.add(REL_SUCCESS);
+ relationships.add(REL_FAILURE);
+ relationships.add(REL_INVALID);
+ this.relationships = Collections.unmodifiableSet(relationships);
+ }
+
+ @Override
+ public Set<Relationship> getRelationships() {
+ return this.relationships;
+ }
+
+ @Override
+ public final List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+ return descriptors;
+ }
+
+ @OnScheduled
+ public void onScheduled(final ProcessContext context) throws IOException {
+ final int bufferSize = context.getProperty(SEND_BUFFER_SIZE).asDataSize(DataUnit.B).intValue();
+ this.bufferPool = new LinkedBlockingQueue<>(context.getMaxConcurrentTasks());
+ for (int i=0; i < context.getMaxConcurrentTasks(); i++) {
+ this.bufferPool.offer(ByteBuffer.allocate(bufferSize));
+ }
+
+ // create a pool of senders based on the number of concurrent tasks for this processor
+ this.senderPool = new LinkedBlockingQueue<>(context.getMaxConcurrentTasks());
+ for (int i=0; i < context.getMaxConcurrentTasks(); i++) {
+ senderPool.offer(createSender(context, bufferPool));
+ }
+ }
+
+ protected ChannelSender createSender(final ProcessContext context, final BlockingQueue<ByteBuffer> bufferPool) throws IOException {
+ final int port = context.getProperty(PORT).asInteger();
+ final String host = context.getProperty(HOSTNAME).getValue();
+ final String protocol = context.getProperty(PROTOCOL).getValue();
+ final String charSet = context.getProperty(CHARSET).getValue();
+ return createSender(protocol, host, port, Charset.forName(charSet), bufferPool);
+ }
+
+ // visible for testing to override and provide a mock sender if desired
+ protected ChannelSender createSender(final String protocol, final String host, final int port, final Charset charset, final BlockingQueue<ByteBuffer> bufferPool)
+ throws IOException {
+ if (protocol.equals(UDP_VALUE.getValue())) {
+ return new DatagramChannelSender(host, port, bufferPool, charset);
+ } else {
+ return new SocketChannelSender(host, port, bufferPool, charset);
+ }
+ }
+
+ @OnStopped
+ public void onStopped() {
+ ChannelSender sender = senderPool.poll();
+ while (sender != null) {
+ sender.close();
+ sender = senderPool.poll();
+ }
+ }
+
+ @Override
+ public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
+ final String protocol = context.getProperty(PROTOCOL).getValue();
+ final int batchSize = context.getProperty(BATCH_SIZE).asInteger();
+
+ final List<FlowFile> flowFiles = session.get(batchSize);
+ if (flowFiles == null || flowFiles.isEmpty()) {
+ final List<ChannelSender> putBack = new ArrayList<>();
+ final long expirationThreshold = context.getProperty(IDLE_EXPIRATION).asTimePeriod(TimeUnit.MILLISECONDS).longValue();
+
+ // if a connection hasn't been used with in the threshold then it gets closed
+ ChannelSender sender;
+ while ((sender = senderPool.poll()) != null) {
+ if (System.currentTimeMillis() > (sender.lastUsed + expirationThreshold)) {
+ getLogger().debug("Closing idle connection...");
+ sender.close();
+ } else {
+ putBack.add(sender);
+ }
+ }
+
+ // re-queue senders that weren't idle, but if the queue is full then close the sender
+ for (ChannelSender putBackSender : putBack) {
+ boolean returned = senderPool.offer(putBackSender);
+ if (!returned) {
+ putBackSender.close();
+ }
+ }
+ return;
+ }
+
+ // get a sender from the pool, or create a new one if the pool is empty
+ // if we can't create a new connection then route flow files to failure and yield
+ ChannelSender sender = senderPool.poll();
+ if (sender == null) {
+ try {
+ getLogger().debug("No available connections, creating a new one...");
+ sender = createSender(context, bufferPool);
+ } catch (IOException e) {
+ for (final FlowFile flowFile : flowFiles) {
+ getLogger().error("No available connections, and unable to create a new one, transferring {} to failure",
+ new Object[]{flowFile}, e);
+ session.transfer(flowFile, REL_FAILURE);
+ }
+ context.yield();
+ return;
+ }
+ }
+
+ final ObjectHolder<IOException> exceptionHolder = new ObjectHolder<>(null);
+ try {
+ for (FlowFile flowFile : flowFiles) {
+ final String priority = context.getProperty(MSG_PRIORITY).evaluateAttributeExpressions(flowFile).getValue();
+ final String version = context.getProperty(MSG_VERSION).evaluateAttributeExpressions(flowFile).getValue();
+ final String timestamp = context.getProperty(MSG_TIMESTAMP).evaluateAttributeExpressions(flowFile).getValue();
+ final String hostname = context.getProperty(MSG_HOSTNAME).evaluateAttributeExpressions(flowFile).getValue();
+ final String body = context.getProperty(MSG_BODY).evaluateAttributeExpressions(flowFile).getValue();
+
+ final StringBuilder messageBuilder = new StringBuilder();
+ messageBuilder.append("<").append(priority).append(">");
+ if (version != null) {
+ messageBuilder.append(version).append(" ");
+ }
+ messageBuilder.append(timestamp).append(" ").append(hostname).append(" ").append(body);
+
+ final String fullMessage = messageBuilder.toString();
+ getLogger().debug(fullMessage);
+
+ if (isValid(fullMessage)) {
+ try {
+ // now that we validated, add a new line if doing TCP
+ if (protocol.equals(TCP_VALUE.getValue())) {
+ messageBuilder.append('\n');
+ }
+
+ sender.send(messageBuilder.toString());
+ getLogger().info("Transferring {} to success", new Object[]{flowFile});
+ session.transfer(flowFile, REL_SUCCESS);
+ } catch (IOException e) {
+ getLogger().error("Transferring {} to failure", new Object[]{flowFile}, e);
+ session.transfer(flowFile, REL_FAILURE);
+ exceptionHolder.set(e);
+ }
+ } else {
+ getLogger().info("Transferring {} to invalid", new Object[]{flowFile});
+ session.transfer(flowFile, REL_INVALID);
+ }
+ }
+ } finally {
+ // if the connection is still open and no IO errors happened then try to return, if pool is full then close
+ if (sender.isConnected() && exceptionHolder.get() == null) {
+ boolean returned = senderPool.offer(sender);
+ if (!returned) {
+ sender.close();
+ }
+ } else {
+ // probably already closed here, but quietly close anyway to be safe
+ sender.close();
+ }
+
+ }
+
+ }
+
+ private boolean isValid(final String message) {
+ for (Pattern pattern : SyslogParser.MESSAGE_PATTERNS) {
+ Matcher matcher = pattern.matcher(message);
+ if (matcher.matches()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Base class for sending messages over a channel.
+ */
+ public static abstract class ChannelSender {
+
+ final int port;
+ final String host;
+ final BlockingQueue<ByteBuffer> bufferPool;
+ final Charset charset;
+ volatile long lastUsed;
+
+ ChannelSender(final String host, final int port, final BlockingQueue<ByteBuffer> bufferPool, final Charset charset) throws IOException {
+ this.port = port;
+ this.host = host;
+ this.bufferPool = bufferPool;
+ this.charset = charset;
+ }
+
+ public void send(final String message) throws IOException {
+ final byte[] bytes = message.getBytes(charset);
+
+ boolean shouldReturn = true;
+ ByteBuffer buffer = bufferPool.poll();
+ if (buffer == null) {
+ buffer = ByteBuffer.allocate(bytes.length);
+ shouldReturn = false;
+ } else if (buffer.limit() < bytes.length) {
+ // we need a large buffer so return the one we got and create a new bigger one
+ bufferPool.offer(buffer);
+ buffer = ByteBuffer.allocate(bytes.length);
+ shouldReturn = false;
+ }
+
+ try {
+ buffer.clear();
+ buffer.put(bytes);
+ buffer.flip();
+ write(buffer);
+ lastUsed = System.currentTimeMillis();
+ } finally {
+ if (shouldReturn) {
+ bufferPool.offer(buffer);
+ }
+ }
+ }
+
+ // write the given buffer to the underlying channel
+ abstract void write(ByteBuffer buffer) throws IOException;
+
+ // returns true if the underlying channel is connected
+ abstract boolean isConnected();
+
+ // close the underlying channel
+ abstract void close();
+ }
+
+ /**
+ * Sends messages over a DatagramChannel.
+ */
+ static class DatagramChannelSender extends ChannelSender {
+
+ final DatagramChannel channel;
+
+ DatagramChannelSender(final String host, final int port, final BlockingQueue<ByteBuffer> bufferPool, final Charset charset) throws IOException {
+ super(host, port, bufferPool, charset);
+ this.channel = DatagramChannel.open();
+ this.channel.connect(new InetSocketAddress(InetAddress.getByName(host), port));
+ }
+
+ @Override
+ public void write(ByteBuffer buffer) throws IOException {
+ while (buffer.hasRemaining()) {
+ channel.write(buffer);
+ }
+ }
+
+ @Override
+ boolean isConnected() {
+ return channel != null && channel.isConnected();
+ }
+
+ @Override
+ public void close() {
+ IOUtils.closeQuietly(channel);
+ }
+ }
+
+ /**
+ * Sends messages over a SocketChannel.
+ */
+ static class SocketChannelSender extends ChannelSender {
+
+ final SocketChannel channel;
+
+ SocketChannelSender(final String host, final int port, final BlockingQueue<ByteBuffer> bufferPool, final Charset charset) throws IOException {
+ super(host, port, bufferPool, charset);
+ this.channel = SocketChannel.open();
+ this.channel.connect(new InetSocketAddress(InetAddress.getByName(host), port));
+ }
+
+ @Override
+ public void write(ByteBuffer buffer) throws IOException {
+ while (buffer.hasRemaining()) {
+ channel.write(buffer);
+ }
+ }
+
+ @Override
+ boolean isConnected() {
+ return channel != null && channel.isConnected();
+ }
+
+ @Override
+ public void close() {
+ IOUtils.closeQuietly(channel);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogEvent.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogEvent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogEvent.java
new file mode 100644
index 0000000..3d06dbe
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogEvent.java
@@ -0,0 +1,180 @@
+/*
+ * 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.util;
+
+/**
+ * Encapsulates the parsed information for a single Syslog event.
+ */
+public class SyslogEvent {
+
+ private final String priority;
+ private final String severity;
+ private final String facility;
+ private final String version;
+ private final String timeStamp;
+ private final String hostName;
+ private final String sender;
+ private final String msgBody;
+ private final String fullMessage;
+ private final byte[] rawMessage;
+ private final boolean valid;
+
+ private SyslogEvent(final Builder builder) {
+ this.priority = builder.priority;
+ this.severity = builder.severity;
+ this.facility = builder.facility;
+ this.version = builder.version;
+ this.timeStamp = builder.timeStamp;
+ this.hostName = builder.hostName;
+ this.sender = builder.sender;
+ this.msgBody = builder.msgBody;
+ this.fullMessage = builder.fullMessage;
+ this.rawMessage = builder.rawMessage;
+ this.valid = builder.valid;
+ }
+
+ public String getPriority() {
+ return priority;
+ }
+
+ public String getSeverity() {
+ return severity;
+ }
+
+ public String getFacility() {
+ return facility;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getTimeStamp() {
+ return timeStamp;
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+ public String getSender() {
+ return sender;
+ }
+
+ public String getMsgBody() {
+ return msgBody;
+ }
+
+ public String getFullMessage() {
+ return fullMessage;
+ }
+
+ public byte[] getRawMessage() {
+ return rawMessage;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public static final class Builder {
+ private String priority;
+ private String severity;
+ private String facility;
+ private String version;
+ private String timeStamp;
+ private String hostName;
+ private String sender;
+ private String msgBody;
+ private String fullMessage;
+ private byte[] rawMessage;
+ private boolean valid;
+
+ public void reset() {
+ this.priority = null;
+ this.severity = null;
+ this.facility = null;
+ this.version = null;
+ this.timeStamp = null;
+ this.hostName = null;
+ this.sender = null;
+ this.msgBody = null;
+ this.fullMessage = null;
+ this.valid = false;
+ }
+
+ public Builder priority(String priority) {
+ this.priority = priority;
+ return this;
+ }
+
+ public Builder severity(String severity) {
+ this.severity = severity;
+ return this;
+ }
+
+ public Builder facility(String facility) {
+ this.facility = facility;
+ return this;
+ }
+
+ public Builder version(String version) {
+ this.version = version;
+ return this;
+ }
+
+ public Builder timestamp(String timestamp) {
+ this.timeStamp = timestamp;
+ return this;
+ }
+
+ public Builder hostname(String hostName) {
+ this.hostName = hostName;
+ return this;
+ }
+
+ public Builder sender(String sender) {
+ this.sender = sender;
+ return this;
+ }
+
+ public Builder msgBody(String msgBody) {
+ this.msgBody = msgBody;
+ return this;
+ }
+
+ public Builder fullMessage(String fullMessage) {
+ this.fullMessage = fullMessage;
+ return this;
+ }
+
+ public Builder rawMessage(byte[] rawMessage) {
+ this.rawMessage = rawMessage;
+ return this;
+ }
+
+ public Builder valid(boolean valid) {
+ this.valid = valid;
+ return this;
+ }
+
+ public SyslogEvent build() {
+ return new SyslogEvent(this);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogParser.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogParser.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogParser.java
new file mode 100644
index 0000000..fd59e5b
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SyslogParser.java
@@ -0,0 +1,165 @@
+/*
+ * 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.util;
+
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.regex.MatchResult;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Parses a Syslog message from a ByteBuffer into a SyslogEvent instance.
+ *
+ * The Syslog regular expressions below were adapted from the Apache Flume project.
+ */
+public class SyslogParser {
+
+ public static final String SYSLOG_MSG_RFC5424_0 =
+ "(?:\\<(\\d{1,3})\\>)" + // priority
+ "(?:(\\d)?\\s?)" + // version
+ /* yyyy-MM-dd'T'HH:mm:ss.SZ or yyyy-MM-dd'T'HH:mm:ss.S+hh:mm or - (null stamp) */
+ "(?:" +
+ "(\\d{4}[-]\\d{2}[-]\\d{2}[T]\\d{2}[:]\\d{2}[:]\\d{2}" +
+ "(?:\\.\\d{1,6})?(?:[+-]\\d{2}[:]\\d{2}|Z)?)|-)" + // stamp
+ "\\s" + // separator
+ "(?:([\\w][\\w\\d\\.@\\-]*)|-)" + // host name or - (null)
+ "\\s" + // separator
+ "(.*)$"; // body
+
+ public static final String SYSLOG_MSG_RFC3164_0 =
+ "(?:\\<(\\d{1,3})\\>)" +
+ "(?:(\\d)?\\s?)" + // version
+ // stamp MMM d HH:mm:ss, single digit date has two spaces
+ "([A-Z][a-z][a-z]\\s{1,2}\\d{1,2}\\s\\d{2}[:]\\d{2}[:]\\d{2})" +
+ "\\s" + // separator
+ "([\\w][\\w\\d\\.@-]*)" + // host
+ "\\s(.*)$"; // body
+
+ public static final Collection<Pattern> MESSAGE_PATTERNS;
+ static {
+ List<Pattern> patterns = new ArrayList<>();
+ patterns.add(Pattern.compile(SYSLOG_MSG_RFC5424_0));
+ patterns.add(Pattern.compile(SYSLOG_MSG_RFC3164_0));
+ MESSAGE_PATTERNS = Collections.unmodifiableList(patterns);
+ }
+
+ // capture group positions from the above message patterns
+ public static final int SYSLOG_PRIORITY_POS = 1;
+ public static final int SYSLOG_VERSION_POS = 2;
+ public static final int SYSLOG_TIMESTAMP_POS = 3;
+ public static final int SYSLOG_HOSTNAME_POS = 4;
+ public static final int SYSLOG_BODY_POS = 5;
+
+ private Charset charset;
+
+ public SyslogParser(final Charset charset) {
+ this.charset = charset;
+ }
+
+ /**
+ * Parses a SyslogEvent from a byte buffer.
+ *
+ * @param buffer a byte buffer containing a syslog message
+ * @return a SyslogEvent parsed from the byte array
+ */
+ public SyslogEvent parseEvent(final ByteBuffer buffer) {
+ return parseEvent(buffer, null);
+ }
+
+ /**
+ * Parses a SyslogEvent from a byte buffer.
+ *
+ * @param buffer a byte buffer containing a syslog message
+ * @param sender the hostname of the syslog server that sent the message
+ * @return a SyslogEvent parsed from the byte array
+ */
+ public SyslogEvent parseEvent(final ByteBuffer buffer, final String sender) {
+ if (buffer == null) {
+ return null;
+ }
+ if (buffer.position() != 0) {
+ buffer.flip();
+ }
+ byte bytes[] = new byte[buffer.limit()];
+ buffer.get(bytes, 0, buffer.limit());
+ return parseEvent(bytes, sender);
+ }
+
+ /**
+ * Parses a SyslogEvent from a byte array.
+ *
+ * @param bytes a byte array containing a syslog message
+ * @param sender the hostname of the syslog server that sent the message
+ * @return a SyslogEvent parsed from the byte array
+ */
+ public SyslogEvent parseEvent(final byte[] bytes, final String sender) {
+ if (bytes == null || bytes.length == 0) {
+ return null;
+ }
+
+ // remove trailing new line before parsing
+ int length = bytes.length;
+ if (bytes[length - 1] == '\n') {
+ length = length - 1;
+ }
+
+ final String message = new String(bytes, 0, length, charset);
+
+ final SyslogEvent.Builder builder = new SyslogEvent.Builder()
+ .valid(false).fullMessage(message).rawMessage(bytes).sender(sender);
+
+ for (Pattern pattern : MESSAGE_PATTERNS) {
+ final Matcher matcher = pattern.matcher(message);
+ if (!matcher.matches()) {
+ continue;
+ }
+
+ final MatchResult res = matcher.toMatchResult();
+ for (int grp = 1; grp <= res.groupCount(); grp++) {
+ String value = res.group(grp);
+ if (grp == SYSLOG_TIMESTAMP_POS) {
+ builder.timestamp(value);
+ } else if (grp == SYSLOG_HOSTNAME_POS) {
+ builder.hostname(value);
+ } else if (grp == SYSLOG_PRIORITY_POS) {
+ int pri = Integer.parseInt(value);
+ int sev = pri % 8;
+ int facility = pri / 8;
+ builder.priority(value);
+ builder.severity(String.valueOf(sev));
+ builder.facility(String.valueOf(facility));
+ } else if (grp == SYSLOG_VERSION_POS) {
+ builder.version(value);
+ } else if (grp == SYSLOG_BODY_POS) {
+ builder.msgBody(value);
+ }
+ }
+
+ builder.valid(true);
+ break;
+ }
+
+ // either invalid w/original msg, or fully parsed event
+ return builder.build();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
index 8507c96..60379ed 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
@@ -44,6 +44,7 @@ org.apache.nifi.processors.standard.InvokeHTTP
org.apache.nifi.processors.standard.GetJMSQueue
org.apache.nifi.processors.standard.GetJMSTopic
org.apache.nifi.processors.standard.ListenHTTP
+org.apache.nifi.processors.standard.ListenSyslog
org.apache.nifi.processors.standard.ListenUDP
org.apache.nifi.processors.standard.ListSFTP
org.apache.nifi.processors.standard.LogAttribute
@@ -58,6 +59,7 @@ org.apache.nifi.processors.standard.PutFTP
org.apache.nifi.processors.standard.PutJMS
org.apache.nifi.processors.standard.PutSFTP
org.apache.nifi.processors.standard.PutSQL
+org.apache.nifi.processors.standard.PutSyslog
org.apache.nifi.processors.standard.ReplaceText
org.apache.nifi.processors.standard.ReplaceTextWithMapping
org.apache.nifi.processors.standard.RouteOnAttribute
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
new file mode 100644
index 0000000..0e0d972
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
@@ -0,0 +1,426 @@
+/*
+ * 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 org.apache.nifi.io.nio.BufferPool;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSessionFactory;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processors.standard.util.SyslogEvent;
+import org.apache.nifi.processors.standard.util.SyslogParser;
+import org.apache.nifi.util.MockFlowFile;
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.BlockingQueue;
+
+public class TestListenSyslog {
+
+ static final Logger LOGGER = LoggerFactory.getLogger(TestListenSyslog.class);
+
+ static final String PRI = "34";
+ static final String SEV = "2";
+ static final String FAC = "4";
+ static final String TIME = "Oct 13 15:43:23";
+ static final String HOST = "localhost.home";
+ static final String BODY = "some message";
+
+ static final String VALID_MESSAGE = "<" + PRI + ">" + TIME + " " + HOST + " " + BODY + "\n";
+ static final String INVALID_MESSAGE = "this is not valid\n";
+
+ @Test
+ public void testUDP() throws IOException, InterruptedException {
+ final ListenSyslog proc = new ListenSyslog();
+ final TestRunner runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(ListenSyslog.PROTOCOL, ListenSyslog.UDP_VALUE.getValue());
+ runner.setProperty(ListenSyslog.PORT, "0");
+
+ // schedule to start listening on a random port
+ final ProcessSessionFactory processSessionFactory = runner.getProcessSessionFactory();
+ final ProcessContext context = runner.getProcessContext();
+ proc.onScheduled(context);
+
+ final int numMessages = 20;
+ final int port = proc.getPort();
+ Assert.assertTrue(port > 0);
+
+ // write some UDP messages to the port in the background
+ final Thread sender = new Thread(new DatagramSender(port, numMessages, 10, VALID_MESSAGE));
+ sender.setDaemon(true);
+ sender.start();
+
+ // call onTrigger until we read all datagrams, or 30 seconds passed
+ try {
+ int numTransfered = 0;
+ long timeout = System.currentTimeMillis() + 30000;
+
+ while (numTransfered < numMessages && System.currentTimeMillis() < timeout) {
+ Thread.sleep(10);
+ proc.onTrigger(context, processSessionFactory);
+ numTransfered = runner.getFlowFilesForRelationship(ListenUDP.RELATIONSHIP_SUCCESS).size();
+ }
+ Assert.assertEquals("Did not process all the datagrams", numMessages, numTransfered);
+
+ MockFlowFile flowFile = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).get(0);
+ checkFlowFile(flowFile);
+
+ } finally {
+ // unschedule to close connections
+ proc.onUnscheduled();
+ }
+ }
+
+ @Test
+ public void testTCPSingleConnection() throws IOException, InterruptedException {
+ final ListenSyslog proc = new ListenSyslog();
+ final TestRunner runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(ListenSyslog.PROTOCOL, ListenSyslog.TCP_VALUE.getValue());
+ runner.setProperty(ListenSyslog.PORT, "0");
+
+ // schedule to start listening on a random port
+ final ProcessSessionFactory processSessionFactory = runner.getProcessSessionFactory();
+ final ProcessContext context = runner.getProcessContext();
+ proc.onScheduled(context);
+
+ final int numMessages = 20;
+ final int port = proc.getPort();
+ Assert.assertTrue(port > 0);
+
+ // write some TCP messages to the port in the background
+ final Thread sender = new Thread(new SingleConnectionSocketSender(port, numMessages, 10, VALID_MESSAGE));
+ sender.setDaemon(true);
+ sender.start();
+
+ // call onTrigger until we read all messages, or 30 seconds passed
+ try {
+ int numTransfered = 0;
+ long timeout = System.currentTimeMillis() + 30000;
+
+ while (numTransfered < numMessages && System.currentTimeMillis() < timeout) {
+ Thread.sleep(10);
+ proc.onTrigger(context, processSessionFactory);
+ numTransfered = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).size();
+ }
+ Assert.assertEquals("Did not process all the messages", numMessages, numTransfered);
+
+ MockFlowFile flowFile = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).get(0);
+ checkFlowFile(flowFile);
+ } finally {
+ // unschedule to close connections
+ proc.onUnscheduled();
+ }
+ }
+
+ @Test
+ public void testTCPMultipleConnection() throws IOException, InterruptedException {
+ final ListenSyslog proc = new ListenSyslog();
+ final TestRunner runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(ListenSyslog.PROTOCOL, ListenSyslog.TCP_VALUE.getValue());
+ runner.setProperty(ListenSyslog.PORT, "0");
+
+ // schedule to start listening on a random port
+ final ProcessSessionFactory processSessionFactory = runner.getProcessSessionFactory();
+ final ProcessContext context = runner.getProcessContext();
+ proc.onScheduled(context);
+
+ final int numMessages = 20;
+ final int port = proc.getPort();
+ Assert.assertTrue(port > 0);
+
+ // write some TCP messages to the port in the background
+ final Thread sender = new Thread(new MultiConnectionSocketSender(port, numMessages, 10, VALID_MESSAGE));
+ sender.setDaemon(true);
+ sender.start();
+
+ // call onTrigger until we read all messages, or 30 seconds passed
+ try {
+ int numTransfered = 0;
+ long timeout = System.currentTimeMillis() + 30000;
+
+ while (numTransfered < numMessages && System.currentTimeMillis() < timeout) {
+ Thread.sleep(10);
+ proc.onTrigger(context, processSessionFactory);
+ numTransfered = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).size();
+ }
+ Assert.assertEquals("Did not process all the messages", numMessages, numTransfered);
+
+ MockFlowFile flowFile = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).get(0);
+ checkFlowFile(flowFile);
+ } finally {
+ // unschedule to close connections
+ proc.onUnscheduled();
+ }
+ }
+
+ @Test
+ public void testInvalid() throws IOException, InterruptedException {
+ final ListenSyslog proc = new ListenSyslog();
+ final TestRunner runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(ListenSyslog.PROTOCOL, ListenSyslog.TCP_VALUE.getValue());
+ runner.setProperty(ListenSyslog.PORT, "0");
+
+ // schedule to start listening on a random port
+ final ProcessSessionFactory processSessionFactory = runner.getProcessSessionFactory();
+ final ProcessContext context = runner.getProcessContext();
+ proc.onScheduled(context);
+
+ final int numMessages = 10;
+ final int port = proc.getPort();
+ Assert.assertTrue(port > 0);
+
+ // write some TCP messages to the port in the background
+ final Thread sender = new Thread(new SingleConnectionSocketSender(port, numMessages, 100, INVALID_MESSAGE));
+ sender.setDaemon(true);
+ sender.start();
+
+ // call onTrigger until we read all messages, or 30 seconds passed
+ try {
+ int numTransfered = 0;
+ long timeout = System.currentTimeMillis() + 30000;
+
+ while (numTransfered < numMessages && System.currentTimeMillis() < timeout) {
+ Thread.sleep(50);
+ proc.onTrigger(context, processSessionFactory);
+ numTransfered = runner.getFlowFilesForRelationship(ListenSyslog.REL_INVALID).size();
+ }
+ Assert.assertEquals("Did not process all the messages", numMessages, numTransfered);
+
+ } finally {
+ // unschedule to close connections
+ proc.onUnscheduled();
+ }
+ }
+
+ @Test
+ public void testErrorQueue() {
+ final SyslogEvent event1 = Mockito.mock(SyslogEvent.class);
+ Mockito.when(event1.getRawMessage()).thenThrow(new ProcessException("ERROR"));
+
+ final SyslogEvent event2 = new SyslogEvent.Builder()
+ .facility("fac").severity("sev")
+ .fullMessage("abc").hostname("host")
+ .msgBody("body").timestamp("123").valid(true)
+ .rawMessage("abc".getBytes(Charset.forName("UTF-8")))
+ .build();
+
+ final MockProcessor proc = new MockProcessor(Arrays.asList(event1, event2));
+ final TestRunner runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(ListenSyslog.PORT, "12345");
+
+ // should keep re-processing event1 from the error queue
+ runner.run(3);
+ runner.assertTransferCount(ListenSyslog.REL_INVALID, 0);
+ runner.assertTransferCount(ListenSyslog.REL_SUCCESS, 0);
+ }
+
+
+ private void checkFlowFile(MockFlowFile flowFile) {
+ flowFile.assertContentEquals(VALID_MESSAGE);
+ Assert.assertEquals(PRI, flowFile.getAttribute(ListenSyslog.SyslogAttributes.PRIORITY.key()));
+ Assert.assertEquals(SEV, flowFile.getAttribute(ListenSyslog.SyslogAttributes.SEVERITY.key()));
+ Assert.assertEquals(FAC, flowFile.getAttribute(ListenSyslog.SyslogAttributes.FACILITY.key()));
+ Assert.assertEquals(TIME, flowFile.getAttribute(ListenSyslog.SyslogAttributes.TIMESTAMP.key()));
+ Assert.assertEquals(HOST, flowFile.getAttribute(ListenSyslog.SyslogAttributes.HOSTNAME.key()));
+ Assert.assertEquals(BODY, flowFile.getAttribute(ListenSyslog.SyslogAttributes.BODY.key()));
+ Assert.assertEquals("true", flowFile.getAttribute(ListenSyslog.SyslogAttributes.VALID.key()));
+ }
+
+ /**
+ * Sends a given number of datagrams to the given port.
+ */
+ public static final class DatagramSender implements Runnable {
+
+ final int port;
+ final int numMessages;
+ final long delay;
+ final String message;
+
+ public DatagramSender(int port, int numMessages, long delay, String message) {
+ this.port = port;
+ this.numMessages = numMessages;
+ this.delay = delay;
+ this.message = message;
+ }
+
+ @Override
+ public void run() {
+ byte[] bytes = message.getBytes(Charset.forName("UTF-8"));
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+
+ try (DatagramChannel channel = DatagramChannel.open()) {
+ channel.connect(new InetSocketAddress("localhost", port));
+ for (int i=0; i < numMessages; i++) {
+ buffer.clear();
+ buffer.put(bytes);
+ buffer.flip();
+
+ while(buffer.hasRemaining()) {
+ channel.write(buffer);
+ }
+
+ Thread.sleep(delay);
+ }
+ } catch (IOException e) {
+ LOGGER.error(e.getMessage(), e);
+ } catch (InterruptedException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+ }
+
+ /**
+ * Sends a given number of datagrams to the given port.
+ */
+ public static final class SingleConnectionSocketSender implements Runnable {
+
+ final int port;
+ final int numMessages;
+ final long delay;
+ final String message;
+
+ public SingleConnectionSocketSender(int port, int numMessages, long delay, String message) {
+ this.port = port;
+ this.numMessages = numMessages;
+ this.delay = delay;
+ this.message = message;
+ }
+
+ @Override
+ public void run() {
+ byte[] bytes = message.getBytes(Charset.forName("UTF-8"));
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+
+ try (SocketChannel channel = SocketChannel.open()) {
+ channel.connect(new InetSocketAddress("localhost", port));
+
+ for (int i=0; i < numMessages; i++) {
+ buffer.clear();
+ buffer.put(bytes);
+ buffer.flip();
+
+ while (buffer.hasRemaining()) {
+ channel.write(buffer);
+ }
+ Thread.sleep(delay);
+ }
+ } catch (IOException e) {
+ LOGGER.error(e.getMessage(), e);
+ } catch (InterruptedException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+ }
+
+ /**
+ * Sends a given number of datagrams to the given port.
+ */
+ public static final class MultiConnectionSocketSender implements Runnable {
+
+ final int port;
+ final int numMessages;
+ final long delay;
+ final String message;
+
+ public MultiConnectionSocketSender(int port, int numMessages, long delay, String message) {
+ this.port = port;
+ this.numMessages = numMessages;
+ this.delay = delay;
+ this.message = message;
+ }
+
+ @Override
+ public void run() {
+ byte[] bytes = message.getBytes(Charset.forName("UTF-8"));
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+
+ for (int i=0; i < numMessages; i++) {
+ try (SocketChannel channel = SocketChannel.open()) {
+ channel.connect(new InetSocketAddress("localhost", port));
+
+ buffer.clear();
+ buffer.put(bytes);
+ buffer.flip();
+
+ while (buffer.hasRemaining()) {
+ channel.write(buffer);
+ }
+ Thread.sleep(delay);
+ } catch (IOException e) {
+ LOGGER.error(e.getMessage(), e);
+ } catch (InterruptedException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ // A mock version of ListenSyslog that will queue the provided events
+ private static class MockProcessor extends ListenSyslog {
+
+ private List<SyslogEvent> eventList;
+
+ public MockProcessor(List<SyslogEvent> eventList) {
+ this.eventList = eventList;
+ }
+
+ @Override
+ protected ChannelReader createChannelReader(String protocol, BufferPool bufferPool, SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents) throws IOException {
+ return new ChannelReader() {
+ @Override
+ public void open(int port, int maxBufferSize) throws IOException {
+
+ }
+
+ @Override
+ public int getPort() {
+ return 0;
+ }
+
+ @Override
+ public void stop() {
+
+ }
+
+ @Override
+ public void close() {
+
+ }
+
+ @Override
+ public void run() {
+ for (SyslogEvent event : eventList) {
+ syslogEvents.offer(event);
+ }
+ }
+ };
+ }
+ }
+
+}
[36/50] [abbrv] nifi git commit: NIFI-1111: We were subtracting
values in the wrong order so that we always would 'yield' for a negative
amount of time, which equated to not yielding at all.
Posted by tk...@apache.org.
NIFI-1111: We were subtracting values in the wrong order so that we always would 'yield' for a negative amount of time, which equated to not yielding at all.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/1a388f95
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/1a388f95
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/1a388f95
Branch: refs/heads/NIFI-1073
Commit: 1a388f957e286d394ad11c0b5f192ddf23f7c92b
Parents: 98f5a1a
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Nov 4 16:30:20 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Nov 6 09:03:38 2015 -0500
----------------------------------------------------------------------
.../nifi/controller/scheduling/TimerDrivenSchedulingAgent.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/1a388f95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java
index c4e6609..96cee20 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/TimerDrivenSchedulingAgent.java
@@ -127,7 +127,7 @@ public class TimerDrivenSchedulingAgent implements SchedulingAgent {
// after the yield has expired.
final long newYieldExpiration = connectable.getYieldExpiration();
if (newYieldExpiration > System.currentTimeMillis()) {
- final long yieldMillis = System.currentTimeMillis() - newYieldExpiration;
+ final long yieldMillis = newYieldExpiration - System.currentTimeMillis();
final ScheduledFuture<?> scheduledFuture = futureRef.get();
if (scheduledFuture == null) {
return;
[06/50] [abbrv] nifi git commit: NIFI-1079 Replacing Name for
NULL_VALUE_FOR_EMPTY_STRING as I had accidentally removed it.
Posted by tk...@apache.org.
NIFI-1079 Replacing Name for NULL_VALUE_FOR_EMPTY_STRING as I had accidentally removed it.
Signed-off-by: Bryan Bende <bb...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/eb389cf8
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/eb389cf8
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/eb389cf8
Branch: refs/heads/NIFI-1073
Commit: eb389cf84cd5f610b5ea2235a4eb78de47f6417e
Parents: aef0d8f
Author: Jeremy Dyer <jd...@gmail.com>
Authored: Fri Oct 30 14:15:59 2015 -0400
Committer: Bryan Bende <bb...@apache.org>
Committed: Fri Oct 30 14:30:56 2015 -0400
----------------------------------------------------------------------
.../org/apache/nifi/processors/standard/AttributesToJSON.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/eb389cf8/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
index 89bb0b6..0ab3ca7 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
@@ -99,9 +99,9 @@ public class AttributesToJSON extends AbstractProcessor {
.build();
public static final PropertyDescriptor NULL_VALUE_FOR_EMPTY_STRING = new PropertyDescriptor.Builder()
- .name(("If true a non existing or empty attribute will be NULL in the resulting JSON. If false an empty " +
- "string will be placed in the JSON"))
- .description("")
+ .name(("Null Value"))
+ .description("If true a non existing or empty attribute will be NULL in the resulting JSON. If false an empty " +
+ "string will be placed in the JSON")
.required(true)
.allowableValues("true", "false")
.defaultValue("false")
[11/50] [abbrv] nifi git commit: NIFI-869: Fixed checkstyle violations
Posted by tk...@apache.org.
NIFI-869: Fixed checkstyle violations
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/9c148da1
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/9c148da1
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/9c148da1
Branch: refs/heads/NIFI-1073
Commit: 9c148da1c28fa641b94cd7e8f1f9f07c63f2896a
Parents: ba72452
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Oct 30 16:09:50 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Oct 30 16:09:50 2015 -0400
----------------------------------------------------------------------
.../nifi/processor/TestSimpleProcessLogger.java | 113 ++++++++++---------
1 file changed, 57 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c148da1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
index 2876abb..add54f3 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
@@ -18,12 +18,12 @@ package org.apache.nifi.processor;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.argThat;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.times;
import java.lang.reflect.Field;
@@ -35,66 +35,67 @@ import org.mockito.internal.matchers.VarargMatcher;
import org.slf4j.Logger;
public class TestSimpleProcessLogger {
- private final Exception e = new RuntimeException("intentional");
+ private final Exception e = new RuntimeException("intentional");
+
+ private ReportingTask task;
- private ReportingTask task;
+ private SimpleProcessLogger componentLog;
- private SimpleProcessLogger componentLog;
+ private Logger logger;
- private Logger logger;
+ @Before
+ public void before() {
+ task = mock(ReportingTask.class);
+ when(task.getIdentifier()).thenReturn("foo");
+ when(task.toString()).thenReturn("MyTask");
+ componentLog = new SimpleProcessLogger(task.getIdentifier(), task);
+ try {
+ Field loggerField = componentLog.getClass().getDeclaredField("logger");
+ loggerField.setAccessible(true);
+ logger = mock(Logger.class);
+ loggerField.set(componentLog, logger);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
- @Before
- public void before(){
- task = mock(ReportingTask.class);
- when(task.getIdentifier()).thenReturn("foo");
- when(task.toString()).thenReturn("MyTask");
- componentLog = new SimpleProcessLogger(task.getIdentifier(), task);
- try {
- Field loggerField = componentLog.getClass().getDeclaredField("logger");
- loggerField.setAccessible(true);
- logger = mock(Logger.class);
- loggerField.set(componentLog, logger);
- } catch (Exception e) {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnError() {
+ componentLog.error("Hello {}", e);
+ verify(logger, times(1)).error(anyString(), argThat(new MyVarargMatcher()));
+ }
- @Test
- public void validateDelegateLoggerReceivesThrowableToStringOnError() {
- componentLog.error("Hello {}", e);
- verify(logger, times(1)).error(anyString(), argThat(new MyVarargMatcher()));
- }
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnInfo() {
+ componentLog.info("Hello {}", e);
+ verify(logger, times(1)).info(anyString(), argThat(new MyVarargMatcher()));
+ }
- @Test
- public void validateDelegateLoggerReceivesThrowableToStringOnInfo() {
- componentLog.info("Hello {}", e);
- verify(logger, times(1)).info(anyString(), argThat(new MyVarargMatcher()));
- }
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnTrace() {
+ componentLog.trace("Hello {}", e);
+ verify(logger, times(1)).trace(anyString(), argThat(new MyVarargMatcher()));
+ }
- @Test
- public void validateDelegateLoggerReceivesThrowableToStringOnTrace() {
- componentLog.trace("Hello {}", e);
- verify(logger, times(1)).trace(anyString(), argThat(new MyVarargMatcher()));
- }
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnWarn() {
+ componentLog.warn("Hello {}", e);
+ verify(logger, times(1)).warn(anyString(), argThat(new MyVarargMatcher()));
+ }
- @Test
- public void validateDelegateLoggerReceivesThrowableToStringOnWarn() {
- componentLog.warn("Hello {}", e);
- verify(logger, times(1)).warn(anyString(), argThat(new MyVarargMatcher()));
- }
+ /**
+ *
+ */
+ private class MyVarargMatcher extends ArgumentMatcher<Object[]>implements VarargMatcher {
+ private static final long serialVersionUID = 1L;
- /**
- *
- */
- private class MyVarargMatcher extends ArgumentMatcher<Object[]> implements VarargMatcher {
- private static final long serialVersionUID = 1L;
- @Override
- public boolean matches(Object argument) {
- Object[] args = (Object[]) argument;
- assertEquals(task, args[0]);
- assertEquals(e.toString(), args[1]);
- return true;
- }
- }
+ @Override
+ public boolean matches(Object argument) {
+ Object[] args = (Object[]) argument;
+ assertEquals(task, args[0]);
+ assertEquals(e.toString(), args[1]);
+ return true;
+ }
+ }
}
[22/50] [abbrv] nifi git commit: Merge branch 'NIFI-1082'
Posted by tk...@apache.org.
Merge branch 'NIFI-1082'
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/814e8b21
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/814e8b21
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/814e8b21
Branch: refs/heads/NIFI-1073
Commit: 814e8b212cf6cb239418ea25b6f5dd1eb919ae14
Parents: abf2c62 cf8ca3d
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 2 11:29:52 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 11:29:52 2015 -0500
----------------------------------------------------------------------
.../StandardProvenanceEventRecord.java | 36 ++--
.../nifi/provenance/StandardQueryResult.java | 25 ++-
.../nifi/provenance/IndexConfiguration.java | 47 +++---
.../PersistentProvenanceRepository.java | 124 +++++++-------
.../nifi/provenance/lucene/DocsReader.java | 49 ++----
.../nifi/provenance/lucene/IndexSearch.java | 35 ++--
.../nifi/provenance/lucene/LineageQuery.java | 7 +-
.../TestPersistentProvenanceRepository.java | 163 ++++++++++++++++++-
.../VolatileProvenanceRepository.java | 16 +-
9 files changed, 327 insertions(+), 175 deletions(-)
----------------------------------------------------------------------
[20/50] [abbrv] nifi git commit: Merge branch 'NIFI-1051' of
https://github.com/olegz/nifi into NIFI-1051
Posted by tk...@apache.org.
Merge branch 'NIFI-1051' of https://github.com/olegz/nifi into NIFI-1051
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/7a73867c
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/7a73867c
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/7a73867c
Branch: refs/heads/NIFI-1073
Commit: 7a73867c46629ff20ef5d84f1167cb34e503bc75
Parents: 2ae4902 5c4042b
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 2 10:51:43 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 10:51:43 2015 -0500
----------------------------------------------------------------------
.../repository/FileSystemRepository.java | 6 ++++++
.../repository/TestFileSystemRepository.java | 18 ++++++++++++++++++
2 files changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/7a73867c/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
----------------------------------------------------------------------
[08/50] [abbrv] nifi git commit: NIFI-869 Fixed SimpleProcessLogger
to log correct messages Ensured that SimpleProcessLogger correctly interprets
Throwable as discussed in JIRA Added tests
Posted by tk...@apache.org.
NIFI-869 Fixed SimpleProcessLogger to log correct messages Ensured that SimpleProcessLogger correctly interprets Throwable as discussed in JIRA Added tests
Signed-off-by: Mark Payne <ma...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a3d43d23
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a3d43d23
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a3d43d23
Branch: refs/heads/NIFI-1073
Commit: a3d43d23dcf68310b518d35751d1835767d895a4
Parents: 90aea01
Author: Oleg Zhurakousky <ol...@suitcase.io>
Authored: Fri Oct 30 14:24:12 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Oct 30 15:52:33 2015 -0400
----------------------------------------------------------------------
.../scheduling/StandardProcessScheduler.java | 2 +-
.../nifi/processor/SimpleProcessLogger.java | 20 ++--
.../nifi/processor/TestSimpleProcessLogger.java | 100 +++++++++++++++++++
3 files changed, 113 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/a3d43d23/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
----------------------------------------------------------------------
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 5d99d07..9ff58c8 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
@@ -655,7 +655,7 @@ public final class StandardProcessScheduler implements ProcessScheduler {
final Throwable cause = e instanceof InvocationTargetException ? e.getCause() : e;
final ComponentLog componentLog = new SimpleProcessLogger(service.getIdentifier(), service);
- componentLog.error("failed to invoke @OnEnabled method due to {}", new Object[]{cause.toString()});
+ componentLog.error("Failed to invoke @OnEnabled method due to {}", cause);
LOG.error("Failed to invoke @OnEnabled method of {} due to {}", service.getControllerServiceImplementation(), cause.toString());
if (LOG.isDebugEnabled()) {
LOG.error("", cause);
http://git-wip-us.apache.org/repos/asf/nifi/blob/a3d43d23/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
index afd0c59..900ec77 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
@@ -62,8 +62,12 @@ public class SimpleProcessLogger implements ProcessorLog {
}
@Override
- public void warn(final String msg, final Throwable t) {
- warn("{} " + msg, new Object[]{component}, t);
+ public void warn(String msg, final Throwable t) {
+ //warn("{} " + msg, new Object[]{component}, t);
+ msg = "{} " + msg;
+ final Object[] os = {component, t.toString(), t};
+ logger.warn(msg, os);
+ logRepository.addLogMessage(LogLevel.WARN, msg, os, t);
}
@Override
@@ -101,8 +105,8 @@ public class SimpleProcessLogger implements ProcessorLog {
@Override
public void trace(String msg, Throwable t) {
msg = "{} " + msg;
- final Object[] os = {component};
- logger.trace(msg, os, t);
+ final Object[] os = {component, t.toString(), t};
+ logger.trace(msg, os);
logRepository.addLogMessage(LogLevel.TRACE, msg, os, t);
}
@@ -160,7 +164,7 @@ public class SimpleProcessLogger implements ProcessorLog {
@Override
public void info(String msg, Throwable t) {
msg = "{} " + msg;
- final Object[] os = {component};
+ final Object[] os = {component, t.toString()};
logger.info(msg, os);
if (logger.isDebugEnabled()) {
@@ -207,12 +211,12 @@ public class SimpleProcessLogger implements ProcessorLog {
@Override
public void error(String msg, Throwable t) {
msg = "{} " + msg;
- final Object[] os = {component};
-
- logger.error(msg, os, t);
+ Object[] os = {component, t.toString()};
+ logger.error(msg, os);
if (logger.isDebugEnabled()) {
logger.error("", t);
}
+
logRepository.addLogMessage(LogLevel.ERROR, msg, os, t);
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/a3d43d23/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
new file mode 100644
index 0000000..2876abb
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/processor/TestSimpleProcessLogger.java
@@ -0,0 +1,100 @@
+/*
+ * 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.processor;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.argThat;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.times;
+
+import java.lang.reflect.Field;
+
+import org.apache.nifi.reporting.ReportingTask;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.ArgumentMatcher;
+import org.mockito.internal.matchers.VarargMatcher;
+import org.slf4j.Logger;
+
+public class TestSimpleProcessLogger {
+ private final Exception e = new RuntimeException("intentional");
+
+ private ReportingTask task;
+
+ private SimpleProcessLogger componentLog;
+
+ private Logger logger;
+
+ @Before
+ public void before(){
+ task = mock(ReportingTask.class);
+ when(task.getIdentifier()).thenReturn("foo");
+ when(task.toString()).thenReturn("MyTask");
+ componentLog = new SimpleProcessLogger(task.getIdentifier(), task);
+ try {
+ Field loggerField = componentLog.getClass().getDeclaredField("logger");
+ loggerField.setAccessible(true);
+ logger = mock(Logger.class);
+ loggerField.set(componentLog, logger);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnError() {
+ componentLog.error("Hello {}", e);
+ verify(logger, times(1)).error(anyString(), argThat(new MyVarargMatcher()));
+ }
+
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnInfo() {
+ componentLog.info("Hello {}", e);
+ verify(logger, times(1)).info(anyString(), argThat(new MyVarargMatcher()));
+ }
+
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnTrace() {
+ componentLog.trace("Hello {}", e);
+ verify(logger, times(1)).trace(anyString(), argThat(new MyVarargMatcher()));
+ }
+
+ @Test
+ public void validateDelegateLoggerReceivesThrowableToStringOnWarn() {
+ componentLog.warn("Hello {}", e);
+ verify(logger, times(1)).warn(anyString(), argThat(new MyVarargMatcher()));
+ }
+
+ /**
+ *
+ */
+ private class MyVarargMatcher extends ArgumentMatcher<Object[]> implements VarargMatcher {
+ private static final long serialVersionUID = 1L;
+ @Override
+ public boolean matches(Object argument) {
+ Object[] args = (Object[]) argument;
+ assertEquals(task, args[0]);
+ assertEquals(e.toString(), args[1]);
+ return true;
+ }
+ }
+}
[45/50] [abbrv] nifi git commit: NIFI-1073 fixed resource leaks and
used nifi util for ByteArrayInputStream in CaptureServlet
Posted by tk...@apache.org.
NIFI-1073 fixed resource leaks and used nifi util for ByteArrayInputStream in CaptureServlet
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/35723d92
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/35723d92
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/35723d92
Branch: refs/heads/NIFI-1073
Commit: 35723d9265f46aa179642eae345737c7157d503f
Parents: 47b93d4
Author: Tony Kurc <tr...@gmail.com>
Authored: Mon Oct 26 21:00:27 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 21:11:33 2015 -0500
----------------------------------------------------------------------
.../nifi/processors/WriteResourceToStream.java | 11 +++++++---
.../processors/standard/ListFileTransfer.java | 2 ++
.../processors/standard/CaptureServlet.java | 12 ++++++----
.../DistributedMapCacheClientService.java | 23 +++++++-------------
4 files changed, 26 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/35723d92/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/src/main/java/org/apache/nifi/processors/WriteResourceToStream.java
----------------------------------------------------------------------
diff --git a/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/src/main/java/org/apache/nifi/processors/WriteResourceToStream.java b/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/src/main/java/org/apache/nifi/processors/WriteResourceToStream.java
index 5d595b4..c840ce8 100644
--- a/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/src/main/java/org/apache/nifi/processors/WriteResourceToStream.java
+++ b/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/src/main/java/org/apache/nifi/processors/WriteResourceToStream.java
@@ -17,6 +17,7 @@
package org.apache.nifi.processors;
import java.io.IOException;
+import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collections;
import java.util.HashSet;
@@ -34,6 +35,7 @@ import org.apache.nifi.processor.ProcessorInitializationContext;
import org.apache.nifi.processor.Relationship;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processor.io.OutputStreamCallback;
+import org.apache.nifi.util.file.FileUtils;
@Tags({ "example", "resources" })
@CapabilityDescription("This example processor loads a resource from the nar and writes it to the FlowFile content")
@@ -57,13 +59,16 @@ public class WriteResourceToStream extends AbstractProcessor {
relationships.add(REL_SUCCESS);
relationships.add(REL_FAILURE);
this.relationships = Collections.unmodifiableSet(relationships);
-
+ final InputStream resourceStream = Thread.currentThread()
+ .getContextClassLoader().getResourceAsStream("file.txt");
try {
- this.resourceData = IOUtils.toString(Thread.currentThread()
- .getContextClassLoader().getResourceAsStream("file.txt"));
+ this.resourceData = IOUtils.toString(resourceStream);
} catch (IOException e) {
throw new RuntimeException("Unable to load resources", e);
+ } finally {
+ FileUtils.closeQuietly(resourceStream);
}
+
}
@Override
http://git-wip-us.apache.org/repos/asf/nifi/blob/35723d92/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
index b6c8c28..ce344ed 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
@@ -29,6 +29,7 @@ import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.processors.standard.util.FileInfo;
import org.apache.nifi.processors.standard.util.FileTransfer;
+import org.apache.nifi.util.file.FileUtils;
public abstract class ListFileTransfer extends AbstractListProcessor<FileInfo> {
public static final PropertyDescriptor HOSTNAME = new PropertyDescriptor.Builder()
@@ -93,6 +94,7 @@ public abstract class ListFileTransfer extends AbstractListProcessor<FileInfo> {
protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException {
final FileTransfer transfer = getFileTransfer(context);
final List<FileInfo> listing = transfer.getListing();
+ FileUtils.closeQuietly(transfer);
if (minTimestamp == null) {
return listing;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/35723d92/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
index d6c87d6..a1398f4 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
@@ -24,8 +24,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.Response.Status;
-import org.apache.activemq.util.ByteArrayOutputStream;
+import org.apache.nifi.stream.io.ByteArrayOutputStream;
import org.apache.nifi.stream.io.StreamUtils;
+import org.apache.nifi.util.file.FileUtils;
public class CaptureServlet extends HttpServlet {
@@ -40,9 +41,12 @@ public class CaptureServlet extends HttpServlet {
@Override
protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- StreamUtils.copy(request.getInputStream(), baos);
- this.lastPost = baos.toByteArray();
-
+ try{
+ StreamUtils.copy(request.getInputStream(), baos);
+ this.lastPost = baos.toByteArray();
+ } finally{
+ FileUtils.closeQuietly(baos);
+ }
response.setStatus(Status.OK.getStatusCode());
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/35723d92/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClientService.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClientService.java b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClientService.java
index c03dd5a..9d9c741 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClientService.java
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClientService.java
@@ -40,6 +40,7 @@ import org.apache.nifi.ssl.SSLContextService;
import org.apache.nifi.ssl.SSLContextService.ClientAuth;
import org.apache.nifi.stream.io.ByteArrayOutputStream;
import org.apache.nifi.stream.io.DataOutputStream;
+import org.apache.nifi.util.file.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -298,27 +299,19 @@ public class DistributedMapCacheClientService extends AbstractControllerService
if (closed) {
throw new IllegalStateException("Client is closed");
}
-
+ boolean tryToRequeue = true;
final CommsSession session = leaseCommsSession();
try {
return action.execute(session);
} catch (final IOException ioe) {
- try {
- session.close();
- } catch (final IOException ignored) {
- }
-
+ tryToRequeue = false;
throw ioe;
} finally {
- if (!session.isClosed()) {
- if (this.closed) {
- try {
- session.close();
- } catch (final IOException ioe) {
- }
- } else {
- queue.offer(session);
- }
+ if (tryToRequeue == true && this.closed == false) {
+ queue.offer(session);
+ }
+ else{
+ FileUtils.closeQuietly(session);
}
}
}
[07/50] [abbrv] nifi git commit: NIFI-1079 Pull Request functions as
described and passes contrib-check. This closes #109.
Posted by tk...@apache.org.
NIFI-1079 Pull Request functions as described and passes contrib-check. This closes #109.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/1d97876f
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/1d97876f
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/1d97876f
Branch: refs/heads/NIFI-1073
Commit: 1d97876f82cdd37b2bab5e99ffc170f483c32037
Parents: eb389cf
Author: Bryan Bende <bb...@apache.org>
Authored: Fri Oct 30 14:35:35 2015 -0400
Committer: Bryan Bende <bb...@apache.org>
Committed: Fri Oct 30 14:36:46 2015 -0400
----------------------------------------------------------------------
----------------------------------------------------------------------
[28/50] [abbrv] nifi git commit: NIFI-1098 - Ensuring we pull the
correct attribute from the servlet context. Reviewed by Tony Kurc
(tkurc@apache.org)
Posted by tk...@apache.org.
NIFI-1098 - Ensuring we pull the correct attribute from the servlet context. Reviewed by Tony Kurc (tkurc@apache.org)
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/201eac05
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/201eac05
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/201eac05
Branch: refs/heads/NIFI-1073
Commit: 201eac052b155d687393d2698dc9069f0f7c0c1c
Parents: fedbe40
Author: Matt Gilman <ma...@gmail.com>
Authored: Wed Nov 4 12:11:19 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Wed Nov 4 12:11:19 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/update/attributes/api/RuleResource.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/201eac05/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java
index 05efb64..f68227a 100644
--- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java
+++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java
@@ -410,7 +410,7 @@ public class RuleResource {
@QueryParam("q") final String term) {
// get the web context
- final NiFiWebConfigurationContext configurationContext = (NiFiWebConfigurationContext) servletContext.getAttribute("nifi-web-context");
+ final NiFiWebConfigurationContext configurationContext = (NiFiWebConfigurationContext) servletContext.getAttribute("nifi-web-configuration-context");
// build the web context config
final NiFiWebRequestContext requestContext = getRequestContext(processorId);
[24/50] [abbrv] nifi git commit: Merge branch 'master' into NIFI-730
Posted by tk...@apache.org.
Merge branch 'master' into NIFI-730
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/e4cebba3
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/e4cebba3
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/e4cebba3
Branch: refs/heads/NIFI-1073
Commit: e4cebba3c7868010c2b9fd994b850f40b81aa044
Parents: 5a04021 a549621
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 2 14:02:16 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 14:02:16 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/action/Action.java | 50 ++
.../java/org/apache/nifi/action/Component.java | 34 +
.../java/org/apache/nifi/action/Operation.java | 37 +
.../component/details/ComponentDetails.java | 26 +
.../component/details/ExtensionDetails.java | 26 +
.../details/RemoteProcessGroupDetails.java | 26 +
.../nifi/action/details/ActionDetails.java | 26 +
.../nifi/action/details/ConfigureDetails.java | 30 +
.../nifi/action/details/ConnectDetails.java | 40 +
.../apache/nifi/action/details/MoveDetails.java | 30 +
.../nifi/action/details/PurgeDetails.java | 28 +
.../annotation/behavior/InputRequirement.java | 67 ++
.../apache/nifi/processor/ProcessSession.java | 27 +
.../nifi/provenance/ProvenanceEventType.java | 31 +-
.../nifi/provenance/ProvenanceReporter.java | 37 +
.../org/apache/nifi/reporting/EventAccess.java | 13 +
.../StandardProvenanceEventRecord.java | 36 +-
.../nifi/provenance/StandardQueryResult.java | 25 +-
.../nifi/processor/util/StandardValidators.java | 10 +
.../client/socket/EndpointConnectionPool.java | 3 +-
.../src/main/asciidoc/administration-guide.adoc | 4 +-
.../src/main/asciidoc/developer-guide.adoc | 11 +
.../src/main/asciidoc/getting-started.adoc | 754 +++++++++++++++++
.../src/main/asciidoc/images/add-processor.png | Bin 31524 -> 92164 bytes
nifi-docs/src/main/asciidoc/user-guide.adoc | 2 +-
.../src/main/java/MyProcessor.java | 11 +-
.../org/apache/nifi/util/MockEventAccess.java | 27 +
.../apache/nifi/util/MockProcessSession.java | 8 +
.../nifi/util/MockProvenanceReporter.java | 35 +-
.../nifi/processors/avro/ConvertAvroToJSON.java | 70 +-
.../processors/avro/ExtractAvroMetadata.java | 29 +-
.../apache/nifi/processors/avro/SplitAvro.java | 27 +-
.../processors/avro/TestConvertAvroToJSON.java | 47 +-
.../processors/aws/AbstractAWSProcessor.java | 2 +-
.../nifi/processors/aws/s3/DeleteS3Object.java | 98 +++
.../nifi/processors/aws/s3/FetchS3Object.java | 5 +-
.../nifi/processors/aws/s3/PutS3Object.java | 48 +-
.../apache/nifi/processors/aws/sns/PutSNS.java | 3 +
.../nifi/processors/aws/sqs/DeleteSQS.java | 3 +
.../apache/nifi/processors/aws/sqs/GetSQS.java | 5 +-
.../apache/nifi/processors/aws/sqs/PutSQS.java | 5 +-
.../org.apache.nifi.processor.Processor | 1 +
.../processors/aws/s3/TestDeleteS3Object.java | 141 ++++
.../nifi/processors/flume/ExecuteFlumeSink.java | 14 +-
.../processors/flume/ExecuteFlumeSource.java | 14 +-
.../org/apache/nifi/admin/dao/ActionDAO.java | 12 +-
.../java/org/apache/nifi/admin/dao/UserDAO.java | 3 +-
.../nifi/admin/dao/impl/StandardActionDAO.java | 93 ++-
.../nifi/admin/dao/impl/StandardUserDAO.java | 4 +-
.../apache/nifi/admin/service/AuditService.java | 18 +-
.../admin/service/action/AddActionsAction.java | 3 +-
.../service/action/PurgeActionsAction.java | 3 +-
.../service/impl/StandardAuditService.java | 24 +-
.../resources/nifi-administration-context.xml | 2 +-
.../apache/nifi/web/api/dto/ProcessorDTO.java | 15 +
.../manager/impl/ClusteredEventAccess.java | 21 +-
.../cluster/manager/impl/WebClusterManager.java | 2 +-
.../apache/nifi/controller/ProcessorNode.java | 7 +-
.../apache/nifi/controller/FlowController.java | 15 +-
.../nifi/controller/FlowUnmarshaller.java | 77 --
.../nifi/controller/StandardProcessorNode.java | 109 ++-
.../apache/nifi/controller/TemplateManager.java | 1 +
.../repository/BatchingSessionFactory.java | 5 +
.../repository/FileSystemRepository.java | 40 +-
.../repository/StandardProcessSession.java | 12 +
.../repository/StandardProvenanceReporter.java | 31 +-
.../nifi/processor/SimpleProcessLogger.java | 20 +-
.../nifi/spring/FlowControllerFactoryBean.java | 8 +
.../src/main/resources/FlowConfiguration.xsd | 2 +-
.../src/main/resources/nifi-context.xml | 1 +
.../controller/StandardFlowServiceTest.java | 5 +-
.../repository/TestFileSystemRepository.java | 18 +
.../repository/TestStandardProcessSession.java | 39 +-
.../nifi/processor/TestSimpleProcessLogger.java | 101 +++
.../src/main/resources/bin/nifi.sh | 96 +--
.../nifi-framework/nifi-user-actions/pom.xml | 7 +
.../java/org/apache/nifi/action/Action.java | 121 ---
.../java/org/apache/nifi/action/Component.java | 34 -
.../apache/nifi/action/FlowChangeAction.java | 130 +++
.../java/org/apache/nifi/action/Operation.java | 37 -
.../component/details/ComponentDetails.java | 26 -
.../component/details/ExtensionDetails.java | 34 -
.../details/FlowChangeExtensionDetails.java | 35 +
.../FlowChangeRemoteProcessGroupDetails.java | 35 +
.../details/RemoteProcessGroupDetails.java | 34 -
.../nifi/action/details/ActionDetails.java | 26 -
.../nifi/action/details/ConfigureDetails.java | 52 --
.../nifi/action/details/ConnectDetails.java | 90 --
.../details/FlowChangeConfigureDetails.java | 55 ++
.../details/FlowChangeConnectDetails.java | 97 +++
.../action/details/FlowChangeMoveDetails.java | 65 ++
.../action/details/FlowChangePurgeDetails.java | 46 +
.../apache/nifi/action/details/MoveDetails.java | 61 --
.../nifi/action/details/PurgeDetails.java | 45 -
.../apache/nifi/audit/ControllerAuditor.java | 27 +-
.../nifi/audit/ControllerServiceAuditor.java | 43 +-
.../org/apache/nifi/audit/FunnelAuditor.java | 7 +-
.../java/org/apache/nifi/audit/NiFiAuditor.java | 25 +-
.../java/org/apache/nifi/audit/PortAuditor.java | 27 +-
.../apache/nifi/audit/ProcessGroupAuditor.java | 25 +-
.../org/apache/nifi/audit/ProcessorAuditor.java | 25 +-
.../apache/nifi/audit/RelationshipAuditor.java | 18 +-
.../nifi/audit/RemoteProcessGroupAuditor.java | 35 +-
.../apache/nifi/audit/ReportingTaskAuditor.java | 25 +-
.../org/apache/nifi/audit/SnippetAuditor.java | 26 +-
.../nifi/web/StandardNiFiServiceFacade.java | 9 +-
.../StandardNiFiWebConfigurationContext.java | 13 +-
.../apache/nifi/web/StandardNiFiWebContext.java | 13 +-
.../nifi/web/api/ApplicationResource.java | 5 +-
.../org/apache/nifi/web/api/dto/DtoFactory.java | 21 +-
.../partials/provenance/provenance-content.jsp | 2 +
.../nifi-web-ui/src/main/webapp/css/main.css | 7 +-
.../src/main/webapp/js/nf/canvas/nf-actions.js | 20 +-
.../main/webapp/js/nf/canvas/nf-canvas-utils.js | 13 +-
.../js/nf/canvas/nf-connection-configuration.js | 8 +-
.../main/webapp/js/nf/canvas/nf-context-menu.js | 23 +-
.../js/nf/provenance/nf-provenance-table.js | 54 +-
.../webapp/js/nf/provenance/nf-provenance.js | 16 +-
.../org/apache/nifi/processors/GeoEnrichIP.java | 3 +
.../hadoop/AbstractHadoopProcessor.java | 92 +-
.../hadoop/CreateHadoopSequenceFile.java | 4 +-
.../nifi/processors/hadoop/FetchHDFS.java | 5 +-
.../apache/nifi/processors/hadoop/GetHDFS.java | 3 +
.../apache/nifi/processors/hadoop/ListHDFS.java | 3 +
.../apache/nifi/processors/hadoop/PutHDFS.java | 3 +
.../processors/hl7/ExtractHL7Attributes.java | 3 +
.../apache/nifi/processors/hl7/RouteHL7.java | 3 +
.../processors/image/ExtractImageMetadata.java | 36 +-
.../nifi/processors/image/ResizeImage.java | 38 +-
.../apache/nifi/processors/kafka/GetKafka.java | 21 +-
.../apache/nifi/processors/kafka/PutKafka.java | 16 +-
.../processors/kite/AbstractKiteProcessor.java | 11 +-
.../nifi/processors/kite/ConvertCSVToAvro.java | 312 +++----
.../nifi/processors/kite/ConvertJSONToAvro.java | 14 +-
.../processors/kite/StoreInKiteDataset.java | 9 +-
.../processors/kite/TestCSVToAvroProcessor.java | 39 +
.../nifi/processors/yandex/YandexTranslate.java | 3 +
.../nifi/provenance/IndexConfiguration.java | 47 +-
.../PersistentProvenanceRepository.java | 124 +--
.../nifi/provenance/lucene/DocsReader.java | 49 +-
.../nifi/provenance/lucene/IndexSearch.java | 35 +-
.../nifi/provenance/lucene/LineageQuery.java | 7 +-
.../TestPersistentProvenanceRepository.java | 163 +++-
.../VolatileProvenanceRepository.java | 16 +-
.../nifi/processors/twitter/GetTwitter.java | 5 +-
.../apache/nifi/processors/solr/GetSolr.java | 43 +-
.../processors/solr/PutSolrContentStream.java | 33 +-
.../nifi-standard-prioritizers/pom.xml | 4 +
.../PriorityAttributePrioritizer.java | 7 +-
.../PriorityAttributePrioritizerTest.java | 17 +-
.../nifi-standard-processors/pom.xml | 8 +
.../standard/AbstractListProcessor.java | 507 +++++++++++
.../processors/standard/AttributesToJSON.java | 242 ++++++
.../standard/Base64EncodeContent.java | 31 +-
.../processors/standard/CompressContent.java | 15 +-
.../nifi/processors/standard/ControlRate.java | 113 +--
.../standard/ConvertCharacterSet.java | 22 +-
.../processors/standard/ConvertJSONToSQL.java | 3 +
.../processors/standard/DetectDuplicate.java | 3 +
.../processors/standard/DistributeLoad.java | 3 +
.../processors/standard/DuplicateFlowFile.java | 3 +
.../nifi/processors/standard/EncodeContent.java | 15 +-
.../processors/standard/EncryptContent.java | 3 +
.../processors/standard/EvaluateJsonPath.java | 38 +-
.../nifi/processors/standard/EvaluateXPath.java | 29 +-
.../processors/standard/EvaluateXQuery.java | 25 +-
.../processors/standard/ExecuteProcess.java | 3 +
.../nifi/processors/standard/ExecuteSQL.java | 12 +-
.../standard/ExecuteStreamCommand.java | 7 +-
.../nifi/processors/standard/ExtractText.java | 3 +
.../processors/standard/FetchFileTransfer.java | 346 ++++++++
.../nifi/processors/standard/FetchSFTP.java | 93 +++
.../processors/standard/GenerateFlowFile.java | 11 +-
.../apache/nifi/processors/standard/GetFTP.java | 13 +-
.../nifi/processors/standard/GetFile.java | 7 +-
.../nifi/processors/standard/GetHTTP.java | 3 +
.../nifi/processors/standard/GetJMSQueue.java | 3 +
.../nifi/processors/standard/GetJMSTopic.java | 3 +
.../nifi/processors/standard/GetSFTP.java | 7 +-
.../processors/standard/HandleHttpRequest.java | 30 +-
.../processors/standard/HandleHttpResponse.java | 5 +-
.../nifi/processors/standard/HashAttribute.java | 5 +-
.../nifi/processors/standard/HashContent.java | 5 +-
.../processors/standard/IdentifyMimeType.java | 5 +-
.../nifi/processors/standard/InvokeHTTP.java | 201 ++---
.../nifi/processors/standard/JmsConsumer.java | 2 +
.../processors/standard/ListFileTransfer.java | 119 +++
.../nifi/processors/standard/ListSFTP.java | 88 ++
.../nifi/processors/standard/ListenHTTP.java | 121 +--
.../nifi/processors/standard/ListenUDP.java | 18 +-
.../nifi/processors/standard/LogAttribute.java | 16 +-
.../nifi/processors/standard/MergeContent.java | 17 +-
.../nifi/processors/standard/ModifyBytes.java | 14 +-
.../processors/standard/MonitorActivity.java | 31 +-
.../nifi/processors/standard/PostHTTP.java | 3 +
.../standard/PutDistributedMapCache.java | 252 ++++++
.../nifi/processors/standard/PutEmail.java | 3 +
.../apache/nifi/processors/standard/PutFTP.java | 3 +
.../nifi/processors/standard/PutFile.java | 3 +
.../apache/nifi/processors/standard/PutJMS.java | 7 +-
.../nifi/processors/standard/PutSFTP.java | 3 +
.../apache/nifi/processors/standard/PutSQL.java | 159 ++--
.../nifi/processors/standard/ReplaceText.java | 485 ++++++++---
.../standard/ReplaceTextWithMapping.java | 18 +-
.../processors/standard/RouteOnAttribute.java | 3 +
.../processors/standard/RouteOnContent.java | 19 +-
.../nifi/processors/standard/ScanAttribute.java | 19 +-
.../nifi/processors/standard/ScanContent.java | 5 +-
.../processors/standard/SegmentContent.java | 7 +-
.../nifi/processors/standard/SplitContent.java | 7 +-
.../nifi/processors/standard/SplitJson.java | 32 +-
.../nifi/processors/standard/SplitText.java | 53 +-
.../nifi/processors/standard/SplitXml.java | 18 +-
.../nifi/processors/standard/TransformXml.java | 3 +
.../nifi/processors/standard/UnpackContent.java | 9 +-
.../nifi/processors/standard/ValidateXml.java | 16 +-
.../servlets/ContentAcknowledgmentServlet.java | 3 +-
.../standard/servlets/ListenHTTPServlet.java | 8 +-
.../processors/standard/util/EntityListing.java | 71 ++
.../processors/standard/util/FTPTransfer.java | 145 ++--
.../nifi/processors/standard/util/FileInfo.java | 18 +-
.../processors/standard/util/FileTransfer.java | 337 ++++----
.../processors/standard/util/JdbcCommon.java | 76 +-
.../processors/standard/util/JmsFactory.java | 79 +-
.../processors/standard/util/JmsProperties.java | 8 +
.../standard/util/ListableEntity.java | 40 +
.../util/PermissionDeniedException.java | 32 +
.../processors/standard/util/SFTPTransfer.java | 191 +++--
.../org.apache.nifi.processor.Processor | 4 +
.../standard/TestAbstractListProcessor.java | 221 +++++
.../standard/TestAttributesToJSON.java | 282 +++++++
.../standard/TestConvertCharacterSet.java | 64 +-
.../standard/TestFetchFileTransfer.java | 317 +++++++
.../nifi/processors/standard/TestGetFile.java | 21 +-
.../processors/standard/TestInvokeHTTP.java | 607 +-------------
.../processors/standard/TestInvokeHttpSSL.java | 90 ++
.../standard/TestPutDistributedMapCache.java | 277 +++++++
.../nifi/processors/standard/TestPutSQL.java | 46 +-
.../processors/standard/TestReplaceText.java | 635 +++++++++++++-
.../standard/TestReplaceTextLineByLine.java | 336 --------
.../standard/util/TestInvokeHttpCommon.java | 830 +++++++++++++++++++
.../standard/util/TestJdbcCommon.java | 87 ++
.../standard/util/TestJdbcTypesDerby.java | 133 +++
.../standard/util/TestJdbcTypesH2.java | 149 ++++
.../AppendLineByLineTest.txt | 11 +
.../PrependLineByLineTest.txt | 11 +
.../processors/attributes/UpdateAttribute.java | 9 +-
pom.xml | 2 +-
248 files changed, 10506 insertions(+), 3447 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-api/src/main/java/org/apache/nifi/processor/ProcessSession.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessSession.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
----------------------------------------------------------------------
diff --cc nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
index 20f2642,135025e..701459c
--- 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
@@@ -16,40 -16,11 +16,39 @@@
*/
package org.apache.nifi.controller;
-import com.sun.jersey.api.client.ClientHandlerException;
-import org.apache.commons.lang3.StringUtils;
+import static java.util.Objects.requireNonNull;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import javax.net.ssl.SSLContext;
+
- import org.apache.commons.lang3.StringUtils;
- import org.apache.nifi.admin.service.UserService;
+ import org.apache.nifi.action.Action;
-import org.apache.nifi.admin.service.AuditService;
-import org.apache.nifi.admin.service.UserService;
import org.apache.nifi.annotation.lifecycle.OnAdded;
import org.apache.nifi.annotation.lifecycle.OnRemoved;
import org.apache.nifi.annotation.lifecycle.OnShutdown;
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/BatchingSessionFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e4cebba3/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
----------------------------------------------------------------------
[49/50] [abbrv] nifi git commit: Fixed resource leaks in tests
Posted by tk...@apache.org.
Fixed resource leaks in tests
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/598e32f3
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/598e32f3
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/598e32f3
Branch: refs/heads/NIFI-1073
Commit: 598e32f3dc56ab628ae9d251e1502a788512f9c7
Parents: 1e6c10f
Author: Tony Kurc <tr...@gmail.com>
Authored: Sun Nov 8 22:52:16 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 22:52:16 2015 -0500
----------------------------------------------------------------------
.../stream/io/TestLeakyBucketThrottler.java | 56 ++++++++++----------
1 file changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/598e32f3/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java b/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
index e1d6ce0..ac9bb62 100644
--- a/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
+++ b/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
@@ -55,11 +55,11 @@ public class TestLeakyBucketThrottler {
@Test(timeout = 10000)
public void testInputStreamInterface() throws IOException {
- // throttle rate at 1 MB/sec
- final LeakyBucketStreamThrottler throttler = new LeakyBucketStreamThrottler(1024 * 1024);
final byte[] data = new byte[1024 * 1024 * 4];
- try ( final ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ // throttle rate at 1 MB/sec
+ try ( final LeakyBucketStreamThrottler throttler = new LeakyBucketStreamThrottler(1024 * 1024);
+ final ByteArrayInputStream bais = new ByteArrayInputStream(data);
final InputStream throttledIn = throttler.newThrottledInputStream(bais);
final ByteArrayOutputStream baos = new ByteArrayOutputStream() ){
@@ -80,36 +80,36 @@ public class TestLeakyBucketThrottler {
@Test(timeout = 10000)
public void testDirectInterface() throws IOException, InterruptedException {
// throttle rate at 1 MB/sec
- final LeakyBucketStreamThrottler throttler = new LeakyBucketStreamThrottler(1024 * 1024);
-
- // create 3 threads, each sending ~2 MB
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final List<Thread> threads = new ArrayList<Thread>();
- for (int i = 0; i < 3; i++) {
- final Thread t = new WriterThread(i, throttler, baos);
- threads.add(t);
- }
+ try (final LeakyBucketStreamThrottler throttler = new LeakyBucketStreamThrottler(1024 * 1024);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream(); ){
+ // create 3 threads, each sending ~2 MB
+ final List<Thread> threads = new ArrayList<Thread>();
+ for (int i = 0; i < 3; i++) {
+ final Thread t = new WriterThread(i, throttler, baos);
+ threads.add(t);
+ }
- final long start = System.currentTimeMillis();
- for (final Thread t : threads) {
- t.start();
- }
+ final long start = System.currentTimeMillis();
+ for (final Thread t : threads) {
+ t.start();
+ }
- for (final Thread t : threads) {
- t.join();
- }
- final long elapsed = System.currentTimeMillis() - start;
+ for (final Thread t : threads) {
+ t.join();
+ }
+ final long elapsed = System.currentTimeMillis() - start;
- throttler.close();
+ throttler.close();
- // To send 15 MB, it should have taken at least 5 seconds and no more than 7 seconds, to
- // allow for busy-ness and the fact that we could write a tiny bit more than the limit.
- assertTrue(elapsed > 5000);
- assertTrue(elapsed < 7000);
+ // To send 15 MB, it should have taken at least 5 seconds and no more than 7 seconds, to
+ // allow for busy-ness and the fact that we could write a tiny bit more than the limit.
+ assertTrue(elapsed > 5000);
+ assertTrue(elapsed < 7000);
- // ensure bytes were copied out appropriately
- assertEquals(3 * (2 * 1024 * 1024 + 1), baos.getBufferLength());
- assertEquals((byte) 'A', baos.getUnderlyingBuffer()[baos.getBufferLength() - 1]);
+ // ensure bytes were copied out appropriately
+ assertEquals(3 * (2 * 1024 * 1024 + 1), baos.getBufferLength());
+ assertEquals((byte) 'A', baos.getUnderlyingBuffer()[baos.getBufferLength() - 1]);
+ }
}
private static class WriterThread extends Thread {
[43/50] [abbrv] nifi git commit: NIFI-1106 fixed platform-specific
object separator.
Posted by tk...@apache.org.
NIFI-1106 fixed platform-specific object separator.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/440e4c49
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/440e4c49
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/440e4c49
Branch: refs/heads/NIFI-1073
Commit: 440e4c4940a8eed51f8accdaf599e3d4a4b685e7
Parents: 77de51d
Author: Tony Kurc <tr...@gmail.com>
Authored: Sun Nov 8 12:27:41 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 12:27:41 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/processors/avro/ConvertAvroToJSON.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/440e4c49/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/ConvertAvroToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/ConvertAvroToJSON.java b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/ConvertAvroToJSON.java
index f0f1630..33951d7 100644
--- a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/ConvertAvroToJSON.java
+++ b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/ConvertAvroToJSON.java
@@ -138,7 +138,7 @@ public class ConvertAvroToJSON extends AbstractProcessor {
if (containerOption.equals(CONTAINER_ARRAY)) {
out.write(',');
} else {
- out.write(System.lineSeparator().getBytes(StandardCharsets.UTF_8));
+ out.write('\n');
}
final GenericRecord nextRecord = reader.next(record);
[09/50] [abbrv] nifi git commit: NIFI-869 Fixed formatting issue
Fixed formatting issue with printed error message which only apears when NiFi
is cnfigured using Logback. Please see NIFI-869 for more details
Posted by tk...@apache.org.
NIFI-869 Fixed formatting issue Fixed formatting issue with printed error message which only apears when NiFi is cnfigured using Logback. Please see NIFI-869 for more details
Signed-off-by: Mark Payne <ma...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/90aea013
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/90aea013
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/90aea013
Branch: refs/heads/NIFI-1073
Commit: 90aea0135062c50e2c8635e178188d2d8c35b883
Parents: dc4004d
Author: Oleg Zhurakousky <ol...@suitcase.io>
Authored: Thu Oct 29 14:19:44 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Oct 30 15:52:33 2015 -0400
----------------------------------------------------------------------
.../nifi/controller/scheduling/StandardProcessScheduler.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/90aea013/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
----------------------------------------------------------------------
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 9ff58c8..5d99d07 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
@@ -655,7 +655,7 @@ public final class StandardProcessScheduler implements ProcessScheduler {
final Throwable cause = e instanceof InvocationTargetException ? e.getCause() : e;
final ComponentLog componentLog = new SimpleProcessLogger(service.getIdentifier(), service);
- componentLog.error("Failed to invoke @OnEnabled method due to {}", cause);
+ componentLog.error("failed to invoke @OnEnabled method due to {}", new Object[]{cause.toString()});
LOG.error("Failed to invoke @OnEnabled method of {} due to {}", service.getControllerServiceImplementation(), cause.toString());
if (LOG.isDebugEnabled()) {
LOG.error("", cause);
[44/50] [abbrv] nifi git commit: NIFI-1073 fixed resource leak in
SSLContextFactory
Posted by tk...@apache.org.
NIFI-1073 fixed resource leak in SSLContextFactory
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/47b93d45
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/47b93d45
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/47b93d45
Branch: refs/heads/NIFI-1073
Commit: 47b93d45cb32e3d7655734538e07d02cb924cd24
Parents: 440e4c4
Author: Tony Kurc <tr...@gmail.com>
Authored: Mon Oct 26 19:41:26 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 21:11:33 2015 -0500
----------------------------------------------------------------------
.../org/apache/nifi/io/socket/SSLContextFactory.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/47b93d45/nifi-commons/nifi-socket-utils/src/main/java/org/apache/nifi/io/socket/SSLContextFactory.java
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-socket-utils/src/main/java/org/apache/nifi/io/socket/SSLContextFactory.java b/nifi-commons/nifi-socket-utils/src/main/java/org/apache/nifi/io/socket/SSLContextFactory.java
index 9c6cb82..eeaa299 100644
--- a/nifi-commons/nifi-socket-utils/src/main/java/org/apache/nifi/io/socket/SSLContextFactory.java
+++ b/nifi-commons/nifi-socket-utils/src/main/java/org/apache/nifi/io/socket/SSLContextFactory.java
@@ -34,6 +34,7 @@ import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import org.apache.nifi.util.NiFiProperties;
+import org.apache.nifi.util.file.FileUtils;
public class SSLContextFactory {
@@ -58,13 +59,23 @@ public class SSLContextFactory {
// prepare the keystore
final KeyStore keyStore = KeyStore.getInstance(keystoreType);
- keyStore.load(new FileInputStream(keystore), keystorePass);
+ final FileInputStream keyStoreStream = new FileInputStream(keystore);
+ try{
+ keyStore.load(keyStoreStream, keystorePass);
+ } finally{
+ FileUtils.closeQuietly(keyStoreStream);
+ }
final KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, keystorePass);
// prepare the truststore
final KeyStore trustStore = KeyStore.getInstance(truststoreType);
- trustStore.load(new FileInputStream(truststore), truststorePass);
+ final FileInputStream trustStoreStream = new FileInputStream(truststore);
+ try{
+ trustStore.load(trustStoreStream, truststorePass);
+ } finally{
+ FileUtils.closeQuietly(trustStoreStream);
+ }
final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(trustStore);
[12/50] [abbrv] nifi git commit: NIFI-1080 fleshed out InvokeHttp
unit tests
Posted by tk...@apache.org.
NIFI-1080 fleshed out InvokeHttp unit tests
Signed-off-by: Matt Gilman <ma...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/cef7b6c7
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/cef7b6c7
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/cef7b6c7
Branch: refs/heads/NIFI-1073
Commit: cef7b6c736721858a8bf11b2c03b0a2b0a49b0df
Parents: 9c148da
Author: Joseph Percivall <jo...@yahoo.com>
Authored: Fri Oct 30 14:29:16 2015 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Sat Oct 31 00:19:36 2015 -0400
----------------------------------------------------------------------
.../nifi/processors/standard/InvokeHTTP.java | 21 +-
.../processors/standard/TestInvokeHTTP.java | 617 +-------------
.../processors/standard/TestInvokeHttpSSL.java | 90 ++
.../standard/util/TestInvokeHttpCommon.java | 830 +++++++++++++++++++
4 files changed, 972 insertions(+), 586 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/cef7b6c7/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
index 848652a..d827658 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
@@ -228,7 +228,7 @@ public final class InvokeHTTP extends AbstractProcessor {
public static final PropertyDescriptor PROP_ATTRIBUTES_TO_SEND = new PropertyDescriptor.Builder()
.name("Attributes to Send")
.description("Regular expression that defines which attributes to send as HTTP headers in the request. "
- + "If not defined, no attributes are sent as headers.")
+ + "If not defined, no attributes are sent as headers.")
.required(false)
.addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)
.build();
@@ -301,36 +301,37 @@ public final class InvokeHTTP extends AbstractProcessor {
// this is a "hidden" property - it's configured using a dynamic user property
public static final PropertyDescriptor PROP_TRUSTED_HOSTNAME = new PropertyDescriptor.Builder()
.name("Trusted Hostname")
- .description("Bypass the normal truststore hostname verifier to allow the specified (single) remote hostname as trusted "
- + "Enabling this property has MITM security implications, use wisely. Only valid with SSL (HTTPS) connections.")
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
- .dynamic(true)
+ .description("Bypass the normal truststore hostname verifier to allow the specified remote hostname as trusted. "
+ + "Enabling this property has MITM security implications, use wisely. Will still accept other connections based "
+ + "on the normal truststore hostname verifier. Only valid with SSL (HTTPS) connections.")
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .dynamic(true)
.build();
// relationships
public static final Relationship REL_SUCCESS_REQ = new Relationship.Builder()
.name("Original")
- .description("Original FlowFile will be routed upon success (2xx status codes).")
+ .description("Original FlowFile will be routed upon success (2xx status codes).")
.build();
public static final Relationship REL_SUCCESS_RESP = new Relationship.Builder()
.name("Response")
- .description("Response FlowFile will be routed upon success (2xx status codes).")
+ .description("Response FlowFile will be routed upon success (2xx status codes).")
.build();
public static final Relationship REL_RETRY = new Relationship.Builder()
.name("Retry")
- .description("FlowFile will be routed on any status code that can be retried (5xx status codes).")
+ .description("FlowFile will be routed on any status code that can be retried (5xx status codes).")
.build();
public static final Relationship REL_NO_RETRY = new Relationship.Builder()
.name("No Retry")
- .description("FlowFile will be routed on any status code that should NOT be retried (1xx, 3xx, 4xx status codes).")
+ .description("FlowFile will be routed on any status code that should NOT be retried (1xx, 3xx, 4xx status codes).")
.build();
public static final Relationship REL_FAILURE = new Relationship.Builder()
.name("Failure")
- .description("FlowFile will be routed on any type of connection failure, timeout or general exception.")
+ .description("FlowFile will be routed on any type of connection failure, timeout or general exception.")
.build();
public static final Set<Relationship> RELATIONSHIPS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
http://git-wip-us.apache.org/repos/asf/nifi/blob/cef7b6c7/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHTTP.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHTTP.java
index a4fd3d7..a26b2ed 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHTTP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHTTP.java
@@ -16,51 +16,26 @@
*/
package org.apache.nifi.processors.standard;
-import static org.apache.commons.codec.binary.Base64.encodeBase64;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
import java.io.IOException;
import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.StandardCharsets;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
+import java.net.URL;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.nifi.flowfile.attributes.CoreAttributes;
-import org.apache.nifi.processors.standard.InvokeHTTP.Config;
-import org.apache.nifi.provenance.ProvenanceEventRecord;
-import org.apache.nifi.provenance.ProvenanceEventType;
-import org.apache.nifi.ssl.StandardSSLContextService;
+import org.apache.nifi.processors.standard.util.TestInvokeHttpCommon;
import org.apache.nifi.util.MockFlowFile;
-import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
-import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.junit.After;
import org.junit.AfterClass;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-public class TestInvokeHTTP {
-
- private static Map<String, String> sslProperties;
- private static TestServer server;
- private static String url;
-
- private TestRunner runner;
+public class TestInvokeHTTP extends TestInvokeHttpCommon {
@BeforeClass
public static void beforeClass() throws Exception {
@@ -68,16 +43,12 @@ public class TestInvokeHTTP {
// don't commit this with this property enabled, or any 'mvn test' will be really verbose
// System.setProperty("org.slf4j.simpleLogger.log.nifi.processors.standard", "debug");
- // create the SSL properties, which basically store keystore / trustore information
- // this is used by the StandardSSLContextService and the Jetty Server
- sslProperties = createSslProperties();
-
// create a Jetty server on a random port
server = createServer();
server.startServer();
// this is the base url with the random port
- url = server.getSecureUrl();
+ url = server.getUrl();
}
@AfterClass
@@ -88,10 +59,6 @@ public class TestInvokeHTTP {
@Before
public void before() throws Exception {
runner = TestRunners.newTestRunner(InvokeHTTP.class);
- final StandardSSLContextService sslService = new StandardSSLContextService();
- runner.addControllerService("ssl-context", sslService, sslProperties);
- runner.enableControllerService(sslService);
- runner.setProperty(Config.PROP_SSL_CONTEXT_SERVICE, "ssl-context");
server.clearHandlers();
}
@@ -101,572 +68,70 @@ public class TestInvokeHTTP {
runner.shutdown();
}
- private void addHandler(Handler handler) {
- server.addHandler(handler);
- }
-
- @Test
- public void testDateGeneration() throws Exception {
- final DateHandler dh = new DateHandler();
- addHandler(dh);
-
- runner.setProperty(Config.PROP_URL, url);
- createFlowFiles(runner);
- runner.run();
-
- // extract the date string sent to the server
- // and store it as a java.util.Date
- final SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
- final Date date = sdf.parse(dh.dateString);
-
- // calculate the difference between the date string sent by the client and
- // the current system time -- these should be within a second or two
- // (just enough time to run the test).
- //
- // If the difference is more like in hours, it's likely that a timezone
- // conversion caused a problem.
- final long diff = Math.abs(System.currentTimeMillis() - date.getTime());
- final long threshold = 15000; // 15 seconds
- if (diff > threshold) {
- fail("Difference (" + diff + ") was greater than threshold (" + threshold + ")");
- }
- System.out.println("diff: " + diff);
- }
-
- @Test
- public void test200() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_URL, url + "/status/200");
-
- createFlowFiles(runner);
-
- runner.run();
-
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 1);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 1);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- // expected in request status.code and status.message
- // original flow file (+attributes)??????????
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_REQ).get(0);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- // expected in response
- // status code, status message, all headers from server response --> ff attributes
- // server response message body into payload of ff
- // should not contain any original ff attributes
- final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_RESP).get(0);
- bundle1.assertContentEquals("/status/200".getBytes("UTF-8"));
- bundle1.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle1.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- bundle1.assertAttributeEquals("Foo", "Bar");
- bundle1.assertAttributeEquals("Content-Type", "text/plain; charset=ISO-8859-1");
- final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
- final String expected1 = "/status/200";
- Assert.assertEquals(expected1, actual1);
-
+ private static TestServer createServer() throws IOException {
+ return new TestServer();
}
+ // Currently InvokeHttp does not support Proxy via Https
@Test
- public void test200auth() throws Exception {
- addHandler(new BasicAuthHandler());
+ public void testProxy() throws Exception {
+ addHandler(new MyProxyHandler());
+ URL proxyURL = new URL(url);
- final String username = "basic_user";
- final String password = "basic_password";
-
- runner.setProperty(Config.PROP_URL, url + "/status/200");
- runner.setProperty(Config.PROP_BASIC_AUTH_USERNAME, username);
- runner.setProperty(Config.PROP_BASIC_AUTH_PASSWORD, password);
- final byte[] creds = String.format("%s:%s", username, password).getBytes(StandardCharsets.UTF_8);
- final String expAuth = String.format("Basic %s", new String(encodeBase64(creds)));
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, "http://nifi.apache.org/"); // just a dummy URL no connection goes out
+ runner.setProperty(InvokeHTTP.Config.PROP_PROXY_HOST, proxyURL.getHost());
+ runner.setProperty(InvokeHTTP.Config.PROP_PROXY_PORT, String.valueOf(proxyURL.getPort()));
createFlowFiles(runner);
runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 1);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 1);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- // expected in request status.code and status.message
- // original flow file (+attributes)??????????
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_REQ).get(0);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ //expected in request status.code and status.message
+ //original flow file (+attributes)
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
bundle.assertAttributeEquals("Foo", "Bar");
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- // expected in response
- // status code, status message, all headers from server response --> ff attributes
- // server response message body into payload of ff
- // should not contain any original ff attributes
- final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_RESP).get(0);
- final String bundle1Content = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
- assertTrue(bundle1Content.startsWith(expAuth)); // use startsWith instead of equals so we can ignore line endings
- bundle1.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle1.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
+ //expected in response
+ //status code, status message, all headers from server response --> ff attributes
+ //server response message body into payload of ff
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("http://nifi.apache.org/".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
bundle1.assertAttributeEquals("Foo", "Bar");
bundle1.assertAttributeEquals("Content-Type", "text/plain; charset=ISO-8859-1");
-
- final List<ProvenanceEventRecord> provEvents = runner.getProvenanceEvents();
- assertEquals(2, provEvents.size());
- boolean forkEvent = false;
- boolean fetchEvent = false;
- for (final ProvenanceEventRecord event : provEvents) {
- if (event.getEventType() == ProvenanceEventType.FORK) {
- forkEvent = true;
- } else if (event.getEventType() == ProvenanceEventType.FETCH) {
- fetchEvent = true;
- }
- }
-
- assertTrue(forkEvent);
- assertTrue(fetchEvent);
- }
-
- @Test
- public void test401notauth() throws Exception {
- addHandler(new BasicAuthHandler());
-
- final String username = "basic_user";
- final String password = "basic_password";
-
- runner.setProperty(Config.PROP_URL, url + "/status/401");
- runner.setProperty(Config.PROP_BASIC_AUTH_USERNAME, username);
- runner.setProperty(Config.PROP_BASIC_AUTH_PASSWORD, password);
-
- createFlowFiles(runner);
-
- runner.run();
-
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 1);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- // expected in request status.code and status.message
- // original flow file (+attributes)??????????
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_NO_RETRY).get(0);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "401");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "Unauthorized");
- bundle.assertAttributeEquals("Foo", "Bar");
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
-
- final String response = bundle.getAttribute(Config.RESPONSE_BODY);
- assertEquals(response, "Get off my lawn!");
- }
-
- @Test
- public void test500() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_URL, url + "/status/500");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 1);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- // expected in response
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_RETRY).get(0);
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "500");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "Server Error");
- bundle.assertAttributeEquals(Config.RESPONSE_BODY, "/status/500");
-
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
}
- @Test
- public void test300() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_URL, url + "/status/302");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 1);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
- // getMyFlowFiles();
- // expected in response
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_NO_RETRY).get(0);
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
-
- bundle.assertAttributeEquals(Config.STATUS_CODE, "302");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "Found");
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- }
-
- @Test
- public void test304() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_URL, url + "/status/304");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 1);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
- // getMyFlowFiles();
- // expected in response
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_NO_RETRY).get(0);
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
-
- bundle.assertAttributeEquals(Config.STATUS_CODE, "304");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "Not Modified");
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- }
-
- @Test
- public void test400() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_URL, url + "/status/400");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 1);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
- // getMyFlowFiles();
- // expected in response
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_NO_RETRY).get(0);
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
-
- bundle.assertAttributeEquals(Config.STATUS_CODE, "400");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "Bad Request");
- bundle.assertAttributeEquals(Config.RESPONSE_BODY, "/status/400");
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- }
-
- @Test
- public void test412() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_URL, url + "/status/412");
- runner.setProperty(Config.PROP_METHOD, "GET");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 1);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- // expected in response
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_NO_RETRY).get(0);
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
-
- bundle.assertAttributeEquals(Config.STATUS_CODE, "412");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "Precondition Failed");
- bundle.assertAttributeEquals(Config.RESPONSE_BODY, "/status/412");
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- }
-
- @Test
- public void testHead() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- runner.setProperty(Config.PROP_METHOD, "HEAD");
- runner.setProperty(Config.PROP_URL, url + "/status/200");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 1);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 1);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_REQ).get(0);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_RESP).get(0);
- bundle1.assertContentEquals("".getBytes("UTF-8"));
- bundle1.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle1.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- bundle1.assertAttributeEquals("Foo", "Bar");
- bundle1.assertAttributeEquals("Content-Type", "text/plain");
- final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
- final String expected1 = "";
- Assert.assertEquals(expected1, actual1);
- }
-
- @Test
- public void testPost() throws Exception {
- addHandler(new PostHandler());
-
- runner.setProperty(Config.PROP_METHOD, "POST");
- runner.setProperty(Config.PROP_URL, url + "/post");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 1);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 1);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_REQ).get(0);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_RESP).get(0);
- bundle1.assertContentEquals("".getBytes("UTF-8"));
- bundle1.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle1.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- bundle1.assertAttributeEquals("Foo", "Bar");
- bundle1.assertAttributeNotExists("Content-Type");
-
- final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
- final String expected1 = "";
- Assert.assertEquals(expected1, actual1);
- }
-
- @Test
- public void testPut() throws Exception {
- addHandler(new PostHandler());
-
- runner.setProperty(Config.PROP_METHOD, "PUT");
- runner.setProperty(Config.PROP_URL, url + "/post");
-
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 1);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 1);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 0);
-
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_REQ).get(0);
- bundle.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
-
- final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(Config.REL_SUCCESS_RESP).get(0);
- bundle1.assertContentEquals("".getBytes("UTF-8"));
- bundle1.assertAttributeEquals(Config.STATUS_CODE, "200");
- bundle1.assertAttributeEquals(Config.STATUS_MESSAGE, "OK");
- bundle1.assertAttributeEquals("Foo", "Bar");
- bundle1.assertAttributeNotExists("Content-Type");
-
- final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
- final String expected1 = "";
- Assert.assertEquals(expected1, actual1);
- }
-
- @Test
- public void testConnectFailBadPort() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- // this is the bad urls
- final String badurlport = "https://localhost:" + 445;
-
- runner.setProperty(Config.PROP_URL, badurlport + "/doesnotExist");
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 1);
-
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_FAILURE).get(0);
-
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
- }
-
- @Test
- public void testConnectFailBadHost() throws Exception {
- addHandler(new GetOrHeadHandler());
-
- final String badurlhost = "https://localhOOst:" + 445;
-
- runner.setProperty(Config.PROP_URL, badurlhost + "/doesnotExist");
- createFlowFiles(runner);
-
- runner.run();
- runner.assertTransferCount(Config.REL_SUCCESS_REQ, 0);
- runner.assertTransferCount(Config.REL_SUCCESS_RESP, 0);
- runner.assertTransferCount(Config.REL_RETRY, 0);
- runner.assertTransferCount(Config.REL_NO_RETRY, 0);
- runner.assertTransferCount(Config.REL_FAILURE, 1);
-
- final MockFlowFile bundle = runner.getFlowFilesForRelationship(Config.REL_FAILURE).get(0);
-
- final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
- final String expected = "Hello";
- Assert.assertEquals(expected, actual);
- bundle.assertAttributeEquals("Foo", "Bar");
- }
-
- private static Map<String, String> createSslProperties() {
- final Map<String, String> map = new HashMap<>();
- map.put(StandardSSLContextService.KEYSTORE.getName(), "src/test/resources/localhost-ks.jks");
- map.put(StandardSSLContextService.KEYSTORE_PASSWORD.getName(), "localtest");
- map.put(StandardSSLContextService.KEYSTORE_TYPE.getName(), "JKS");
- map.put(StandardSSLContextService.TRUSTSTORE.getName(), "src/test/resources/localhost-ts.jks");
- map.put(StandardSSLContextService.TRUSTSTORE_PASSWORD.getName(), "localtest");
- map.put(StandardSSLContextService.TRUSTSTORE_TYPE.getName(), "JKS");
- return map;
- }
-
- private static TestServer createServer() throws IOException {
- return new TestServer(sslProperties);
- }
-
- private static void createFlowFiles(final TestRunner testRunner) throws UnsupportedEncodingException {
- final Map<String, String> attributes = new HashMap<>();
- attributes.put(CoreAttributes.MIME_TYPE.key(), "application/plain-text");
- attributes.put("Foo", "Bar");
- testRunner.enqueue("Hello".getBytes("UTF-8"), attributes);
-
- }
-
- private static class PostHandler extends AbstractHandler {
-
- @Override
- public void handle(String target, Request baseRequest,
- HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
-
- baseRequest.setHandled(true);
-
- assertEquals("/post", target);
-
- final String body = request.getReader().readLine();
- assertEquals("Hello", body);
-
- }
- }
-
- private static class GetOrHeadHandler extends AbstractHandler {
+ public static class MyProxyHandler extends AbstractHandler {
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
baseRequest.setHandled(true);
- final int status = Integer.valueOf(target.substring("/status".length() + 1));
- response.setStatus(status);
-
- response.setContentType("text/plain");
- response.setContentLength(target.length());
+ if ("Get".equalsIgnoreCase(request.getMethod())) {
+ response.setStatus(200);
+ String proxyPath = baseRequest.getUri().toString();
+ response.setContentLength(proxyPath.length());
+ response.setContentType("text/plain");
- if ("GET".equalsIgnoreCase(request.getMethod())) {
try (PrintWriter writer = response.getWriter()) {
- writer.print(target);
+ writer.print(proxyPath);
writer.flush();
}
- }
-
- }
-
- }
-
- private static class DateHandler extends AbstractHandler {
-
- private String dateString;
-
- @Override
- public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
- baseRequest.setHandled(true);
-
- dateString = request.getHeader("Date");
-
- response.setStatus(200);
- response.setContentType("text/plain");
- response.getWriter().println("Way to go!");
- }
- }
-
- private static class BasicAuthHandler extends AbstractHandler {
-
- private String authString;
-
- @Override
- public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
- baseRequest.setHandled(true);
-
- authString = request.getHeader("Authorization");
-
- final int status = Integer.valueOf(target.substring("/status".length() + 1));
-
- if (status == 200) {
- response.setStatus(status);
- response.setContentType("text/plain");
- response.getWriter().println(authString);
} else {
- response.setStatus(status);
+ response.setStatus(404);
response.setContentType("text/plain");
- response.getWriter().println("Get off my lawn!");
+ response.setContentLength(0);
}
}
}
-
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/cef7b6c7/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHttpSSL.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHttpSSL.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHttpSSL.java
new file mode 100644
index 0000000..d155b74
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestInvokeHttpSSL.java
@@ -0,0 +1,90 @@
+/*
+ * 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 org.apache.nifi.processors.standard.InvokeHTTP.Config;
+import org.apache.nifi.processors.standard.util.TestInvokeHttpCommon;
+import org.apache.nifi.ssl.StandardSSLContextService;
+import org.apache.nifi.util.TestRunners;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class TestInvokeHttpSSL extends TestInvokeHttpCommon {
+
+ private static Map<String, String> sslProperties;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ // useful for verbose logging output
+ // don't commit this with this property enabled, or any 'mvn test' will be really verbose
+ // System.setProperty("org.slf4j.simpleLogger.log.nifi.processors.standard", "debug");
+
+ // create the SSL properties, which basically store keystore / trustore information
+ // this is used by the StandardSSLContextService and the Jetty Server
+ sslProperties = createSslProperties();
+
+ // create a Jetty server on a random port
+ server = createServer();
+ server.startServer();
+
+ // this is the base url with the random port
+ url = server.getSecureUrl();
+ }
+
+ @AfterClass
+ public static void afterClass() throws Exception {
+ server.shutdownServer();
+ }
+
+ @Before
+ public void before() throws Exception {
+ runner = TestRunners.newTestRunner(InvokeHTTP.class);
+ final StandardSSLContextService sslService = new StandardSSLContextService();
+ runner.addControllerService("ssl-context", sslService, sslProperties);
+ runner.enableControllerService(sslService);
+ runner.setProperty(Config.PROP_SSL_CONTEXT_SERVICE, "ssl-context");
+
+ server.clearHandlers();
+ }
+
+ @After
+ public void after() {
+ runner.shutdown();
+ }
+
+ private static TestServer createServer() throws IOException {
+ return new TestServer(sslProperties);
+ }
+
+ private static Map<String, String> createSslProperties() {
+ final Map<String, String> map = new HashMap<>();
+ map.put(StandardSSLContextService.KEYSTORE.getName(), "src/test/resources/localhost-ks.jks");
+ map.put(StandardSSLContextService.KEYSTORE_PASSWORD.getName(), "localtest");
+ map.put(StandardSSLContextService.KEYSTORE_TYPE.getName(), "JKS");
+ map.put(StandardSSLContextService.TRUSTSTORE.getName(), "src/test/resources/localhost-ts.jks");
+ map.put(StandardSSLContextService.TRUSTSTORE_PASSWORD.getName(), "localtest");
+ map.put(StandardSSLContextService.TRUSTSTORE_TYPE.getName(), "JKS");
+ return map;
+ }
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/cef7b6c7/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java
new file mode 100644
index 0000000..88dfcdb
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java
@@ -0,0 +1,830 @@
+/*
+ * 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.util;
+
+import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.processors.standard.InvokeHTTP;
+import org.apache.nifi.processors.standard.TestServer;
+import org.apache.nifi.provenance.ProvenanceEventRecord;
+import org.apache.nifi.provenance.ProvenanceEventType;
+import org.apache.nifi.util.MockFlowFile;
+import org.apache.nifi.util.TestRunner;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.handler.AbstractHandler;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.apache.commons.codec.binary.Base64.encodeBase64;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public abstract class TestInvokeHttpCommon {
+
+ public static TestServer server;
+ public static String url;
+
+ public TestRunner runner;
+
+
+ public void addHandler(Handler handler) {
+ server.addHandler(handler);
+ }
+
+ @Test
+ public void testDateGeneration() throws Exception {
+
+ final DateHandler dh = new DateHandler();
+ addHandler(dh);
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url);
+ createFlowFiles(runner);
+ runner.run();
+
+ // extract the date string sent to the server
+ // and store it as a java.util.Date
+ final SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
+ final Date date = sdf.parse(dh.dateString);
+
+ // calculate the difference between the date string sent by the client and
+ // the current system time -- these should be within a second or two
+ // (just enough time to run the test).
+ //
+ // If the difference is more like in hours, it's likely that a timezone
+ // conversion caused a problem.
+ final long diff = Math.abs(System.currentTimeMillis() - date.getTime());
+ final long threshold = 15000; // 15 seconds
+ if (diff > threshold) {
+ fail("Difference (" + diff + ") was greater than threshold (" + threshold + ")");
+ }
+ System.out.println("diff: " + diff);
+ }
+
+ @Test
+ public void test200() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+
+ createFlowFiles(runner);
+
+ runner.run();
+
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ // expected in request status.code and status.message
+ // original flow file (+attributes)
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ // expected in response
+ // status code, status message, all headers from server response --> ff attributes
+ // server response message body into payload of ff
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("/status/200".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ bundle1.assertAttributeEquals("Content-Type", "text/plain; charset=ISO-8859-1");
+ }
+
+ @Test
+ public void test200Auth() throws Exception {
+ addHandler(new BasicAuthHandler());
+
+ final String username = "basic_user";
+ final String password = "basic_password";
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+ runner.setProperty(InvokeHTTP.Config.PROP_BASIC_AUTH_USERNAME, username);
+ runner.setProperty(InvokeHTTP.Config.PROP_BASIC_AUTH_PASSWORD, password);
+ final byte[] creds = String.format("%s:%s", username, password).getBytes(StandardCharsets.UTF_8);
+ final String expAuth = String.format("Basic %s", new String(encodeBase64(creds)));
+
+ createFlowFiles(runner);
+
+ runner.run();
+
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ // expected in request status.code and status.message
+ // original flow file (+attributes)
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ // expected in response
+ // status code, status message, all headers from server response --> ff attributes
+ // server response message body into payload of ff
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ final String bundle1Content = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
+ assertTrue(bundle1Content.startsWith(expAuth)); // use startsWith instead of equals so we can ignore line endings
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ bundle1.assertAttributeEquals("Content-Type", "text/plain; charset=ISO-8859-1");
+
+ final List<ProvenanceEventRecord> provEvents = runner.getProvenanceEvents();
+ assertEquals(2, provEvents.size());
+ boolean forkEvent = false;
+ boolean fetchEvent = false;
+ for (final ProvenanceEventRecord event : provEvents) {
+ if (event.getEventType() == ProvenanceEventType.FORK) {
+ forkEvent = true;
+ } else if (event.getEventType() == ProvenanceEventType.FETCH) {
+ fetchEvent = true;
+ }
+ }
+
+ assertTrue(forkEvent);
+ assertTrue(fetchEvent);
+ }
+
+ @Test
+ public void test401NotAuth() throws Exception {
+ addHandler(new BasicAuthHandler());
+
+ final String username = "basic_user";
+ final String password = "basic_password";
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/401");
+ runner.setProperty(InvokeHTTP.Config.PROP_BASIC_AUTH_USERNAME, username);
+ runner.setProperty(InvokeHTTP.Config.PROP_BASIC_AUTH_PASSWORD, password);
+
+ createFlowFiles(runner);
+
+ runner.run();
+
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ // expected in request status.code and status.message
+ // original flow file (+attributes)
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_NO_RETRY).get(0);
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "401");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "Unauthorized");
+ bundle.assertAttributeEquals("Foo", "Bar");
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+
+ final String response = bundle.getAttribute(InvokeHTTP.Config.RESPONSE_BODY);
+ assertEquals(response, "Get off my lawn!");
+ }
+
+ @Test
+ public void test500() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/500");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ // expected in response
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_RETRY).get(0);
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "500");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "Server Error");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.RESPONSE_BODY, "/status/500");
+
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ }
+
+ @Test
+ public void test300() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/302");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+ // getMyFlowFiles();
+ // expected in response
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_NO_RETRY).get(0);
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "302");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "Found");
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ }
+
+ @Test
+ public void test304() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/304");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+ // getMyFlowFiles();
+ // expected in response
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_NO_RETRY).get(0);
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "304");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "Not Modified");
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ }
+
+ @Test
+ public void test400() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/400");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+ // getMyFlowFiles();
+ // expected in response
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_NO_RETRY).get(0);
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "400");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "Bad Request");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.RESPONSE_BODY, "/status/400");
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ }
+
+ @Test
+ public void test412() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/412");
+ runner.setProperty(InvokeHTTP.Config.PROP_METHOD, "GET");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ // expected in response
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_NO_RETRY).get(0);
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "412");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "Precondition Failed");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.RESPONSE_BODY, "/status/412");
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ }
+
+ @Test
+ public void testHead() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_METHOD, "HEAD");
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ bundle1.assertAttributeEquals("Content-Type", "text/plain");
+ final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
+ final String expected1 = "";
+ Assert.assertEquals(expected1, actual1);
+ }
+
+ @Test
+ public void testPost() throws Exception {
+ addHandler(new PostHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_METHOD, "POST");
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/post");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ bundle1.assertAttributeNotExists("Content-Type");
+
+ final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
+ final String expected1 = "";
+ Assert.assertEquals(expected1, actual1);
+ }
+
+ @Test
+ public void testPut() throws Exception {
+ addHandler(new PostHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_METHOD, "PUT");
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/post");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ bundle1.assertAttributeNotExists("Content-Type");
+
+ final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
+ final String expected1 = "";
+ Assert.assertEquals(expected1, actual1);
+ }
+
+ @Test
+ public void testDelete() throws Exception {
+ addHandler(new DeleteHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_METHOD, "DELETE");
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ final String actual1 = new String(bundle1.toByteArray(), StandardCharsets.UTF_8);
+ final String expected1 = "";
+ Assert.assertEquals(expected1, actual1);
+ }
+
+ @Test
+ public void testOptions() throws Exception {
+ addHandler(new OptionsHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_METHOD, "OPTIONS");
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("/status/200".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ }
+
+ @Test
+ public void testSendAttributes() throws Exception {
+ addHandler(new AttributesSentHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+ runner.setProperty(InvokeHTTP.Config.PROP_ATTRIBUTES_TO_SEND, "Foo");
+
+ createFlowFiles(runner);
+
+ runner.run();
+
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 1);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 0);
+
+ //expected in request status.code and status.message
+ //original flow file (+attributes)
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_REQ).get(0);
+ bundle.assertContentEquals("Hello".getBytes("UTF-8"));
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle.assertAttributeEquals("Foo", "Bar");
+
+ //expected in response
+ //status code, status message, all headers from server response --> ff attributes
+ //server response message body into payload of ff
+ final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_SUCCESS_RESP).get(0);
+ bundle1.assertContentEquals("Bar".getBytes("UTF-8"));
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_CODE, "200");
+ bundle1.assertAttributeEquals(InvokeHTTP.Config.STATUS_MESSAGE, "OK");
+ bundle1.assertAttributeEquals("Foo", "Bar");
+ bundle1.assertAttributeEquals("Content-Type", "text/plain; charset=ISO-8859-1");
+ }
+
+ @Test
+ public void testReadTimeout() throws Exception {
+ addHandler(new ReadTimeoutHandler());
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, url + "/status/200");
+ runner.setProperty(InvokeHTTP.Config.PROP_READ_TIMEOUT, "5 secs");
+
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 1);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_FAILURE).get(0);
+
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+ }
+
+ @Test
+ public void testConnectFailBadPort() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ // this is the bad urls
+ final String badurlport = "http://localhost:" + 445;
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, badurlport + "/doesnotExist");
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 1);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_FAILURE).get(0);
+
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+ }
+
+ @Test
+ public void testConnectFailBadHost() throws Exception {
+ addHandler(new GetOrHeadHandler());
+
+ final String badurlhost = "http://localhOOst:" + 445;
+
+ runner.setProperty(InvokeHTTP.Config.PROP_URL, badurlhost + "/doesnotExist");
+ createFlowFiles(runner);
+
+ runner.run();
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_REQ, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_SUCCESS_RESP, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_NO_RETRY, 0);
+ runner.assertTransferCount(InvokeHTTP.Config.REL_FAILURE, 1);
+
+ final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.Config.REL_FAILURE).get(0);
+
+ final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
+ final String expected = "Hello";
+ Assert.assertEquals(expected, actual);
+ bundle.assertAttributeEquals("Foo", "Bar");
+ }
+
+
+ public static void createFlowFiles(final TestRunner testRunner) throws UnsupportedEncodingException {
+ final Map<String, String> attributes = new HashMap<>();
+ attributes.put(CoreAttributes.MIME_TYPE.key(), "application/plain-text");
+ attributes.put("Foo", "Bar");
+ testRunner.enqueue("Hello".getBytes("UTF-8"), attributes);
+
+ }
+
+
+ private static class DateHandler extends AbstractHandler {
+
+ private String dateString;
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ dateString = request.getHeader("Date");
+
+ response.setStatus(200);
+ response.setContentType("text/plain");
+ response.getWriter().println("Way to go!");
+ }
+ }
+
+ private static class PostHandler extends AbstractHandler {
+
+ @Override
+ public void handle(String target, Request baseRequest,
+ HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException {
+
+ baseRequest.setHandled(true);
+
+ assertEquals("/post", target);
+
+ final String body = request.getReader().readLine();
+ assertEquals("Hello", body);
+
+ }
+ }
+
+ private static class GetOrHeadHandler extends AbstractHandler {
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ final int status = Integer.valueOf(target.substring("/status".length() + 1));
+ response.setStatus(status);
+
+ response.setContentType("text/plain");
+ response.setContentLength(target.length());
+
+ if ("GET".equalsIgnoreCase(request.getMethod())) {
+ try (PrintWriter writer = response.getWriter()) {
+ writer.print(target);
+ writer.flush();
+ }
+ }
+
+ }
+ }
+
+ private static class DeleteHandler extends AbstractHandler {
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ if ("DELETE".equalsIgnoreCase(request.getMethod())) {
+ final int status = Integer.valueOf(target.substring("/status".length() + 1));
+ response.setStatus(status);
+ response.setContentLength(0);
+ } else {
+ response.setStatus(404);
+ response.setContentType("text/plain");
+ response.setContentLength(0);
+ }
+ }
+ }
+
+ private static class OptionsHandler extends AbstractHandler {
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
+ final int status = Integer.valueOf(target.substring("/status".length() + 1));
+ response.setStatus(status);
+ response.setContentLength(target.length());
+ response.setContentType("text/plain");
+
+ try (PrintWriter writer = response.getWriter()) {
+ writer.print(target);
+ writer.flush();
+ }
+ } else {
+ response.setStatus(404);
+ response.setContentType("text/plain");
+ response.setContentLength(target.length());
+ }
+ }
+ }
+
+ private static class AttributesSentHandler extends AbstractHandler {
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ if ("Get".equalsIgnoreCase(request.getMethod())) {
+ String headerValue = request.getHeader("Foo");
+ final int status = Integer.valueOf(target.substring("/status".length() + 1));
+ response.setStatus(status);
+ response.setContentLength(headerValue.length());
+ response.setContentType("text/plain");
+
+
+ try (PrintWriter writer = response.getWriter()) {
+ writer.print(headerValue);
+ writer.flush();
+ }
+ } else {
+ response.setStatus(404);
+ response.setContentType("text/plain");
+ response.setContentLength(0);
+ }
+ }
+ }
+
+ private static class ReadTimeoutHandler extends AbstractHandler {
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ if ("Get".equalsIgnoreCase(request.getMethod())) {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ return;
+ }
+ String headerValue = request.getHeader("Foo");
+ headerValue = headerValue == null ? "" : headerValue;
+ final int status = Integer.valueOf(target.substring("/status".length() + 1));
+ response.setStatus(status);
+ response.setContentLength(headerValue.length());
+ response.setContentType("text/plain");
+
+ try (PrintWriter writer = response.getWriter()) {
+ writer.print(headerValue);
+ writer.flush();
+ }
+ } else {
+ response.setStatus(404);
+ response.setContentType("text/plain");
+ response.setContentLength(0);
+ }
+ }
+ }
+
+
+
+ private static class BasicAuthHandler extends AbstractHandler {
+
+ private String authString;
+
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ baseRequest.setHandled(true);
+
+ authString = request.getHeader("Authorization");
+
+ if (authString == null) {
+ response.setStatus(401);
+ response.setHeader("WWW-Authenticate", "Basic realm=\"Jetty\"");
+ response.setHeader("response.phrase", "Unauthorized");
+ response.setContentType("text/plain");
+ response.getWriter().println("Get off my lawn!");
+ return;
+ }
+
+ final int status = Integer.valueOf(target.substring("/status".length() + 1));
+
+ if (status == 200) {
+ response.setStatus(status);
+ response.setContentType("text/plain");
+ response.getWriter().println(authString);
+ } else {
+ response.setStatus(status);
+ response.setContentType("text/plain");
+ response.getWriter().println("Get off my lawn!");
+ }
+ }
+ }
+
+}
[02/50] [abbrv] nifi git commit: NIFI-1088: Ensure that FlowFile is
penalized before routing to failure
Posted by tk...@apache.org.
NIFI-1088: Ensure that FlowFile is penalized before routing to failure
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/9515b746
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/9515b746
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/9515b746
Branch: refs/heads/NIFI-1073
Commit: 9515b7460713ba985a6d7c8ad033fe2c1ac98e3d
Parents: dc4004d
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Oct 30 14:25:27 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Oct 30 14:25:27 2015 -0400
----------------------------------------------------------------------
.../main/java/org/apache/nifi/processors/kafka/PutKafka.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/9515b746/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java
index cff285c..09025a4 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java
@@ -401,7 +401,7 @@ public class PutKafka extends AbstractProcessor {
getLogger().info("Successfully sent {} to Kafka in {} millis", new Object[] { flowFile, TimeUnit.NANOSECONDS.toMillis(nanos) });
} catch (final Exception e) {
getLogger().error("Failed to send {} to Kafka due to {}; routing to failure", new Object[] { flowFile, e });
- session.transfer(flowFile, REL_FAILURE);
+ session.transfer(session.penalize(flowFile), REL_FAILURE);
error = true;
} finally {
if (error) {
@@ -534,7 +534,7 @@ public class PutKafka extends AbstractProcessor {
if (offset == 0L) {
// all of the messages failed to send. Route FlowFile to failure
getLogger().error("Failed to send {} to Kafka due to {}; routing to fialure", new Object[] { flowFile, pe.getCause() });
- session.transfer(flowFile, REL_FAILURE);
+ session.transfer(session.penalize(flowFile), REL_FAILURE);
} else {
// Some of the messages were sent successfully. We want to split off the successful messages from the failed messages.
final FlowFile successfulMessages = session.clone(flowFile, 0L, offset);
@@ -545,7 +545,7 @@ public class PutKafka extends AbstractProcessor {
messagesSent.get(), flowFile, successfulMessages, failedMessages, pe.getCause() });
session.transfer(successfulMessages, REL_SUCCESS);
- session.transfer(failedMessages, REL_FAILURE);
+ session.transfer(session.penalize(failedMessages), REL_FAILURE);
session.remove(flowFile);
session.getProvenanceReporter().send(successfulMessages, "kafka://" + topic);
}
[19/50] [abbrv] nifi git commit: NIFI-883 Fixing issue
HandleHttpRequest had with PrimaryNodeOnly scheduling
Posted by tk...@apache.org.
NIFI-883 Fixing issue HandleHttpRequest had with PrimaryNodeOnly scheduling
Signed-off-by: Mark Payne <ma...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/2ae49026
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/2ae49026
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/2ae49026
Branch: refs/heads/NIFI-1073
Commit: 2ae49026e898ef9ea154990f4d3a5da3ee8d8129
Parents: 37e2f17
Author: Joseph Percivall <jo...@yahoo.com>
Authored: Mon Nov 2 10:17:32 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 10:32:14 2015 -0500
----------------------------------------------------------------------
.../processors/standard/HandleHttpRequest.java | 23 +++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/2ae49026/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
index 49bad40..1be8dd9 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
@@ -34,6 +34,7 @@ import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Pattern;
import javax.security.cert.X509Certificate;
@@ -226,6 +227,7 @@ public class HandleHttpRequest extends AbstractProcessor {
.build();
private volatile Server server;
+ private AtomicBoolean initialized = new AtomicBoolean(false);
private final BlockingQueue<HttpRequestContainer> containerQueue = new LinkedBlockingQueue<>(50);
@Override
@@ -255,7 +257,15 @@ public class HandleHttpRequest extends AbstractProcessor {
}
@OnScheduled
- public void initializeServer(final ProcessContext context) throws Exception {
+ public void clearInit(){
+ initialized.set(false);
+ }
+
+ private synchronized void initializeServer(final ProcessContext context) throws Exception {
+ if(initialized.get()){
+ return;
+ }
+
final String host = context.getProperty(HOSTNAME).getValue();
final int port = context.getProperty(PORT).asInteger();
final SSLContextService sslService = context.getProperty(SSL_CONTEXT).asControllerService(SSLContextService.class);
@@ -402,6 +412,8 @@ public class HandleHttpRequest extends AbstractProcessor {
server.start();
getLogger().info("Server started and listening on port " + getPort());
+
+ initialized.set(true);
}
protected int getPort() {
@@ -452,6 +464,15 @@ public class HandleHttpRequest extends AbstractProcessor {
@Override
public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
+ try {
+ if(!initialized.get()) {
+ initializeServer(context);
+ }
+ } catch (Exception e) {
+ context.yield();
+ throw new ProcessException("Failed to initialize the server",e);
+ }
+
final HttpRequestContainer container = containerQueue.poll();
if (container == null) {
return;
[38/50] [abbrv] nifi git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/nifi
Posted by tk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/nifi
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/0d6e81b5
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/0d6e81b5
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/0d6e81b5
Branch: refs/heads/NIFI-1073
Commit: 0d6e81b54f13575cb960ca65eafcd20cf19db85c
Parents: 1a388f9 ee87f33
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Nov 6 09:16:12 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Nov 6 09:16:12 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/controller/StandardFlowFileQueue.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[33/50] [abbrv] nifi git commit: NIFI-1112 Fixed APIOperation
Annotation on ReportingTaskResource.
Posted by tk...@apache.org.
NIFI-1112 Fixed APIOperation Annotation on ReportingTaskResource.
Reviewed by Tony Kurc (tkurc@apache.org)
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f1bd3d47
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f1bd3d47
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f1bd3d47
Branch: refs/heads/NIFI-1073
Commit: f1bd3d471de6b84cd2d0eee66233ce8b522e6a5a
Parents: 618f22e
Author: Andrew Grande <ap...@gmail.com>
Authored: Wed Nov 4 18:31:24 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Wed Nov 4 18:31:34 2015 -0500
----------------------------------------------------------------------
.../main/java/org/apache/nifi/web/api/ReportingTaskResource.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/f1bd3d47/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
index c783da6..1638d8c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
@@ -273,7 +273,7 @@ public class ReportingTaskResource extends ApplicationResource {
@Path("/{availability}")
@PreAuthorize("hasRole('ROLE_DFM')")
@ApiOperation(
- value = "Creates a new remote process group",
+ value = "Creates a new reporting task",
response = ReportingTaskEntity.class,
authorizations = {
@Authorization(value = "Data Flow Manager", type = "ROLE_DFM")
[26/50] [abbrv] nifi git commit: NIFI-1105: Only trigger a processor
that requires input to run if data is available for it process
Posted by tk...@apache.org.
NIFI-1105: Only trigger a processor that requires input to run if data is available for it process
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/2b1d0931
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/2b1d0931
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/2b1d0931
Branch: refs/heads/NIFI-1073
Commit: 2b1d093120fe3f70594909b97f2658828a09044e
Parents: dbf0c78
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Nov 4 08:41:10 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Wed Nov 4 08:41:10 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/controller/queue/FlowFileQueue.java | 7 +++----
.../org/apache/nifi/controller/StandardFlowFileQueue.java | 3 ++-
.../src/main/java/org/apache/nifi/util/Connectables.java | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/2b1d0931/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java b/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
index dcf7f13..727c755 100644
--- a/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
+++ b/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
@@ -100,10 +100,9 @@ public interface FlowFileQueue {
boolean isEmpty();
/**
- * @return true if the active queue is empty; false otherwise. The Active
- * queue contains those FlowFiles that can be processed immediately and does
- * not include those FlowFiles that have been swapped out or are currently
- * being processed
+ * @return <code>true</code> if the queue is empty or contains only FlowFiles that already are being processed
+ * by others, <code>false</code> if the queue contains at least one FlowFile that is available for processing,
+ * regardless of whether that FlowFile(s) is in-memory or swapped out.
*/
boolean isActiveQueueEmpty();
http://git-wip-us.apache.org/repos/asf/nifi/blob/2b1d0931/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
----------------------------------------------------------------------
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 6b6bb57..3986ca8 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
@@ -210,7 +210,8 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
@Override
public boolean isActiveQueueEmpty() {
- return size.get().activeQueueCount == 0;
+ final FlowFileQueueSize queueSize = size.get();
+ return queueSize.activeQueueCount == 0 && queueSize.swappedCount == 0;
}
public QueueSize getActiveQueueSize() {
http://git-wip-us.apache.org/repos/asf/nifi/blob/2b1d0931/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
index 3c4fcdb..c4d040b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
@@ -26,7 +26,7 @@ public class Connectables {
public static boolean flowFilesQueued(final Connectable connectable) {
for (final Connection conn : connectable.getIncomingConnections()) {
- if (!conn.getFlowFileQueue().isEmpty()) {
+ if (!conn.getFlowFileQueue().isActiveQueueEmpty()) {
return true;
}
}
[23/50] [abbrv] nifi git commit: NIFI-1077 enabling expression
language on ConvertCharacterSet input and output
Posted by tk...@apache.org.
NIFI-1077 enabling expression language on ConvertCharacterSet input and output
Signed-off-by: Mark Payne <ma...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a5496212
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a5496212
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a5496212
Branch: refs/heads/NIFI-1073
Commit: a549621267c6517c4774579c3d95f0d7a0c1f68b
Parents: 814e8b2
Author: Joseph Percivall <jo...@yahoo.com>
Authored: Mon Nov 2 11:30:06 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 11:46:17 2015 -0500
----------------------------------------------------------------------
.../nifi/processor/util/StandardValidators.java | 10 +++
.../standard/ConvertCharacterSet.java | 19 +++---
.../standard/TestConvertCharacterSet.java | 64 +++++++++++++++++++-
3 files changed, 84 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/a5496212/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/StandardValidators.java
----------------------------------------------------------------------
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 7777438..8255781 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
@@ -209,6 +209,16 @@ public class StandardValidators {
@Override
public ValidationResult validate(final String subject, final String value, final ValidationContext context) {
if (context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(value)) {
+ final ResultType resultType = context.newExpressionLanguageCompiler().getResultType(value);
+ if (!resultType.equals(ResultType.STRING)) {
+ return new ValidationResult.Builder()
+ .subject(subject)
+ .input(value)
+ .valid(false)
+ .explanation("Expected Attribute Query to return type " + ResultType.STRING + " but query returns type " + resultType)
+ .build();
+ }
+
return new ValidationResult.Builder().subject(subject).input(value).explanation("Expression Language Present").valid(true).build();
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/a5496212/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java
index 7a99a59..53c1954 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java
@@ -23,6 +23,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
+
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessorInitializationContext;
@@ -87,12 +88,14 @@ public class ConvertCharacterSet extends AbstractProcessor {
public static final PropertyDescriptor INPUT_CHARSET = new PropertyDescriptor.Builder()
.name("Input Character Set")
.description("The name of the CharacterSet to expect for Input")
+ .expressionLanguageSupported(true)
.addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
.required(true)
.build();
public static final PropertyDescriptor OUTPUT_CHARSET = new PropertyDescriptor.Builder()
.name("Output Character Set")
.description("The name of the CharacterSet to convert to")
+ .expressionLanguageSupported(true)
.addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
.required(true)
.build();
@@ -128,10 +131,15 @@ public class ConvertCharacterSet extends AbstractProcessor {
@Override
public void onTrigger(final ProcessContext context, final ProcessSession session) {
+ FlowFile flowFile = session.get();
+ if (flowFile == null) {
+ return;
+ }
+
final ProcessorLog logger = getLogger();
- final Charset inputCharset = Charset.forName(context.getProperty(INPUT_CHARSET).getValue());
- final Charset outputCharset = Charset.forName(context.getProperty(OUTPUT_CHARSET).getValue());
+ final Charset inputCharset = Charset.forName(context.getProperty(INPUT_CHARSET).evaluateAttributeExpressions(flowFile).getValue());
+ final Charset outputCharset = Charset.forName(context.getProperty(OUTPUT_CHARSET).evaluateAttributeExpressions(flowFile).getValue());
final CharBuffer charBuffer = CharBuffer.allocate(MAX_BUFFER_SIZE);
final CharsetDecoder decoder = inputCharset.newDecoder();
@@ -144,11 +152,6 @@ public class ConvertCharacterSet extends AbstractProcessor {
encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
encoder.replaceWith("?".getBytes(outputCharset));
- FlowFile flowFile = session.get();
- if (flowFile == null) {
- return;
- }
-
try {
final StopWatch stopWatch = new StopWatch(true);
flowFile = session.write(flowFile, new StreamCallback() {
@@ -169,7 +172,7 @@ public class ConvertCharacterSet extends AbstractProcessor {
session.getProvenanceReporter().modifyContent(flowFile, stopWatch.getElapsed(TimeUnit.MILLISECONDS));
logger.info("successfully converted characters from {} to {} for {}",
- new Object[]{context.getProperty(INPUT_CHARSET).getValue(), context.getProperty(OUTPUT_CHARSET).getValue(), flowFile});
+ new Object[]{inputCharset, outputCharset, flowFile});
session.transfer(flowFile, REL_SUCCESS);
} catch (final Exception e) {
throw new ProcessException(e);
http://git-wip-us.apache.org/repos/asf/nifi/blob/a5496212/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertCharacterSet.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertCharacterSet.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertCharacterSet.java
index 1b057d9..fea0a4e 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertCharacterSet.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertCharacterSet.java
@@ -19,16 +19,20 @@ package org.apache.nifi.processors.standard;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
import org.apache.nifi.util.MockFlowFile;
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
import org.junit.Test;
+import static junit.framework.TestCase.fail;
+
public class TestConvertCharacterSet {
@Test
- public void test() throws IOException {
+ public void testSimple() throws IOException {
final TestRunner runner = TestRunners.newTestRunner(new ConvertCharacterSet());
runner.setProperty(ConvertCharacterSet.INPUT_CHARSET, "ASCII");
runner.setProperty(ConvertCharacterSet.OUTPUT_CHARSET, "UTF-32");
@@ -41,4 +45,62 @@ public class TestConvertCharacterSet {
output.assertContentEquals(new File("src/test/resources/CharacterSetConversionSamples/Converted2.txt"));
}
+ @Test
+ public void testExpressionLanguageInput() throws IOException {
+ final TestRunner runner = TestRunners.newTestRunner(new ConvertCharacterSet());
+ runner.setProperty(ConvertCharacterSet.INPUT_CHARSET, "${characterSet}");
+ runner.setProperty(ConvertCharacterSet.OUTPUT_CHARSET, "UTF-32");
+
+ final Map<String, String> attributes = new HashMap<>();
+ attributes.put("characterSet", "ASCII");
+ runner.enqueue(Paths.get("src/test/resources/CharacterSetConversionSamples/Original.txt"),attributes);
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(ConvertCharacterSet.REL_SUCCESS, 1);
+ final MockFlowFile output = runner.getFlowFilesForRelationship(ConvertCharacterSet.REL_SUCCESS).get(0);
+ output.assertContentEquals(new File("src/test/resources/CharacterSetConversionSamples/Converted2.txt"));
+ }
+
+ @Test
+ public void testExpressionLanguageOutput() throws IOException {
+ final TestRunner runner = TestRunners.newTestRunner(new ConvertCharacterSet());
+ runner.setProperty(ConvertCharacterSet.INPUT_CHARSET, "ASCII");
+ runner.setProperty(ConvertCharacterSet.OUTPUT_CHARSET, "${characterSet}");
+
+ final Map<String, String> attributes = new HashMap<>();
+ attributes.put("characterSet", "UTF-32");
+ runner.enqueue(Paths.get("src/test/resources/CharacterSetConversionSamples/Original.txt"),attributes);
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(ConvertCharacterSet.REL_SUCCESS, 1);
+ final MockFlowFile output = runner.getFlowFilesForRelationship(ConvertCharacterSet.REL_SUCCESS).get(0);
+ output.assertContentEquals(new File("src/test/resources/CharacterSetConversionSamples/Converted2.txt"));
+ }
+
+ @Test
+ public void testExpressionLanguageConfig() throws IOException {
+ final TestRunner runner = TestRunners.newTestRunner(new ConvertCharacterSet());
+ runner.setProperty(ConvertCharacterSet.INPUT_CHARSET, "${now()}");
+ runner.setProperty(ConvertCharacterSet.OUTPUT_CHARSET, "UTF-32");
+
+ runner.enqueue(Paths.get("src/test/resources/CharacterSetConversionSamples/Original.txt"));
+ try {
+ runner.run();
+ fail("Should fail to validate config and fail to run the on trigger");
+ } catch (AssertionError e){
+ // Expect to fail assertion for passing a date to the character set validator
+ }
+
+
+ runner.setProperty(ConvertCharacterSet.INPUT_CHARSET, "UTF-32");
+ runner.setProperty(ConvertCharacterSet.OUTPUT_CHARSET, "${anyAttribute(\"abc\", \"xyz\"):contains(\"bye\")}");
+
+ runner.enqueue(Paths.get("src/test/resources/CharacterSetConversionSamples/Original.txt"));
+ try {
+ runner.run();
+ fail("Should fail to validate config and fail to run the on trigger");
+ } catch (AssertionError e) {
+ // Expect to fail assertion for passing a boolean to the character set validator
+ }
+ }
}
[37/50] [abbrv] nifi git commit: Fixing check-style violation in
StandardFlowFileQueue
Posted by tk...@apache.org.
Fixing check-style violation in StandardFlowFileQueue
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/ee87f33c
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/ee87f33c
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/ee87f33c
Branch: refs/heads/NIFI-1073
Commit: ee87f33ce7aada9f05f43cb3b00f2fab0793cd82
Parents: 98f5a1a
Author: Bryan Bende <bb...@apache.org>
Authored: Fri Nov 6 09:10:10 2015 -0500
Committer: Bryan Bende <bb...@apache.org>
Committed: Fri Nov 6 09:10:10 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/controller/StandardFlowFileQueue.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/ee87f33c/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
----------------------------------------------------------------------
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 0b3c661..ae991c8 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
@@ -1233,8 +1233,8 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
}
private void logIfNegative(final FlowFileQueueSize original, final FlowFileQueueSize newSize, final String counterName) {
- if (newSize.activeQueueBytes < 0 || newSize.activeQueueCount < 0 || newSize.swappedBytes < 0 || newSize.swappedCount < 0 ||
- newSize.unacknowledgedBytes < 0 || newSize.unacknowledgedCount < 0) {
+ if (newSize.activeQueueBytes < 0 || newSize.activeQueueCount < 0 || newSize.swappedBytes < 0 || newSize.swappedCount < 0
+ || newSize.unacknowledgedBytes < 0 || newSize.unacknowledgedCount < 0) {
logger.error("Updated Size of Queue " + counterName + " from " + original + " to " + newSize, new RuntimeException("Cannot create negative queue size"));
[39/50] [abbrv] nifi git commit: NIFI-1058
Posted by tk...@apache.org.
NIFI-1058
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/92099ede
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/92099ede
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/92099ede
Branch: refs/heads/NIFI-1073
Commit: 92099ede2ffde8af346b19092977d724442eb33e
Parents: 0d6e81b
Author: joewitt <jo...@apache.org>
Authored: Fri Nov 6 23:20:03 2015 -0500
Committer: joewitt <jo...@apache.org>
Committed: Fri Nov 6 23:20:03 2015 -0500
----------------------------------------------------------------------
nifi-docs/src/main/asciidoc/administration-guide.adoc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/92099ede/nifi-docs/src/main/asciidoc/administration-guide.adoc
----------------------------------------------------------------------
diff --git a/nifi-docs/src/main/asciidoc/administration-guide.adoc b/nifi-docs/src/main/asciidoc/administration-guide.adoc
index fb109c9..be7b21e 100644
--- a/nifi-docs/src/main/asciidoc/administration-guide.adoc
+++ b/nifi-docs/src/main/asciidoc/administration-guide.adoc
@@ -588,9 +588,9 @@ nifi.provenance.repository.directory.content2=/repos/provenance2 +
+
Providing three total locations, including _nifi.content.repository.directory.default_.
|nifi.content.repository.archive.max.retention.period|If archiving is enabled (see nifi.content.repository.archive.enabled below), then
-this property specifies the maximum amount of time to keep the archived data. It is blank by default.
-|nifi.content.repository.archive.max.usage.percentage|If archiving is enabled (see nifi.content.repository.archive.enabled below), then this property also must have a value to indicate the maximum percentage of disk space that may be used for archiving. It is blank by default.
-|nifi.content.repository.archive.enabled|To enable archiving, set this to _true_ and specify a value for the nifi.content.repository.archive.max.usage.percentage property above. By default, archiving is not enabled.
+this property specifies the maximum amount of time to keep the archived data. It is 12 hours by default.
+|nifi.content.repository.archive.max.usage.percentage|If archiving is enabled (see nifi.content.repository.archive.enabled below), then this property also must have a value to indicate the maximum percentage of disk space that may be used before archive data is removed. If this value is already met even before archiving then arhival will not be of much use. It is 50% by default.
+|nifi.content.repository.archive.enabled|To enable archiving, set this to _true_ and specify a value for the nifi.content.repository.archive.max.usage.percentage property above. By default, archiving is enabled.
|nifi.content.repository.always.sync|If set to _true_, any change to the repository will be synchronized to the disk, meaning that NiFi will ask the operating system not to cache the information. This is very expensive and can significantly reduce NiFi performance. However, if it is _false_, there could be the potential for data loss if either there is a sudden power loss or the operating system crashes. The default value is _false_.
|nifi.content.viewer.url|The URL for a web-based content viewer if one is available. It is blank by default.
|====
[29/50] [abbrv] nifi git commit: NIFI-274 Adding ListenSyslog and
PutSyslog to standard processors. - Refactoring connection handling on put
side,
removing number of buffers from properties and basing it off concurrent tasks
for the processor. - Refactor
Posted by tk...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
new file mode 100644
index 0000000..40a9123
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
@@ -0,0 +1,398 @@
+/*
+ * 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 org.apache.nifi.processor.Processor;
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class TestPutSyslog {
+
+ private MockCollectingSender sender;
+ private MockPutSyslog proc;
+ private TestRunner runner;
+
+ @Before
+ public void setup() throws IOException {
+ sender = new MockCollectingSender();
+ proc = new MockPutSyslog(sender);
+ runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(PutSyslog.HOSTNAME, "localhost");
+ runner.setProperty(PutSyslog.PORT, "12345");
+ }
+
+ @Test
+ public void testValidMessageStaticPropertiesUdp() {
+ final String pri = "34";
+ final String version = "1";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ final String expectedMessage = "<" + pri + ">" + version + " " + stamp + " " + host + " " + body;
+
+ runner.setProperty(PutSyslog.MSG_PRIORITY, pri);
+ runner.setProperty(PutSyslog.MSG_VERSION, version);
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, stamp);
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, host);
+ runner.setProperty(PutSyslog.MSG_BODY, body);
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
+ Assert.assertEquals(1, sender.messages.size());
+ Assert.assertEquals(expectedMessage, sender.messages.get(0));
+ }
+
+ @Test
+ public void testValidMessageStaticPropertiesTcp() {
+ final String pri = "34";
+ final String version = "1";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ final String expectedMessage = "<" + pri + ">" + version + " " + stamp + " " + host + " " + body;
+
+ runner.setProperty(PutSyslog.PROTOCOL, PutSyslog.TCP_VALUE);
+ runner.setProperty(PutSyslog.MSG_PRIORITY, pri);
+ runner.setProperty(PutSyslog.MSG_VERSION, version);
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, stamp);
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, host);
+ runner.setProperty(PutSyslog.MSG_BODY, body);
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
+ Assert.assertEquals(1, sender.messages.size());
+ Assert.assertEquals(expectedMessage, sender.messages.get(0).replace("\n", ""));
+ }
+
+ @Test
+ public void testValidMessageStaticPropertiesNoVersion() {
+ final String pri = "34";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ final String expectedMessage = "<" + pri + ">" + stamp + " " + host + " " + body;
+
+ runner.setProperty(PutSyslog.MSG_PRIORITY, pri);
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, stamp);
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, host);
+ runner.setProperty(PutSyslog.MSG_BODY, body);
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
+ Assert.assertEquals(1, sender.messages.size());
+ Assert.assertEquals(expectedMessage, sender.messages.get(0));
+ }
+
+ @Test
+ public void testValidMessageELProperties() {
+ final String pri = "34";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ final String expectedMessage = "<" + pri + ">" + stamp + " " + host + " " + body;
+
+ runner.setProperty(PutSyslog.MSG_PRIORITY, "${syslog.priority}");
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, "${syslog.timestamp}");
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, "${syslog.hostname}");
+ runner.setProperty(PutSyslog.MSG_BODY, "${syslog.body}");
+
+ final Map<String,String> attributes = new HashMap<>();
+ attributes.put("syslog.priority", pri);
+ attributes.put("syslog.timestamp", stamp);
+ attributes.put("syslog.hostname", host);
+ attributes.put("syslog.body", body);
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")), attributes);
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
+ Assert.assertEquals(1, sender.messages.size());
+ Assert.assertEquals(expectedMessage, sender.messages.get(0));
+ }
+
+ @Test
+ public void testInvalidMessageELProperties() {
+ final String pri = "34";
+ final String stamp = "not-a-timestamp";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ runner.setProperty(PutSyslog.MSG_PRIORITY, "${syslog.priority}");
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, "${syslog.timestamp}");
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, "${syslog.hostname}");
+ runner.setProperty(PutSyslog.MSG_BODY, "${syslog.body}");
+
+ final Map<String,String> attributes = new HashMap<>();
+ attributes.put("syslog.priority", pri);
+ attributes.put("syslog.timestamp", stamp);
+ attributes.put("syslog.hostname", host);
+ attributes.put("syslog.body", body);
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")), attributes);
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_INVALID, 1);
+ Assert.assertEquals(0, sender.messages.size());
+ }
+
+ @Test
+ public void testIOExceptionOnSend() throws IOException {
+ final String pri = "34";
+ final String version = "1";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ proc = new MockPutSyslog(new MockErrorSender());
+ runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(PutSyslog.HOSTNAME, "localhost");
+ runner.setProperty(PutSyslog.PORT, "12345");
+ runner.setProperty(PutSyslog.MSG_PRIORITY, pri);
+ runner.setProperty(PutSyslog.MSG_VERSION, version);
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, stamp);
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, host);
+ runner.setProperty(PutSyslog.MSG_BODY, body);
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_FAILURE, 1);
+ Assert.assertEquals(0, sender.messages.size());
+ }
+
+ @Test
+ public void testIOExceptionCreatingConnection() throws IOException {
+ final String pri = "34";
+ final String version = "1";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ Processor proc = new MockCreationErrorPutSyslog(new MockErrorSender(), 1);
+ runner = TestRunners.newTestRunner(proc);
+ runner.setProperty(PutSyslog.HOSTNAME, "localhost");
+ runner.setProperty(PutSyslog.PORT, "12345");
+ runner.setProperty(PutSyslog.BATCH_SIZE, "1");
+ runner.setProperty(PutSyslog.MSG_PRIORITY, pri);
+ runner.setProperty(PutSyslog.MSG_VERSION, version);
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, stamp);
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, host);
+ runner.setProperty(PutSyslog.MSG_BODY, body);
+
+ // the first run will throw IOException when calling send so the connection won't be re-qeued
+ // the second run will try to create a new connection but throw an exception which should be caught and route files to failure
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.run(2);
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_FAILURE, 2);
+ Assert.assertEquals(0, sender.messages.size());
+ }
+
+ @Test
+ public void testLargeMessageFailure() {
+ final String pri = "34";
+ final String stamp = "2015-10-15T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+
+ final StringBuilder bodyBuilder = new StringBuilder(4096);
+ for (int i=0; i < 4096; i++) {
+ bodyBuilder.append("a");
+ }
+
+ runner.setProperty(PutSyslog.MSG_PRIORITY, "${syslog.priority}");
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, "${syslog.timestamp}");
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, "${syslog.hostname}");
+ runner.setProperty(PutSyslog.MSG_BODY, "${syslog.body}");
+
+ final Map<String,String> attributes = new HashMap<>();
+ attributes.put("syslog.priority", pri);
+ attributes.put("syslog.timestamp", stamp);
+ attributes.put("syslog.hostname", host);
+ attributes.put("syslog.body", bodyBuilder.toString());
+
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")), attributes);
+ runner.run();
+
+ // should have dynamically created a larger buffer
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
+ Assert.assertEquals(1, sender.messages.size());
+ }
+
+ @Test
+ public void testNoIncomingData() {
+ runner.setProperty(PutSyslog.MSG_PRIORITY, "10");
+ runner.setProperty(PutSyslog.MSG_VERSION, "1");
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, "2003-10-11T22:14:15.003Z");
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, "localhost");
+ runner.setProperty(PutSyslog.MSG_BODY, "test");
+
+ // queue one file but run several times to test no incoming data
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")));
+ runner.run(5);
+
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
+ }
+
+ @Test
+ public void testBatchingFlowFiles() {
+ runner.setProperty(PutSyslog.BATCH_SIZE, "10");
+ runner.setProperty(PutSyslog.MSG_PRIORITY, "${syslog.priority}");
+ runner.setProperty(PutSyslog.MSG_TIMESTAMP, "${syslog.timestamp}");
+ runner.setProperty(PutSyslog.MSG_HOSTNAME, "${syslog.hostname}");
+ runner.setProperty(PutSyslog.MSG_BODY, "${syslog.body}");
+
+ final Map<String,String> attributes = new HashMap<>();
+ attributes.put("syslog.priority", "10");
+ attributes.put("syslog.timestamp", "2015-10-11T22:14:15.003Z");
+ attributes.put("syslog.hostname", "my.host.name");
+ attributes.put("syslog.body", "blah blah blah");
+
+ for (int i=0; i < 15; i++) {
+ runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8")), attributes);
+ }
+
+ runner.run();
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 10);
+ Assert.assertEquals(10, sender.messages.size());
+
+ runner.run();
+ runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 15);
+ Assert.assertEquals(15, sender.messages.size());
+ }
+
+ // Mock processor to return a MockCollectingSender
+ static class MockPutSyslog extends PutSyslog {
+
+ ChannelSender mockSender;
+
+ public MockPutSyslog(ChannelSender sender) {
+ this.mockSender = sender;
+ }
+
+ @Override
+ protected ChannelSender createSender(String protocol, String host, int port, Charset charset, BlockingQueue<ByteBuffer> bufferPool) throws IOException {
+ return mockSender;
+ }
+ }
+
+ // Mock processor to test exception when creating new senders
+ static class MockCreationErrorPutSyslog extends PutSyslog {
+
+ int numSendersCreated;
+ int numSendersAllowed;
+ ChannelSender mockSender;
+
+ public MockCreationErrorPutSyslog(ChannelSender sender, int numSendersAllowed) {
+ this.mockSender = sender;
+ this.numSendersAllowed = numSendersAllowed;
+ }
+
+ @Override
+ protected ChannelSender createSender(String protocol, String host, int port, Charset charset, BlockingQueue<ByteBuffer> bufferPool) throws IOException {
+ if (numSendersCreated >= numSendersAllowed) {
+ throw new IOException("too many senders");
+ }
+ numSendersCreated++;
+ return mockSender;
+ }
+ }
+
+ // Mock sender that saves any messages passed to send()
+ static class MockCollectingSender extends PutSyslog.ChannelSender {
+
+ List<String> messages = new ArrayList<>();
+
+ public MockCollectingSender() throws IOException {
+ super("myhost", 0, new LinkedBlockingQueue<ByteBuffer>(1), Charset.forName("UTF-8"));
+ this.bufferPool.offer(ByteBuffer.allocate(1024));
+ }
+
+ @Override
+ public void send(String message) throws IOException {
+ messages.add(message);
+ super.send(message);
+ }
+
+ @Override
+ void write(ByteBuffer buffer) throws IOException {
+
+ }
+
+ @Override
+ boolean isConnected() {
+ return true;
+ }
+
+ @Override
+ void close() {
+
+ }
+ }
+
+ // Mock sender that throws IOException on calls to write() or send()
+ static class MockErrorSender extends PutSyslog.ChannelSender {
+
+ public MockErrorSender() throws IOException {
+ super(null, 0, null, null);
+ }
+
+ @Override
+ public void send(String message) throws IOException {
+ throw new IOException("error");
+ }
+
+ @Override
+ void write(ByteBuffer buffer) throws IOException {
+ throw new IOException("error");
+ }
+
+ @Override
+ boolean isConnected() {
+ return false;
+ }
+
+ @Override
+ void close() {
+
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestSyslogParser.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestSyslogParser.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestSyslogParser.java
new file mode 100644
index 0000000..d1b1bbf
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestSyslogParser.java
@@ -0,0 +1,253 @@
+/*
+ * 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.util;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+
+public class TestSyslogParser {
+
+ static final Charset CHARSET = Charset.forName("UTF-8");
+
+ private SyslogParser parser;
+
+ @Before
+ public void setup() {
+ parser = new SyslogParser(CHARSET);
+ }
+
+ @Test
+ public void testRFC3164SingleDigitDay() {
+ final String pri = "10";
+ final String stamp = "Oct 1 13:14:04";
+ final String host = "my.host.com";
+ final String body = "some body message";
+ final String message = "<" + pri + ">" + stamp + " " + host + " " + body;
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertEquals(pri, event.getPriority());
+ Assert.assertEquals("2", event.getSeverity());
+ Assert.assertEquals("1", event.getFacility());
+ Assert.assertNull(event.getVersion());
+ Assert.assertEquals(stamp, event.getTimeStamp());
+ Assert.assertEquals(host, event.getHostName());
+ Assert.assertEquals(body, event.getMsgBody());
+ Assert.assertEquals(message, event.getFullMessage());
+ Assert.assertTrue(event.isValid());
+ }
+
+ @Test
+ public void testRFC3164DoubleDigitDay() {
+ final String pri = "31";
+ final String stamp = "Oct 13 14:14:43";
+ final String host = "localhost";
+ final String body = "AppleCameraAssistant[470]: DeviceMessageNotificationCallback: kIOPMMessageSystemPowerEventOccurred: 0x00000000";
+ final String message = "<" + pri + ">" + stamp + " " + host + " " + body;
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertEquals(pri, event.getPriority());
+ Assert.assertEquals("7", event.getSeverity());
+ Assert.assertEquals("3", event.getFacility());
+ Assert.assertNull(event.getVersion());
+ Assert.assertEquals(stamp, event.getTimeStamp());
+ Assert.assertEquals(host, event.getHostName());
+ Assert.assertEquals(body, event.getMsgBody());
+ Assert.assertEquals(message, event.getFullMessage());
+ Assert.assertTrue(event.isValid());
+ }
+
+ @Test
+ public void testRFC3164WithVersion() {
+ final String pri = "31";
+ final String version = "1";
+ final String stamp = "Oct 13 14:14:43";
+ final String host = "localhost";
+ final String body = "AppleCameraAssistant[470]: DeviceMessageNotificationCallback: kIOPMMessageSystemPowerEventOccurred: 0x00000000";
+ final String message = "<" + pri + ">" + version + " " + stamp + " " + host + " " + body;
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertEquals(pri, event.getPriority());
+ Assert.assertEquals("7", event.getSeverity());
+ Assert.assertEquals("3", event.getFacility());
+ Assert.assertEquals(version, event.getVersion());
+ Assert.assertEquals(stamp, event.getTimeStamp());
+ Assert.assertEquals(host, event.getHostName());
+ Assert.assertEquals(body, event.getMsgBody());
+ Assert.assertEquals(message, event.getFullMessage());
+ Assert.assertTrue(event.isValid());
+ }
+
+ @Test
+ public void testRFC5424WithVersion() {
+ final String pri = "34";
+ final String version = "1";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ final String message = "<" + pri + ">" + version + " " + stamp + " " + host + " " + body;
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertEquals(pri, event.getPriority());
+ Assert.assertEquals("2", event.getSeverity());
+ Assert.assertEquals("4", event.getFacility());
+ Assert.assertEquals(version, event.getVersion());
+ Assert.assertEquals(stamp, event.getTimeStamp());
+ Assert.assertEquals(host, event.getHostName());
+ Assert.assertEquals(body, event.getMsgBody());
+ Assert.assertEquals(message, event.getFullMessage());
+ Assert.assertTrue(event.isValid());
+ }
+
+ @Test
+ public void testRFC5424WithoutVersion() {
+ final String pri = "34";
+ final String stamp = "2003-10-11T22:14:15.003Z";
+ final String host = "mymachine.example.com";
+ final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
+
+ final String message = "<" + pri + ">" + stamp + " " + host + " " + body;
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertEquals(pri, event.getPriority());
+ Assert.assertEquals("2", event.getSeverity());
+ Assert.assertEquals("4", event.getFacility());
+ Assert.assertNull(event.getVersion());
+ Assert.assertEquals(stamp, event.getTimeStamp());
+ Assert.assertEquals(host, event.getHostName());
+ Assert.assertEquals(body, event.getMsgBody());
+ Assert.assertEquals(message, event.getFullMessage());
+ Assert.assertTrue(event.isValid());
+ }
+
+ @Test
+ public void testTrailingNewLine() {
+ final String message = "<31>Oct 13 15:43:23 localhost.home some message\n";
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertTrue(event.isValid());
+ }
+
+ @Test
+ public void testVariety() {
+ final List<String> messages = new ArrayList<>();
+
+ // supported examples from RFC 3164
+ messages.add("<34>Oct 11 22:14:15 mymachine su: 'su root' failed for " +
+ "lonvick on /dev/pts/8");
+ messages.add("<13>Feb 5 17:32:18 10.0.0.99 Use the BFG!");
+ messages.add("<165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]: %% " +
+ "It's time to make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK # " +
+ "Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: " +
+ "Conveyer1=OK, Conveyer2=OK # %%");
+ messages.add("<0>Oct 22 10:52:12 scapegoat 1990 Oct 22 10:52:01 TZ-6 " +
+ "scapegoat.dmz.example.org 10.1.2.3 sched[0]: That's All Folks!");
+
+ // supported examples from RFC 5424
+ messages.add("<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - " +
+ "ID47 - BOM'su root' failed for lonvick on /dev/pts/8");
+ messages.add("<165>1 2003-08-24T05:14:15.000003-07:00 192.0.2.1 myproc " +
+ "8710 - - %% It's time to make the do-nuts.");
+
+ // non-standard (but common) messages (RFC3339 dates, no version digit)
+ messages.add("<13>2003-08-24T05:14:15Z localhost snarf?");
+ messages.add("<13>2012-08-16T14:34:03-08:00 127.0.0.1 test shnap!");
+
+ for (final String message : messages) {
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertTrue(event.isValid());
+ }
+ }
+
+ @Test
+ public void testInvalidPriority() {
+ final String message = "10 Oct 13 14:14:43 localhost some body of the message";
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer);
+ Assert.assertNotNull(event);
+ Assert.assertFalse(event.isValid());
+ Assert.assertEquals(message, event.getFullMessage());
+ }
+
+ @Test
+ public void testParseWithSender() {
+ final String sender = "127.0.0.1";
+ final String message = "<31>Oct 13 15:43:23 localhost.home some message\n";
+
+ final byte[] bytes = message.getBytes(CHARSET);
+ final ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
+ buffer.clear();
+ buffer.put(bytes);
+
+ final SyslogEvent event = parser.parseEvent(buffer, sender);
+ Assert.assertNotNull(event);
+ Assert.assertTrue(event.isValid());
+ Assert.assertEquals(sender, event.getSender());
+ }
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/9c542432/nifi-nar-bundles/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/pom.xml b/nifi-nar-bundles/pom.xml
index 841818a..d48b755 100644
--- a/nifi-nar-bundles/pom.xml
+++ b/nifi-nar-bundles/pom.xml
@@ -46,7 +46,7 @@
<module>nifi-image-bundle</module>
<module>nifi-avro-bundle</module>
<module>nifi-couchbase-bundle</module>
- </modules>
+ </modules>
<dependencyManagement>
<dependencies>
<dependency>
@@ -131,4 +131,4 @@
</dependency>
</dependencies>
</dependencyManagement>
-</project>
+</project>
\ No newline at end of file
[10/50] [abbrv] nifi git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/nifi
Posted by tk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/nifi
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/ba72452f
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/ba72452f
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/ba72452f
Branch: refs/heads/NIFI-1073
Commit: ba72452f669b926c2af63ccd5684e0c2b793f405
Parents: a3d43d2 1d97876
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Oct 30 16:02:15 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Oct 30 16:02:15 2015 -0400
----------------------------------------------------------------------
.../java/org/apache/nifi/action/Action.java | 50 ++++
.../java/org/apache/nifi/action/Component.java | 34 +++
.../java/org/apache/nifi/action/Operation.java | 37 +++
.../component/details/ComponentDetails.java | 26 ++
.../component/details/ExtensionDetails.java | 26 ++
.../details/RemoteProcessGroupDetails.java | 26 ++
.../nifi/action/details/ActionDetails.java | 26 ++
.../nifi/action/details/ConfigureDetails.java | 30 ++
.../nifi/action/details/ConnectDetails.java | 40 +++
.../apache/nifi/action/details/MoveDetails.java | 30 ++
.../nifi/action/details/PurgeDetails.java | 28 ++
.../org/apache/nifi/reporting/EventAccess.java | 13 +
.../org/apache/nifi/util/MockEventAccess.java | 27 ++
.../org/apache/nifi/admin/dao/ActionDAO.java | 12 +-
.../java/org/apache/nifi/admin/dao/UserDAO.java | 3 +-
.../nifi/admin/dao/impl/StandardActionDAO.java | 93 +++---
.../nifi/admin/dao/impl/StandardUserDAO.java | 4 +-
.../apache/nifi/admin/service/AuditService.java | 18 +-
.../admin/service/action/AddActionsAction.java | 3 +-
.../service/action/PurgeActionsAction.java | 3 +-
.../service/impl/StandardAuditService.java | 24 +-
.../resources/nifi-administration-context.xml | 2 +-
.../manager/impl/ClusteredEventAccess.java | 21 +-
.../cluster/manager/impl/WebClusterManager.java | 2 +-
.../apache/nifi/controller/FlowController.java | 136 +++++----
.../nifi/spring/FlowControllerFactoryBean.java | 8 +
.../src/main/resources/nifi-context.xml | 1 +
.../controller/StandardFlowServiceTest.java | 5 +-
.../nifi-framework/nifi-user-actions/pom.xml | 7 +
.../java/org/apache/nifi/action/Action.java | 121 --------
.../java/org/apache/nifi/action/Component.java | 34 ---
.../apache/nifi/action/FlowChangeAction.java | 130 +++++++++
.../java/org/apache/nifi/action/Operation.java | 37 ---
.../component/details/ComponentDetails.java | 26 --
.../component/details/ExtensionDetails.java | 34 ---
.../details/FlowChangeExtensionDetails.java | 35 +++
.../FlowChangeRemoteProcessGroupDetails.java | 35 +++
.../details/RemoteProcessGroupDetails.java | 34 ---
.../nifi/action/details/ActionDetails.java | 26 --
.../nifi/action/details/ConfigureDetails.java | 52 ----
.../nifi/action/details/ConnectDetails.java | 90 ------
.../details/FlowChangeConfigureDetails.java | 55 ++++
.../details/FlowChangeConnectDetails.java | 97 +++++++
.../action/details/FlowChangeMoveDetails.java | 65 +++++
.../action/details/FlowChangePurgeDetails.java | 46 +++
.../apache/nifi/action/details/MoveDetails.java | 61 ----
.../nifi/action/details/PurgeDetails.java | 45 ---
.../apache/nifi/audit/ControllerAuditor.java | 27 +-
.../nifi/audit/ControllerServiceAuditor.java | 43 +--
.../org/apache/nifi/audit/FunnelAuditor.java | 7 +-
.../java/org/apache/nifi/audit/NiFiAuditor.java | 25 +-
.../java/org/apache/nifi/audit/PortAuditor.java | 27 +-
.../apache/nifi/audit/ProcessGroupAuditor.java | 25 +-
.../org/apache/nifi/audit/ProcessorAuditor.java | 25 +-
.../apache/nifi/audit/RelationshipAuditor.java | 18 +-
.../nifi/audit/RemoteProcessGroupAuditor.java | 35 +--
.../apache/nifi/audit/ReportingTaskAuditor.java | 25 +-
.../org/apache/nifi/audit/SnippetAuditor.java | 26 +-
.../nifi/web/StandardNiFiServiceFacade.java | 9 +-
.../StandardNiFiWebConfigurationContext.java | 13 +-
.../apache/nifi/web/StandardNiFiWebContext.java | 13 +-
.../nifi/web/api/ApplicationResource.java | 5 +-
.../org/apache/nifi/web/api/dto/DtoFactory.java | 20 +-
.../nifi-pcap-processors/.gitignore | 1 -
.../processors/standard/AttributesToJSON.java | 242 ++++++++++++++++
.../org.apache.nifi.processor.Processor | 1 +
.../standard/TestAttributesToJSON.java | 282 +++++++++++++++++++
67 files changed, 1781 insertions(+), 846 deletions(-)
----------------------------------------------------------------------
[41/50] [abbrv] nifi git commit: NIFI-1122 moved to 0.4.0-SNAPSHOT
Posted by tk...@apache.org.
NIFI-1122 moved to 0.4.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/99629646
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/99629646
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/99629646
Branch: refs/heads/NIFI-1073
Commit: 99629646fe2bf67e814533c4073247a25506c8fa
Parents: 92099ed
Author: joewitt <jo...@apache.org>
Authored: Fri Nov 6 23:41:15 2015 -0500
Committer: joewitt <jo...@apache.org>
Committed: Fri Nov 6 23:41:15 2015 -0500
----------------------------------------------------------------------
nifi-api/pom.xml | 2 +-
nifi-assembly/pom.xml | 2 +-
nifi-bootstrap/pom.xml | 2 +-
nifi-commons/nifi-data-provenance-utils/pom.xml | 2 +-
nifi-commons/nifi-expression-language/pom.xml | 2 +-
nifi-commons/nifi-flowfile-packager/pom.xml | 2 +-
nifi-commons/nifi-hl7-query-language/pom.xml | 2 +-
nifi-commons/nifi-logging-utils/pom.xml | 2 +-
nifi-commons/nifi-processor-utilities/pom.xml | 2 +-
nifi-commons/nifi-properties/pom.xml | 2 +-
nifi-commons/nifi-security-utils/pom.xml | 2 +-
nifi-commons/nifi-site-to-site-client/pom.xml | 4 +-
nifi-commons/nifi-socket-utils/pom.xml | 2 +-
nifi-commons/nifi-utils/pom.xml | 4 +-
nifi-commons/nifi-web-utils/pom.xml | 2 +-
nifi-commons/nifi-write-ahead-log/pom.xml | 2 +-
nifi-commons/pom.xml | 2 +-
nifi-docs/pom.xml | 2 +-
.../nifi-nifi-example-nar/pom.xml | 2 +-
.../nifi-nifi-example-processors/pom.xml | 2 +-
nifi-external/nifi-example-bundle/pom.xml | 4 +-
nifi-external/nifi-spark-receiver/pom.xml | 2 +-
nifi-external/nifi-storm-spout/pom.xml | 2 +-
nifi-external/pom.xml | 2 +-
.../nifi-processor-bundle-archetype/pom.xml | 2 +-
.../nifi-service-bundle-archetype/pom.xml | 2 +-
nifi-maven-archetypes/pom.xml | 2 +-
nifi-mock/pom.xml | 2 +-
.../nifi-ambari-bundle/nifi-ambari-nar/pom.xml | 4 +-
.../nifi-ambari-reporting-task/pom.xml | 2 +-
nifi-nar-bundles/nifi-ambari-bundle/pom.xml | 2 +-
.../nifi-avro-bundle/nifi-avro-nar/pom.xml | 6 +-
.../nifi-avro-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-avro-bundle/pom.xml | 4 +-
.../nifi-aws-bundle/nifi-aws-nar/pom.xml | 4 +-
.../nifi-aws-bundle/nifi-aws-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-aws-bundle/pom.xml | 2 +-
.../nifi-couchbase-nar/pom.xml | 6 +-
.../nifi-couchbase-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-couchbase-bundle/pom.xml | 4 +-
.../nifi-flume-bundle/nifi-flume-nar/pom.xml | 4 +-
.../nifi-flume-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-flume-bundle/pom.xml | 6 +-
.../nifi-framework-nar/pom.xml | 2 +-
.../nifi-framework/nifi-administration/pom.xml | 2 +-
.../nifi-framework/nifi-client-dto/pom.xml | 2 +-
.../nifi-cluster-authorization-provider/pom.xml | 2 +-
.../nifi-framework/nifi-documentation/pom.xml | 2 +-
.../nifi-file-authorization-provider/pom.xml | 2 +-
.../nifi-framework-cluster-protocol/pom.xml | 2 +-
.../nifi-framework-cluster-web/pom.xml | 2 +-
.../nifi-framework-cluster/pom.xml | 2 +-
.../nifi-framework-core-api/pom.xml | 2 +-
.../nifi-framework/nifi-framework-core/pom.xml | 2 +-
.../nifi-framework/nifi-nar-utils/pom.xml | 2 +-
.../nifi-framework/nifi-resources/pom.xml | 2 +-
.../nifi-framework/nifi-runtime/pom.xml | 2 +-
.../nifi-framework/nifi-security/pom.xml | 2 +-
.../nifi-framework/nifi-site-to-site/pom.xml | 2 +-
.../nifi-framework/nifi-user-actions/pom.xml | 2 +-
.../nifi-web/nifi-custom-ui-utilities/pom.xml | 2 +-
.../nifi-framework/nifi-web/nifi-jetty/pom.xml | 2 +-
.../nifi-web/nifi-ui-extension/pom.xml | 2 +-
.../nifi-web/nifi-web-api/pom.xml | 2 +-
.../nifi-web/nifi-web-content-access/pom.xml | 2 +-
.../nifi-web/nifi-web-content-viewer/pom.xml | 2 +-
.../nifi-web/nifi-web-docs/pom.xml | 2 +-
.../nifi-web/nifi-web-error/pom.xml | 2 +-
.../nifi-web-optimistic-locking/pom.xml | 2 +-
.../nifi-web/nifi-web-security/pom.xml | 2 +-
.../nifi-framework/nifi-web/nifi-web-ui/pom.xml | 2 +-
.../nifi-framework/nifi-web/pom.xml | 12 +--
.../nifi-framework/pom.xml | 2 +-
nifi-nar-bundles/nifi-framework-bundle/pom.xml | 38 +++----
.../nifi-geo-bundle/nifi-geo-nar/pom.xml | 2 +-
.../nifi-geo-bundle/nifi-geo-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-geo-bundle/pom.xml | 4 +-
.../nifi-hadoop-bundle/nifi-hadoop-nar/pom.xml | 2 +-
.../nifi-hdfs-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-hadoop-bundle/pom.xml | 4 +-
.../nifi-hadoop-libraries-nar/pom.xml | 2 +-
.../nifi-hadoop-libraries-bundle/pom.xml | 2 +-
.../nifi-hl7-bundle/nifi-hl7-nar/pom.xml | 4 +-
.../nifi-hl7-bundle/nifi-hl7-processors/pom.xml | 4 +-
nifi-nar-bundles/nifi-hl7-bundle/pom.xml | 2 +-
.../nifi-image-bundle/nifi-image-nar/pom.xml | 8 +-
.../nifi-image-processors/pom.xml | 2 +-
.../nifi-image-bundle/nifi-image-viewer/pom.xml | 2 +-
nifi-nar-bundles/nifi-image-bundle/pom.xml | 4 +-
nifi-nar-bundles/nifi-jetty-bundle/pom.xml | 2 +-
.../nifi-kafka-bundle/nifi-kafka-nar/pom.xml | 2 +-
.../nifi-kafka-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-kafka-bundle/pom.xml | 4 +-
.../nifi-kite-bundle/nifi-kite-nar/pom.xml | 2 +-
.../nifi-kite-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-kite-bundle/pom.xml | 4 +-
.../nifi-language-translation-nar/pom.xml | 4 +-
.../nifi-yandex-processors/pom.xml | 2 +-
.../nifi-language-translation-bundle/pom.xml | 2 +-
.../nifi-mongodb-nar/pom.xml | 6 +-
.../nifi-mongodb-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-mongodb-bundle/pom.xml | 4 +-
.../pom.xml | 2 +-
.../nifi-provenance-repository-nar/pom.xml | 2 +-
.../nifi-volatile-provenance-repository/pom.xml | 2 +-
.../nifi-provenance-repository-bundle/pom.xml | 6 +-
.../nifi-social-media-nar/pom.xml | 4 +-
.../nifi-twitter-processors/pom.xml | 2 +-
.../nifi-social-media-bundle/pom.xml | 2 +-
.../nifi-solr-bundle/nifi-solr-nar/pom.xml | 4 +-
.../nifi-solr-processors/pom.xml | 2 +-
nifi-nar-bundles/nifi-solr-bundle/pom.xml | 2 +-
.../nifi-standard-content-viewer/pom.xml | 2 +-
.../nifi-standard-nar/pom.xml | 2 +-
.../nifi-standard-prioritizers/pom.xml | 2 +-
.../nifi-standard-processors/pom.xml | 2 +-
.../nifi-standard-reporting-tasks/pom.xml | 2 +-
nifi-nar-bundles/nifi-standard-bundle/pom.xml | 10 +-
.../nifi-dbcp-service-api/pom.xml | 2 +-
.../nifi-dbcp-service-nar/pom.xml | 4 +-
.../nifi-dbcp-service/pom.xml | 2 +-
.../nifi-dbcp-service-bundle/pom.xml | 2 +-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../nifi-distributed-cache-protocol/pom.xml | 2 +-
.../nifi-distributed-cache-server/pom.xml | 2 +-
.../nifi-distributed-cache-services-nar/pom.xml | 2 +-
.../pom.xml | 2 +-
.../nifi-http-context-map-api/pom.xml | 2 +-
.../nifi-http-context-map-nar/pom.xml | 2 +-
.../nifi-http-context-map/pom.xml | 2 +-
.../nifi-http-context-map-bundle/pom.xml | 2 +-
.../nifi-load-distribution-service-api/pom.xml | 2 +-
.../nifi-ssl-context-nar/pom.xml | 2 +-
.../nifi-ssl-context-service/pom.xml | 2 +-
.../nifi-ssl-context-bundle/pom.xml | 2 +-
.../nifi-ssl-context-service-api/pom.xml | 2 +-
.../nifi-standard-services-api-nar/pom.xml | 2 +-
nifi-nar-bundles/nifi-standard-services/pom.xml | 2 +-
.../nifi-update-attribute-model/pom.xml | 2 +-
.../nifi-update-attribute-nar/pom.xml | 2 +-
.../nifi-update-attribute-processor/pom.xml | 2 +-
.../nifi-update-attribute-ui/pom.xml | 2 +-
.../nifi-update-attribute-bundle/pom.xml | 8 +-
nifi-nar-bundles/pom.xml | 30 +++---
pom.xml | 100 +++++++++----------
146 files changed, 272 insertions(+), 272 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-api/pom.xml b/nifi-api/pom.xml
index 349f8ab..ae31ed5 100644
--- a/nifi-api/pom.xml
+++ b/nifi-api/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-api</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml
index de4fdcb..e80c2d5 100644
--- a/nifi-assembly/pom.xml
+++ b/nifi-assembly/pom.xml
@@ -14,7 +14,7 @@ language governing permissions and limitations under the License. -->
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-assembly</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-bootstrap/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-bootstrap/pom.xml b/nifi-bootstrap/pom.xml
index 96032af..26494b8 100644
--- a/nifi-bootstrap/pom.xml
+++ b/nifi-bootstrap/pom.xml
@@ -14,7 +14,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-bootstrap</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-data-provenance-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-data-provenance-utils/pom.xml b/nifi-commons/nifi-data-provenance-utils/pom.xml
index 3aa4f36..bc8009a 100644
--- a/nifi-commons/nifi-data-provenance-utils/pom.xml
+++ b/nifi-commons/nifi-data-provenance-utils/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-data-provenance-utils</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-expression-language/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-expression-language/pom.xml b/nifi-commons/nifi-expression-language/pom.xml
index c940a73..2dc8839 100644
--- a/nifi-commons/nifi-expression-language/pom.xml
+++ b/nifi-commons/nifi-expression-language/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-expression-language</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-flowfile-packager/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-flowfile-packager/pom.xml b/nifi-commons/nifi-flowfile-packager/pom.xml
index a84a8ec..54ba577 100644
--- a/nifi-commons/nifi-flowfile-packager/pom.xml
+++ b/nifi-commons/nifi-flowfile-packager/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-flowfile-packager</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-hl7-query-language/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-hl7-query-language/pom.xml b/nifi-commons/nifi-hl7-query-language/pom.xml
index ae5d968..492ee13 100644
--- a/nifi-commons/nifi-hl7-query-language/pom.xml
+++ b/nifi-commons/nifi-hl7-query-language/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hl7-query-language</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-logging-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-logging-utils/pom.xml b/nifi-commons/nifi-logging-utils/pom.xml
index 0e94f65..8561cdf 100644
--- a/nifi-commons/nifi-logging-utils/pom.xml
+++ b/nifi-commons/nifi-logging-utils/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-logging-utils</artifactId>
<description>Utilities for logging</description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-processor-utilities/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-processor-utilities/pom.xml b/nifi-commons/nifi-processor-utilities/pom.xml
index 8f62b64..0239771 100644
--- a/nifi-commons/nifi-processor-utilities/pom.xml
+++ b/nifi-commons/nifi-processor-utilities/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-processor-utils</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-properties/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-properties/pom.xml b/nifi-commons/nifi-properties/pom.xml
index 65b5b71..95c9391 100644
--- a/nifi-commons/nifi-properties/pom.xml
+++ b/nifi-commons/nifi-properties/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-properties</artifactId>
</project>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-security-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-security-utils/pom.xml b/nifi-commons/nifi-security-utils/pom.xml
index adbbbd0..75be1c2 100644
--- a/nifi-commons/nifi-security-utils/pom.xml
+++ b/nifi-commons/nifi-security-utils/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-security-utils</artifactId>
<description>Contains security functionality.</description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-site-to-site-client/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-site-to-site-client/pom.xml b/nifi-commons/nifi-site-to-site-client/pom.xml
index c08786d..3d6ad25 100644
--- a/nifi-commons/nifi-site-to-site-client/pom.xml
+++ b/nifi-commons/nifi-site-to-site-client/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-site-to-site-client</artifactId>
@@ -42,7 +42,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-client-dto</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-socket-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-socket-utils/pom.xml b/nifi-commons/nifi-socket-utils/pom.xml
index cff5c31..72467f9 100644
--- a/nifi-commons/nifi-socket-utils/pom.xml
+++ b/nifi-commons/nifi-socket-utils/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-socket-utils</artifactId>
<description>Utilities for socket communication</description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-utils/pom.xml b/nifi-commons/nifi-utils/pom.xml
index 6414182..39a067e 100644
--- a/nifi-commons/nifi-utils/pom.xml
+++ b/nifi-commons/nifi-utils/pom.xml
@@ -18,10 +18,10 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!--
This project intentionally has no additional dependencies beyond that pulled in by the parent. It is a general purpose utility library
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-web-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-web-utils/pom.xml b/nifi-commons/nifi-web-utils/pom.xml
index fde29d5..91a5580 100644
--- a/nifi-commons/nifi-web-utils/pom.xml
+++ b/nifi-commons/nifi-web-utils/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-web-utils</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/nifi-write-ahead-log/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-write-ahead-log/pom.xml b/nifi-commons/nifi-write-ahead-log/pom.xml
index 49b152f..f4a5c52 100644
--- a/nifi-commons/nifi-write-ahead-log/pom.xml
+++ b/nifi-commons/nifi-write-ahead-log/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-write-ahead-log</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-commons/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-commons/pom.xml b/nifi-commons/pom.xml
index c464498..2669688 100644
--- a/nifi-commons/pom.xml
+++ b/nifi-commons/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-commons</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-docs/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-docs/pom.xml b/nifi-docs/pom.xml
index 0c474da..b2c7f00 100644
--- a/nifi-docs/pom.xml
+++ b/nifi-docs/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<artifactId>nifi-docs</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-external/nifi-example-bundle/nifi-nifi-example-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-external/nifi-example-bundle/nifi-nifi-example-nar/pom.xml b/nifi-external/nifi-example-bundle/nifi-nifi-example-nar/pom.xml
index 2702938..43fca2c 100644
--- a/nifi-external/nifi-example-bundle/nifi-nifi-example-nar/pom.xml
+++ b/nifi-external/nifi-example-bundle/nifi-nifi-example-nar/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-example-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-example-nar</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/pom.xml b/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/pom.xml
index 6c660e3..9cd4933 100644
--- a/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/pom.xml
+++ b/nifi-external/nifi-example-bundle/nifi-nifi-example-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-example-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-nifi-example-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-external/nifi-example-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-external/nifi-example-bundle/pom.xml b/nifi-external/nifi-example-bundle/pom.xml
index c568957..e60da6d 100644
--- a/nifi-external/nifi-example-bundle/pom.xml
+++ b/nifi-external/nifi-example-bundle/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-external</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-example-bundle</artifactId>
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nifi-example-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-external/nifi-spark-receiver/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-external/nifi-spark-receiver/pom.xml b/nifi-external/nifi-spark-receiver/pom.xml
index 48e3d73..475c9b4 100644
--- a/nifi-external/nifi-spark-receiver/pom.xml
+++ b/nifi-external/nifi-spark-receiver/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-external</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-spark-receiver</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-external/nifi-storm-spout/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-external/nifi-storm-spout/pom.xml b/nifi-external/nifi-storm-spout/pom.xml
index 8e5bef2..9c5d09f 100644
--- a/nifi-external/nifi-storm-spout/pom.xml
+++ b/nifi-external/nifi-storm-spout/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-external</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-storm-spout</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-external/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-external/pom.xml b/nifi-external/pom.xml
index 0de70fe..d1bfcf7 100644
--- a/nifi-external/pom.xml
+++ b/nifi-external/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-external</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-maven-archetypes/nifi-processor-bundle-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-maven-archetypes/nifi-processor-bundle-archetype/pom.xml b/nifi-maven-archetypes/nifi-processor-bundle-archetype/pom.xml
index a0ae335..05a9257 100644
--- a/nifi-maven-archetypes/nifi-processor-bundle-archetype/pom.xml
+++ b/nifi-maven-archetypes/nifi-processor-bundle-archetype/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-maven-archetypes</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-processor-bundle-archetype</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-maven-archetypes/nifi-service-bundle-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-maven-archetypes/nifi-service-bundle-archetype/pom.xml b/nifi-maven-archetypes/nifi-service-bundle-archetype/pom.xml
index f8eec53..b7540cb 100644
--- a/nifi-maven-archetypes/nifi-service-bundle-archetype/pom.xml
+++ b/nifi-maven-archetypes/nifi-service-bundle-archetype/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-maven-archetypes</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-service-bundle-archetype</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-maven-archetypes/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-maven-archetypes/pom.xml b/nifi-maven-archetypes/pom.xml
index 46e365f..ca14028 100644
--- a/nifi-maven-archetypes/pom.xml
+++ b/nifi-maven-archetypes/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-maven-archetypes</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-mock/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-mock/pom.xml b/nifi-mock/pom.xml
index 92ec657..98350a2 100644
--- a/nifi-mock/pom.xml
+++ b/nifi-mock/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-mock</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-nar/pom.xml b/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-nar/pom.xml
index 5f62c65..16a1572 100644
--- a/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ambari-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ambari-nar</artifactId>
@@ -27,7 +27,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ambari-reporting-task</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/pom.xml b/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/pom.xml
index 01ffbc6..487587b 100644
--- a/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/pom.xml
+++ b/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ambari-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ambari-reporting-task</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-ambari-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-ambari-bundle/pom.xml b/nifi-nar-bundles/nifi-ambari-bundle/pom.xml
index f4b1987..df3d26e 100644
--- a/nifi-nar-bundles/nifi-ambari-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-ambari-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ambari-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-nar/pom.xml b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-nar/pom.xml
index 9ab749b..c7c073f 100644
--- a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-nar/pom.xml
@@ -19,18 +19,18 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-avro-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-avro-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>nar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-avro-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml
index 70ac284..c86cfca 100644
--- a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-avro-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-avro-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-avro-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-avro-bundle/pom.xml b/nifi-nar-bundles/nifi-avro-bundle/pom.xml
index 35e000e..25a4453 100644
--- a/nifi-nar-bundles/nifi-avro-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-avro-bundle/pom.xml
@@ -19,12 +19,12 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-avro-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-nar/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-nar/pom.xml
index 4da50c1..13bca24 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-nar/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-aws-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-aws-nar</artifactId>
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-aws-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
index 1569ad3..1e16614 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-aws-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-aws-processors</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-aws-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/pom.xml
index 18f52a9..a43bb80 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-aws-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/pom.xml b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/pom.xml
index 4f58d1f..ae10828 100644
--- a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/pom.xml
@@ -19,18 +19,18 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-couchbase-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-couchbase-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>nar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-couchbase-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml
index 257ef46..d006a43 100644
--- a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-couchbase-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-couchbase-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-couchbase-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/pom.xml b/nifi-nar-bundles/nifi-couchbase-bundle/pom.xml
index 3654295..b38f2d8 100644
--- a/nifi-nar-bundles/nifi-couchbase-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-couchbase-bundle/pom.xml
@@ -19,12 +19,12 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-couchbase-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-nar/pom.xml b/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-nar/pom.xml
index cdd224b..6e9a11d 100644
--- a/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-nar/pom.xml
@@ -18,10 +18,10 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-flume-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-flume-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>nar</packaging>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml b/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml
index a181839..8f2fb1c 100644
--- a/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-flume-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-flume-processors</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-flume-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-flume-bundle/pom.xml b/nifi-nar-bundles/nifi-flume-bundle/pom.xml
index 3b85f3d..bc84922 100644
--- a/nifi-nar-bundles/nifi-flume-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-flume-bundle/pom.xml
@@ -18,10 +18,10 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-flume-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>A bundle of processors that run Flume sources/sinks</description>
<modules>
@@ -33,7 +33,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-flume-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml
index fcfcfe7..512adb4 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/pom.xml
index ad2d2f0..aeaeda8 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-administration</artifactId>
<build>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/pom.xml
index c08926b..0193129 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-client-dto</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster-authorization-provider/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster-authorization-provider/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster-authorization-provider/pom.xml
index 2b89584..e8e92c3 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster-authorization-provider/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster-authorization-provider/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-cluster-authorization-provider</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/pom.xml
index a8c5a25..5f2c72c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/pom.xml
@@ -14,7 +14,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-documentation</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorization-provider/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorization-provider/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorization-provider/pom.xml
index d014262..7b6e70b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorization-provider/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorization-provider/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-file-authorization-provider</artifactId>
<build>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/pom.xml
index f31ffec..45ff99d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-cluster-protocol</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-web/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-web/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-web/pom.xml
index 1b8b2b8..c454d10 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-web/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-web/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-cluster-web</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/pom.xml
index fc7150a..bb1ecc9 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-cluster</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/pom.xml
index 6e2cdcd..877b250 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-core-api</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
index e44e77c..cc432a3 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-core</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/pom.xml
index 7e33ccb..c7c2601 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-nar-utils</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
index 90920ed..e95623a 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-resources</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/pom.xml
index 6749225..073eb6d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-runtime</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-security/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-security/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-security/pom.xml
index 3b1c14d..d29bff0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-security/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-security/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-security</artifactId>
<description>Contains security functionality common to NiFi.</description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/pom.xml
index c19024d..7b1e3fb 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-site-to-site</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-user-actions/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-user-actions/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-user-actions/pom.xml
index e8649ed..9bf1fa6 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-user-actions/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-user-actions/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-user-actions</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-custom-ui-utilities/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-custom-ui-utilities/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-custom-ui-utilities/pom.xml
index 2fe30a6..673fb28 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-custom-ui-utilities/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-custom-ui-utilities/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-custom-ui-utilities</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
index bff2945..a5789d6 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-jetty</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-ui-extension/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-ui-extension/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-ui-extension/pom.xml
index 8b570fd..fedc3ed 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-ui-extension/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-ui-extension/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ui-extension</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml
index a74dfb0..4925c0d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-api</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/pom.xml
index 3878f47..0054925 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-access/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-content-access</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/pom.xml
index bfdd881..0667227 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-content-viewer/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-content-viewer</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-docs/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-docs/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-docs/pom.xml
index d7b2010..ff7e774 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-docs/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-docs/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-docs</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-error/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-error/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-error/pom.xml
index bb2f8d2..2cac246 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-error/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-error/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-error</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/pom.xml
index 430b57b..bf91d64 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-optimistic-locking/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-optimistic-locking</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/pom.xml
index 59d81e1..daeef5c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-security</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
index 08218f6..195f14b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-web-ui</artifactId>
<packaging>war</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/pom.xml
index 4f00580..532cf93 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-web</artifactId>
<packaging>pom</packaging>
@@ -40,31 +40,31 @@
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-api</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-error</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-docs</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-content-viewer</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-ui</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/pom.xml
index b6f3f9c..56f0f9b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-framework-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/pom.xml
index f78e497..fb99ef9 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-framework-bundle</artifactId>
<packaging>pom</packaging>
@@ -31,92 +31,92 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-cluster-protocol</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-cluster-web</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-file-authorization-provider</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-cluster-authorization-provider</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-cluster</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-runtime</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-client-dto</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-content-access</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-security</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-core-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-site-to-site</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-core</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-user-actions</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-administration</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-jetty</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-optimistic-locking</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-security</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-documentation</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-nar/pom.xml b/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-nar/pom.xml
index bc459e3..ffd969a 100644
--- a/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-nar/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-geo-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-geo-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/pom.xml b/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/pom.xml
index ce6d271..61520ad 100644
--- a/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-geo-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-geo-processors</artifactId>
<dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-geo-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-geo-bundle/pom.xml b/nifi-nar-bundles/nifi-geo-bundle/pom.xml
index 46e9fb5..784f56c 100644
--- a/nifi-nar-bundles/nifi-geo-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-geo-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-geo-bundle</artifactId>
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-geo-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hadoop-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hadoop-nar/pom.xml b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hadoop-nar/pom.xml
index e69b993..3575dc4 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hadoop-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hadoop-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hadoop-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hadoop-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
index d5c00e4..053cb81 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hadoop-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hdfs-processors</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hadoop-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/pom.xml b/nifi-nar-bundles/nifi-hadoop-bundle/pom.xml
index 450ffeb..585fe32 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hadoop-bundle</artifactId>
<packaging>pom</packaging>
@@ -31,7 +31,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hdfs-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml b/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml
index d6d23bf..f61c840 100644
--- a/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml
@@ -13,7 +13,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hadoop-libraries-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hadoop-libraries-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hadoop-libraries-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-libraries-bundle/pom.xml b/nifi-nar-bundles/nifi-hadoop-libraries-bundle/pom.xml
index 782eb2b..a01a114 100644
--- a/nifi-nar-bundles/nifi-hadoop-libraries-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-hadoop-libraries-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hadoop-libraries-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-nar/pom.xml b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-nar/pom.xml
index e9073c2..39b08a9 100644
--- a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-nar/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hl7-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hl7-nar</artifactId>
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hl7-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml
index f50cdc3..632552a 100644
--- a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hl7-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hl7-processors</artifactId>
@@ -52,7 +52,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hl7-query-language</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-hl7-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hl7-bundle/pom.xml b/nifi-nar-bundles/nifi-hl7-bundle/pom.xml
index 9957337..407260e 100644
--- a/nifi-nar-bundles/nifi-hl7-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-hl7-bundle/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-hl7-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-image-bundle/nifi-image-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-image-bundle/nifi-image-nar/pom.xml b/nifi-nar-bundles/nifi-image-bundle/nifi-image-nar/pom.xml
index 5527bfd..ac0e629 100644
--- a/nifi-nar-bundles/nifi-image-bundle/nifi-image-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-image-bundle/nifi-image-nar/pom.xml
@@ -19,23 +19,23 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-image-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-image-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>nar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-image-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-image-viewer</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/pom.xml b/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/pom.xml
index 97763c0..04b7582 100644
--- a/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-image-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-image-processors</artifactId>
[14/50] [abbrv] nifi git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/nifi
Posted by tk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/nifi
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/b729bf4c
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/b729bf4c
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/b729bf4c
Branch: refs/heads/NIFI-1073
Commit: b729bf4c196e0fbd33692f76c11931aef61c650b
Parents: 6e193df cef7b6c
Author: Mark Payne <ma...@hotmail.com>
Authored: Sun Nov 1 14:16:54 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Sun Nov 1 14:16:54 2015 -0500
----------------------------------------------------------------------
.../nifi/processors/standard/InvokeHTTP.java | 21 +-
.../processors/standard/TestInvokeHTTP.java | 617 +-------------
.../processors/standard/TestInvokeHttpSSL.java | 90 ++
.../standard/util/TestInvokeHttpCommon.java | 830 +++++++++++++++++++
4 files changed, 972 insertions(+), 586 deletions(-)
----------------------------------------------------------------------
[18/50] [abbrv] nifi git commit: NIFI-730: - Updating logic now that
original is guaranteed to be non null. - Always reporting 100% once the drop
request has completed.
Posted by tk...@apache.org.
NIFI-730:
- Updating logic now that original is guaranteed to be non null.
- Always reporting 100% once the drop request has completed.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/5a04021d
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/5a04021d
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/5a04021d
Branch: refs/heads/NIFI-1073
Commit: 5a04021dd7a61cc7c76b24405288713116bcd682
Parents: f5727cf
Author: Matt Gilman <ma...@gmail.com>
Authored: Mon Nov 2 08:59:11 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Mon Nov 2 08:59:11 2015 -0500
----------------------------------------------------------------------
.../org/apache/nifi/web/api/dto/DtoFactory.java | 22 +++++++++++---------
1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/5a04021d/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
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 d34242d..5d437cf 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
@@ -296,6 +296,10 @@ public final class DtoFactory {
return new PositionDTO(position.getX(), position.getY());
}
+ private boolean isDropRequestComplete(final DropFlowFileState state) {
+ return DropFlowFileState.COMPLETE.equals(state) || DropFlowFileState.CANCELED.equals(state) || DropFlowFileState.FAILURE.equals(state);
+ }
+
/**
* Creates a DropRequestDTO from the specified flow file status.
*
@@ -309,9 +313,7 @@ public final class DtoFactory {
dto.setLastUpdated(new Date(dropRequest.getLastUpdated()));
dto.setState(dropRequest.getState().toString());
dto.setFailureReason(dropRequest.getFailureReason());
- dto.setFinished(DropFlowFileState.COMPLETE.equals(dropRequest.getState())
- || DropFlowFileState.CANCELED.equals(dropRequest.getState())
- || DropFlowFileState.FAILURE.equals(dropRequest.getState()));
+ dto.setFinished(isDropRequestComplete(dropRequest.getState()));
final QueueSize dropped = dropRequest.getDroppedSize();
dto.setDroppedCount(dropped.getObjectCount());
@@ -323,15 +325,15 @@ public final class DtoFactory {
dto.setCurrentSize(current.getByteCount());
dto.setCurrent(FormatUtils.formatCount(current.getObjectCount()) + " / " + FormatUtils.formatDataSize(current.getByteCount()));
- if (dropRequest.getOriginalSize() != null) {
- final QueueSize original = dropRequest.getOriginalSize();
- dto.setOriginalCount(original.getObjectCount());
- dto.setOriginalSize(original.getByteCount());
- dto.setOriginal(FormatUtils.formatCount(original.getObjectCount()) + " / " + FormatUtils.formatDataSize(original.getByteCount()));
+ final QueueSize original = dropRequest.getOriginalSize();
+ dto.setOriginalCount(original.getObjectCount());
+ dto.setOriginalSize(original.getByteCount());
+ dto.setOriginal(FormatUtils.formatCount(original.getObjectCount()) + " / " + FormatUtils.formatDataSize(original.getByteCount()));
- dto.setPercentCompleted((dropped.getObjectCount() * 100) / original.getObjectCount());
+ if (isDropRequestComplete(dropRequest.getState())) {
+ dto.setPercentCompleted(100);
} else {
- dto.setPercentCompleted(0);
+ dto.setPercentCompleted((dropped.getObjectCount() * 100) / original.getObjectCount());
}
return dto;
[34/50] [abbrv] nifi git commit: Removing nifi-azure-bundle that was
incorrectly added to master
Posted by tk...@apache.org.
Removing nifi-azure-bundle that was incorrectly added to master
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/4ac52bfc
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/4ac52bfc
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/4ac52bfc
Branch: refs/heads/NIFI-1073
Commit: 4ac52bfc0ab5572a308cb97e3124b563eab65194
Parents: f1bd3d4
Author: Bryan Bende <bb...@apache.org>
Authored: Thu Nov 5 10:42:10 2015 -0500
Committer: Bryan Bende <bb...@apache.org>
Committed: Thu Nov 5 10:42:10 2015 -0500
----------------------------------------------------------------------
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/.gitignore | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/4ac52bfc/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/.gitignore
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/.gitignore b/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/.gitignore
deleted file mode 100644
index ae3c172..0000000
--- a/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bin/
[05/50] [abbrv] nifi git commit: NIFI-1079 Check style and
documentation based updates recommended by user bbende on Github pull request
Posted by tk...@apache.org.
NIFI-1079 Check style and documentation based updates recommended by user bbende on Github pull request
Signed-off-by: Bryan Bende <bb...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/aef0d8fe
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/aef0d8fe
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/aef0d8fe
Branch: refs/heads/NIFI-1073
Commit: aef0d8fe9b994ce333d14083d7f39edc77622d72
Parents: 217b104
Author: Jeremy Dyer <jd...@gmail.com>
Authored: Fri Oct 30 12:37:11 2015 -0400
Committer: Bryan Bende <bb...@apache.org>
Committed: Fri Oct 30 14:30:42 2015 -0400
----------------------------------------------------------------------
.../processors/standard/AttributesToJSON.java | 74 ++++++++++++++------
.../standard/TestAttributesToJSON.java | 49 ++++++++-----
2 files changed, 86 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/aef0d8fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
index 950b8d3..89bb0b6 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
@@ -1,15 +1,40 @@
+/*
+ * 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 com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
-import org.apache.nifi.annotation.behavior.*;
+import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.behavior.SideEffectFree;
+import org.apache.nifi.annotation.behavior.SupportsBatching;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.flowfile.attributes.CoreAttributes;
-import org.apache.nifi.processor.*;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processor.io.StreamCallback;
import org.apache.nifi.processor.util.StandardValidators;
@@ -18,32 +43,38 @@ import org.apache.nifi.stream.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
@EventDriven
@SideEffectFree
@SupportsBatching
-@Tags({"json", "attributes"})
+@Tags({"json", "attributes", "flowfile"})
@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
-@CapabilityDescription("Evaluates the attributes from a FlowFile and generates a JSON string with the attribute key/value pair. " +
- "The resulting JSON string is placed in the FlowFile as a new Attribute with the name 'JSONAttributes'. By default all" +
- "Attributes in the FlowFile are placed in the resulting JSON string. If only certain Attributes are desired you may" +
- "specify a list of FlowFile Attributes that you want in the resulting JSON string")
-@WritesAttribute(attribute = "JSONAttributes", description = "JSON string of all the pre-existing attributes in the flowfile")
+@CapabilityDescription("Generates a JSON representation of the input FlowFile Attributes. The resulting JSON " +
+ "can be written to either a new Attribute 'JSONAttributes' or written to the FlowFile as content.")
+@WritesAttribute(attribute = "JSONAttributes", description = "JSON representation of Attributes")
public class AttributesToJSON extends AbstractProcessor {
- public static final String JSON_ATTRIBUTE_NAME = "JSONAttribute";
+ public static final String JSON_ATTRIBUTE_NAME = "JSONAttributes";
private static final String AT_LIST_SEPARATOR = ",";
public static final String DESTINATION_ATTRIBUTE = "flowfile-attribute";
public static final String DESTINATION_CONTENT = "flowfile-content";
+ private final String APPLICATION_JSON = "application/json";
public static final PropertyDescriptor ATTRIBUTES_LIST = new PropertyDescriptor.Builder()
.name("Attributes List")
- .description("Comma separated list of attributes to be included in the '" + JSON_ATTRIBUTE_NAME +"' " +
- "attribute. This list of attributes is case sensitive. If a specified attribute is not found" +
- "in the flowfile an empty string will be output for that attritbute in the resulting JSON")
+ .description("Comma separated list of attributes to be included in the resulting JSON. If this value " +
+ "is left empty then all existing Attributes will be included. This list of attributes is " +
+ "case sensitive. If an attribute specified in the list is not found it will be be emitted " +
+ "to the resulting JSON with an empty string or NULL value.")
.required(false)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.build();
@@ -51,8 +82,8 @@ public class AttributesToJSON extends AbstractProcessor {
public static final PropertyDescriptor DESTINATION = new PropertyDescriptor.Builder()
.name("Destination")
.description("Control if JSON value is written as a new flowfile attribute '" + JSON_ATTRIBUTE_NAME + "' " +
- "or written in the flowfile content. " +
- "Writing to flowfile content will overwrite any existing flowfile content.")
+ "or written in the flowfile content. Writing to flowfile content will overwrite any " +
+ "existing flowfile content.")
.required(true)
.allowableValues(DESTINATION_ATTRIBUTE, DESTINATION_CONTENT)
.defaultValue(DESTINATION_ATTRIBUTE)
@@ -68,9 +99,9 @@ public class AttributesToJSON extends AbstractProcessor {
.build();
public static final PropertyDescriptor NULL_VALUE_FOR_EMPTY_STRING = new PropertyDescriptor.Builder()
- .name("Null Value")
- .description("If an Attribute is value is empty or not present this property determines if an empty string" +
- "or true NULL value is present in the resulting JSON output")
+ .name(("If true a non existing or empty attribute will be NULL in the resulting JSON. If false an empty " +
+ "string will be placed in the JSON"))
+ .description("")
.required(true)
.allowableValues("true", "false")
.defaultValue("false")
@@ -78,9 +109,9 @@ public class AttributesToJSON extends AbstractProcessor {
public static final Relationship REL_SUCCESS = new Relationship.Builder().name("success")
- .description("'" + JSON_ATTRIBUTE_NAME + "' attribute has been successfully added to the flowfile").build();
+ .description("Successfully converted attributes to JSON").build();
public static final Relationship REL_FAILURE = new Relationship.Builder().name("failure")
- .description("Failed to add '" + JSON_ATTRIBUTE_NAME + "' attribute to the flowfile").build();
+ .description("Failed to convert attributes to JSON").build();
private List<PropertyDescriptor> properties;
private Set<Relationship> relationships;
@@ -116,7 +147,7 @@ public class AttributesToJSON extends AbstractProcessor {
* Builds the Map of attributes that should be included in the JSON that is emitted from this process.
*
* @return
- * Map<String, String> of values that are feed to a Jackson ObjectMapper
+ * Map of values that are feed to a Jackson ObjectMapper
*/
protected Map<String, String> buildAttributesMapForFlowFile(FlowFile ff, String atrList,
boolean includeCoreAttributes,
@@ -198,6 +229,7 @@ public class AttributesToJSON extends AbstractProcessor {
}
}
});
+ conFlowfile = session.putAttribute(conFlowfile, CoreAttributes.MIME_TYPE.key(), APPLICATION_JSON);
session.transfer(conFlowfile, REL_SUCCESS);
break;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/aef0d8fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
index 1624c4b..0f9ec26 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
@@ -1,3 +1,20 @@
+/*
+ * 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 com.fasterxml.jackson.databind.ObjectMapper;
@@ -63,8 +80,8 @@ public class TestAttributesToJSON {
testRunner.run();
//Expecting success transition because Jackson is taking care of escaping the bad JSON characters
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
@@ -93,8 +110,8 @@ public class TestAttributesToJSON {
testRunner.run();
//Expecting success transition because Jackson is taking care of escaping the bad JSON characters
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
@@ -123,8 +140,8 @@ public class TestAttributesToJSON {
testRunner.run();
//Expecting success transition because Jackson is taking care of escaping the bad JSON characters
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
}
@@ -143,8 +160,8 @@ public class TestAttributesToJSON {
testRunner.enqueue(ff);
testRunner.run();
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
@@ -169,8 +186,8 @@ public class TestAttributesToJSON {
testRunner.enqueue(ff);
testRunner.run();
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeNotExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeNotExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).assertContentEquals("{}");
@@ -190,8 +207,8 @@ public class TestAttributesToJSON {
testRunner.enqueue(ff);
testRunner.run();
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
@@ -218,8 +235,8 @@ public class TestAttributesToJSON {
testRunner.enqueue(ff);
testRunner.run();
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
@@ -246,8 +263,8 @@ public class TestAttributesToJSON {
testRunner.enqueue(ff);
testRunner.run();
- testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
- assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0)
+ .assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
[15/50] [abbrv] nifi git commit: NIFI-1090: Fixed log message that
was at info level but should have been debug level
Posted by tk...@apache.org.
NIFI-1090: Fixed log message that was at info level but should have been debug level
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/ad849c77
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/ad849c77
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/ad849c77
Branch: refs/heads/NIFI-1073
Commit: ad849c77dff7b379116f4d57510c7b9136c7f4c0
Parents: b729bf4
Author: Mark Payne <ma...@hotmail.com>
Authored: Sun Nov 1 14:37:01 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Sun Nov 1 14:37:01 2015 -0500
----------------------------------------------------------------------
.../nifi/controller/repository/FileSystemRepository.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/ad849c77/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
----------------------------------------------------------------------
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 72a50ec..5baddbb 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
@@ -1208,7 +1208,15 @@ public class FileSystemRepository implements ContentRepository {
final long startNanos = System.nanoTime();
final long toFree = minRequiredSpace - usableSpace;
final BlockingQueue<ArchiveInfo> fileQueue = archivedFiles.get(containerName);
- archiveExpirationLog.info("Currently {} bytes free for Container {}; requirement is {} byte free, so need to free {} bytes", usableSpace, containerName, minRequiredSpace, toFree);
+ if (archiveExpirationLog.isDebugEnabled()) {
+ if (toFree < 0) {
+ archiveExpirationLog.debug("Currently {} bytes free for Container {}; requirement is {} byte free, so no need to free space until an additional {} bytes are used",
+ usableSpace, containerName, minRequiredSpace, Math.abs(toFree));
+ } else {
+ archiveExpirationLog.debug("Currently {} bytes free for Container {}; requirement is {} byte free, so need to free {} bytes",
+ usableSpace, containerName, minRequiredSpace, toFree);
+ }
+ }
ArchiveInfo toDelete;
int deleteCount = 0;
[04/50] [abbrv] nifi git commit: NIFI-1079 Added Destination Property
to control if JSON goes to Attribute or Content of FlowFile. Added Include
Core Attributes Property to control if FlowFile CoreAttributes are included
in the JSON output or not. Added
Posted by tk...@apache.org.
NIFI-1079 Added Destination Property to control if JSON goes to Attribute or
Content of FlowFile. Added Include Core Attributes Property to control
if FlowFile CoreAttributes are included in the JSON output or not.
Added Null value for Empty String flag to control if empty values in
the JSON are empty string or true NULL values. Added more tests and
minor text refactoring per Github comments
Signed-off-by: Bryan Bende <bb...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/217b1049
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/217b1049
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/217b1049
Branch: refs/heads/NIFI-1073
Commit: 217b1049cf73c8ecef7dd76a954f07a7c7224cc6
Parents: 19b7a4c
Author: Jeremy Dyer <jd...@gmail.com>
Authored: Wed Oct 28 20:53:46 2015 -0400
Committer: Bryan Bende <bb...@apache.org>
Committed: Fri Oct 30 14:30:25 2015 -0400
----------------------------------------------------------------------
.../processors/standard/AttributesToJSON.java | 151 +++++++++++++++----
.../standard/TestAttributesToJSON.java | 116 ++++++++++++--
2 files changed, 224 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/217b1049/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
index 7098b6e..950b8d3 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
@@ -8,16 +8,22 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.flowfile.attributes.CoreAttributes;
import org.apache.nifi.processor.*;
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.stream.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.*;
@EventDriven
@SideEffectFree
@SupportsBatching
-@Tags({"JSON", "attributes"})
+@Tags({"json", "attributes"})
@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
@CapabilityDescription("Evaluates the attributes from a FlowFile and generates a JSON string with the attribute key/value pair. " +
"The resulting JSON string is placed in the FlowFile as a new Attribute with the name 'JSONAttributes'. By default all" +
@@ -28,16 +34,48 @@ public class AttributesToJSON extends AbstractProcessor {
public static final String JSON_ATTRIBUTE_NAME = "JSONAttribute";
private static final String AT_LIST_SEPARATOR = ",";
- private static final String DEFAULT_VALUE_IF_ATT_NOT_PRESENT = "";
+
+ public static final String DESTINATION_ATTRIBUTE = "flowfile-attribute";
+ public static final String DESTINATION_CONTENT = "flowfile-content";
+
public static final PropertyDescriptor ATTRIBUTES_LIST = new PropertyDescriptor.Builder()
.name("Attributes List")
- .description("Comma separated list of attributes to be included in the '" + JSON_ATTRIBUTE_NAME +"' attribute. This list of attributes is case sensitive. If a specified attribute is not found" +
+ .description("Comma separated list of attributes to be included in the '" + JSON_ATTRIBUTE_NAME +"' " +
+ "attribute. This list of attributes is case sensitive. If a specified attribute is not found" +
"in the flowfile an empty string will be output for that attritbute in the resulting JSON")
.required(false)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.build();
+ public static final PropertyDescriptor DESTINATION = new PropertyDescriptor.Builder()
+ .name("Destination")
+ .description("Control if JSON value is written as a new flowfile attribute '" + JSON_ATTRIBUTE_NAME + "' " +
+ "or written in the flowfile content. " +
+ "Writing to flowfile content will overwrite any existing flowfile content.")
+ .required(true)
+ .allowableValues(DESTINATION_ATTRIBUTE, DESTINATION_CONTENT)
+ .defaultValue(DESTINATION_ATTRIBUTE)
+ .build();
+
+ public static final PropertyDescriptor INCLUDE_CORE_ATTRIBUTES = new PropertyDescriptor.Builder()
+ .name("Include Core Attributes")
+ .description("Determines if the FlowFile org.apache.nifi.flowfile.attributes.CoreAttributes which are " +
+ "contained in every FlowFile should be included in the final JSON value generated.")
+ .required(true)
+ .allowableValues("true", "false")
+ .defaultValue("true")
+ .build();
+
+ public static final PropertyDescriptor NULL_VALUE_FOR_EMPTY_STRING = new PropertyDescriptor.Builder()
+ .name("Null Value")
+ .description("If an Attribute is value is empty or not present this property determines if an empty string" +
+ "or true NULL value is present in the resulting JSON output")
+ .required(true)
+ .allowableValues("true", "false")
+ .defaultValue("false")
+ .build();
+
public static final Relationship REL_SUCCESS = new Relationship.Builder().name("success")
.description("'" + JSON_ATTRIBUTE_NAME + "' attribute has been successfully added to the flowfile").build();
@@ -52,6 +90,9 @@ public class AttributesToJSON extends AbstractProcessor {
protected void init(final ProcessorInitializationContext context) {
final List<PropertyDescriptor> properties = new ArrayList<>();
properties.add(ATTRIBUTES_LIST);
+ properties.add(DESTINATION);
+ properties.add(INCLUDE_CORE_ATTRIBUTES);
+ properties.add(NULL_VALUE_FOR_EMPTY_STRING);
this.properties = Collections.unmodifiableList(properties);
final Set<Relationship> relationships = new HashSet<>();
@@ -70,48 +111,100 @@ public class AttributesToJSON extends AbstractProcessor {
return relationships;
}
- @Override
- public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
- final FlowFile original = session.get();
- if (original == null) {
- return;
- }
- final String atList = context.getProperty(ATTRIBUTES_LIST).getValue();
- Map<String, String> atsToWrite = null;
+ /**
+ * Builds the Map of attributes that should be included in the JSON that is emitted from this process.
+ *
+ * @return
+ * Map<String, String> of values that are feed to a Jackson ObjectMapper
+ */
+ protected Map<String, String> buildAttributesMapForFlowFile(FlowFile ff, String atrList,
+ boolean includeCoreAttributes,
+ boolean nullValForEmptyString) {
+
+ Map<String, String> atsToWrite = new HashMap<>();
//If list of attributes specified get only those attributes. Otherwise write them all
- if (atList != null && !StringUtils.isEmpty(atList)) {
- atsToWrite = new HashMap<>();
- String[] ats = StringUtils.split(atList, AT_LIST_SEPARATOR);
+ if (StringUtils.isNotBlank(atrList)) {
+ String[] ats = StringUtils.split(atrList, AT_LIST_SEPARATOR);
if (ats != null) {
for (String str : ats) {
String cleanStr = str.trim();
- String val = original.getAttribute(cleanStr);
+ String val = ff.getAttribute(cleanStr);
if (val != null) {
atsToWrite.put(cleanStr, val);
} else {
- atsToWrite.put(cleanStr, DEFAULT_VALUE_IF_ATT_NOT_PRESENT);
+ if (nullValForEmptyString) {
+ atsToWrite.put(cleanStr, null);
+ } else {
+ atsToWrite.put(cleanStr, "");
+ }
}
}
}
} else {
- atsToWrite = original.getAttributes();
+ atsToWrite.putAll(ff.getAttributes());
}
- if (atsToWrite != null) {
- if (atsToWrite.size() == 0) {
- getLogger().debug("Flowfile contains no attributes to convert to JSON");
- } else {
- try {
- FlowFile updated = session.putAttribute(original, JSON_ATTRIBUTE_NAME, objectMapper.writeValueAsString(atsToWrite));
- session.transfer(updated, REL_SUCCESS);
- } catch (JsonProcessingException e) {
- getLogger().error(e.getMessage());
- session.transfer(original, REL_FAILURE);
- }
- }
+ if (!includeCoreAttributes) {
+ atsToWrite = removeCoreAttributes(atsToWrite);
+ }
+
+ return atsToWrite;
+ }
+
+ /**
+ * Remove all of the CoreAttributes from the Attributes that will be written to the Flowfile.
+ *
+ * @param atsToWrite
+ * List of Attributes that have already been generated including the CoreAttributes
+ *
+ * @return
+ * Difference of all attributes minus the CoreAttributes
+ */
+ protected Map<String, String> removeCoreAttributes(Map<String, String> atsToWrite) {
+ for (CoreAttributes c : CoreAttributes.values()) {
+ atsToWrite.remove(c.key());
+ }
+ return atsToWrite;
+ }
+
+ @Override
+ public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
+ final FlowFile original = session.get();
+ if (original == null) {
+ return;
}
+ final Map<String, String> atrList = buildAttributesMapForFlowFile(original,
+ context.getProperty(ATTRIBUTES_LIST).getValue(),
+ context.getProperty(INCLUDE_CORE_ATTRIBUTES).asBoolean(),
+ context.getProperty(NULL_VALUE_FOR_EMPTY_STRING).asBoolean());
+
+ try {
+
+ switch (context.getProperty(DESTINATION).getValue()) {
+ case DESTINATION_ATTRIBUTE:
+ FlowFile atFlowfile = session.putAttribute(original, JSON_ATTRIBUTE_NAME,
+ objectMapper.writeValueAsString(atrList));
+ session.transfer(atFlowfile, REL_SUCCESS);
+ break;
+ case DESTINATION_CONTENT:
+ FlowFile conFlowfile = session.write(original, new StreamCallback() {
+ @Override
+ public void process(InputStream in, OutputStream out) throws IOException {
+ try (OutputStream outputStream = new BufferedOutputStream(out)) {
+ outputStream.write(objectMapper.writeValueAsBytes(atrList));
+ }
+ }
+ });
+ session.transfer(conFlowfile, REL_SUCCESS);
+ break;
+ }
+
+ } catch (JsonProcessingException e) {
+ getLogger().error(e.getMessage());
+ session.transfer(original, REL_FAILURE);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/217b1049/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
index a057d15..1624c4b 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
@@ -6,28 +6,17 @@ import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class TestAttributesToJSON {
- private static Logger LOGGER;
-
- static {
- System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "info");
- System.setProperty("org.slf4j.simpleLogger.showDateTime", "true");
- System.setProperty("org.slf4j.simpleLogger.log.nifi.io.nio", "debug");
- System.setProperty("org.slf4j.simpleLogger.log.nifi.processors.standard.AttributesToJSON", "debug");
- System.setProperty("org.slf4j.simpleLogger.log.nifi.processors.standard.TestAttributesToJSON", "debug");
- LOGGER = LoggerFactory.getLogger(TestAttributesToJSON.class);
- }
-
private static final String TEST_ATTRIBUTE_KEY = "TestAttribute";
private static final String TEST_ATTRIBUTE_VALUE = "TestValue";
@@ -45,9 +34,84 @@ public class TestAttributesToJSON {
testRunner.run();
}
+ @Test(expected = AssertionError.class)
+ public void testInvalidIncludeCoreAttributesProperty() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, "val1,val2");
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
+ testRunner.setProperty(AttributesToJSON.INCLUDE_CORE_ATTRIBUTES, "maybe");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+ }
+
+ @Test
+ public void testNullValueForEmptyAttribute() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
+ final String NON_PRESENT_ATTRIBUTE_KEY = "NonExistingAttributeKey";
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, NON_PRESENT_ATTRIBUTE_KEY);
+ testRunner.setProperty(AttributesToJSON.NULL_VALUE_FOR_EMPTY_STRING, "true");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ //Expecting success transition because Jackson is taking care of escaping the bad JSON characters
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+
+ //Make sure that the value is a true JSON null for the non existing attribute
+ String json = testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS)
+ .get(0).getAttribute(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, String> val = mapper.readValue(json, HashMap.class);
+
+ assertNull(val.get(NON_PRESENT_ATTRIBUTE_KEY));
+ }
+
+ @Test
+ public void testEmptyStringValueForEmptyAttribute() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
+ final String NON_PRESENT_ATTRIBUTE_KEY = "NonExistingAttributeKey";
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, NON_PRESENT_ATTRIBUTE_KEY);
+ testRunner.setProperty(AttributesToJSON.NULL_VALUE_FOR_EMPTY_STRING, "false");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ //Expecting success transition because Jackson is taking care of escaping the bad JSON characters
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+
+ //Make sure that the value is a true JSON null for the non existing attribute
+ String json = testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS)
+ .get(0).getAttribute(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, String> val = mapper.readValue(json, HashMap.class);
+
+ assertEquals(val.get(NON_PRESENT_ATTRIBUTE_KEY), "");
+ }
+
@Test
public void testInvalidJSONValueInAttribute() throws Exception {
final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
ProcessSession session = testRunner.getProcessSessionFactory().createSession();
FlowFile ff = session.create();
@@ -67,8 +131,9 @@ public class TestAttributesToJSON {
@Test
- public void testAttribuets_emptyListUserSpecifiedAttributes() throws Exception {
+ public void testAttributes_emptyListUserSpecifiedAttributes() throws Exception {
final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
ProcessSession session = testRunner.getProcessSessionFactory().createSession();
FlowFile ff = session.create();
@@ -93,9 +158,30 @@ public class TestAttributesToJSON {
@Test
+ public void testContent_emptyListUserSpecifiedAttributes() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_CONTENT);
+ testRunner.setProperty(AttributesToJSON.INCLUDE_CORE_ATTRIBUTES, "false");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeNotExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).assertContentEquals("{}");
+ }
+
+
+ @Test
public void testAttribute_singleUserDefinedAttribute() throws Exception {
final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, TEST_ATTRIBUTE_KEY);
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
ProcessSession session = testRunner.getProcessSessionFactory().createSession();
FlowFile ff = session.create();
@@ -123,6 +209,7 @@ public class TestAttributesToJSON {
public void testAttribute_singleUserDefinedAttributeWithWhiteSpace() throws Exception {
final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, " " + TEST_ATTRIBUTE_KEY + " ");
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
ProcessSession session = testRunner.getProcessSessionFactory().createSession();
FlowFile ff = session.create();
@@ -150,6 +237,7 @@ public class TestAttributesToJSON {
public void testAttribute_singleNonExistingUserDefinedAttribute() throws Exception {
final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, "NonExistingAttribute");
+ testRunner.setProperty(AttributesToJSON.DESTINATION, AttributesToJSON.DESTINATION_ATTRIBUTE);
ProcessSession session = testRunner.getProcessSessionFactory().createSession();
FlowFile ff = session.create();
[27/50] [abbrv] nifi git commit: NIFI-1103: Added InputRequirement
annotation
Posted by tk...@apache.org.
NIFI-1103: Added InputRequirement annotation
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/fedbe403
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/fedbe403
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/fedbe403
Branch: refs/heads/NIFI-1073
Commit: fedbe403131bc556e3d2d44947b0be5c5a74f10d
Parents: 2b1d093
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Nov 4 11:11:33 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Wed Nov 4 11:11:33 2015 -0500
----------------------------------------------------------------------
.../apache/nifi/processors/standard/PutDistributedMapCache.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/fedbe403/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java
index bc1fde5..addb278 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java
@@ -28,6 +28,8 @@ import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.annotation.behavior.EventDriven;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
import org.apache.nifi.annotation.behavior.SupportsBatching;
import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
@@ -54,6 +56,7 @@ import org.apache.nifi.processor.util.StandardValidators;
@EventDriven
@SupportsBatching
@Tags({"map", "cache", "put", "distributed"})
+@InputRequirement(Requirement.INPUT_REQUIRED)
@CapabilityDescription("Gets the content of a FlowFile and puts it to a distributed map cache, using a cache key " +
"computed from FlowFile attributes. If the cache already contains the entry and the cache update strategy is " +
"'keep original' the entry is not replaced.'")
[25/50] [abbrv] nifi git commit: NIFI-730: Completed merging of master
Posted by tk...@apache.org.
NIFI-730: Completed merging of master
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/dbf0c789
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/dbf0c789
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/dbf0c789
Branch: refs/heads/NIFI-1073
Commit: dbf0c7893fef964bfbb3a4c039c756396587ce12
Parents: e4cebba
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 2 14:31:28 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 14:31:28 2015 -0500
----------------------------------------------------------------------
.../apache/nifi/controller/FlowController.java | 73 +++++++++++---------
1 file changed, 40 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/dbf0c789/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
----------------------------------------------------------------------
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 701459c..a3246fd 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
@@ -16,39 +16,11 @@
*/
package org.apache.nifi.controller;
-import static java.util.Objects.requireNonNull;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import javax.net.ssl.SSLContext;
-
+import com.sun.jersey.api.client.ClientHandlerException;
+import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.action.Action;
+import org.apache.nifi.admin.service.AuditService;
+import org.apache.nifi.admin.service.UserService;
import org.apache.nifi.annotation.lifecycle.OnAdded;
import org.apache.nifi.annotation.lifecycle.OnRemoved;
import org.apache.nifi.annotation.lifecycle.OnShutdown;
@@ -141,6 +113,7 @@ import org.apache.nifi.groups.ProcessGroup;
import org.apache.nifi.groups.RemoteProcessGroup;
import org.apache.nifi.groups.RemoteProcessGroupPortDescriptor;
import org.apache.nifi.groups.StandardProcessGroup;
+import org.apache.nifi.history.History;
import org.apache.nifi.logging.ComponentLog;
import org.apache.nifi.logging.ControllerServiceLogObserver;
import org.apache.nifi.logging.LogLevel;
@@ -203,7 +176,36 @@ import org.apache.nifi.web.api.dto.status.StatusHistoryDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.sun.jersey.api.client.ClientHandlerException;
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import static java.util.Objects.requireNonNull;
public class FlowController implements EventAccess, ControllerServiceProvider, ReportingTaskProvider, Heartbeater, QueueProvider {
@@ -345,11 +347,13 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
final FlowFileEventRepository flowFileEventRepo,
final NiFiProperties properties,
final UserService userService,
+ final AuditService auditService,
final StringEncryptor encryptor) {
return new FlowController(
flowFileEventRepo,
properties,
userService,
+ auditService,
encryptor,
/* configuredForClustering */ false,
/* NodeProtocolSender */ null);
@@ -359,12 +363,14 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
final FlowFileEventRepository flowFileEventRepo,
final NiFiProperties properties,
final UserService userService,
+ final AuditService auditService,
final StringEncryptor encryptor,
final NodeProtocolSender protocolSender) {
final FlowController flowController = new FlowController(
flowFileEventRepo,
properties,
userService,
+ auditService,
encryptor,
/* configuredForClustering */ true,
/* NodeProtocolSender */ protocolSender);
@@ -378,6 +384,7 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
final FlowFileEventRepository flowFileEventRepo,
final NiFiProperties properties,
final UserService userService,
+ final AuditService auditService,
final StringEncryptor encryptor,
final boolean configuredForClustering,
final NodeProtocolSender protocolSender) {
[03/50] [abbrv] nifi git commit: NIFI-1079 Create a new Attribute
from the existing FlowFile attributes by taking either all of the existing
attributes or a user defined list. The existing Attributes are converted to
JSON and placed in a new Attribute on
Posted by tk...@apache.org.
NIFI-1079 Create a new Attribute from the existing FlowFile attributes by taking
either all of the existing attributes or a user defined list. The
existing Attributes are converted to JSON and placed in a new Attribute
on the existing FlowFile as Attribute “JSONAttributes”
Signed-off-by: Bryan Bende <bb...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/19b7a4cc
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/19b7a4cc
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/19b7a4cc
Branch: refs/heads/NIFI-1073
Commit: 19b7a4cc7de9da3366aa9c1a15b97c683242b4d0
Parents: 5cc2b04
Author: Jeremy Dyer <jd...@gmail.com>
Authored: Wed Oct 28 16:20:48 2015 -0400
Committer: Bryan Bende <bb...@apache.org>
Committed: Fri Oct 30 14:29:29 2015 -0400
----------------------------------------------------------------------
.../processors/standard/AttributesToJSON.java | 117 ++++++++++++
.../org.apache.nifi.processor.Processor | 1 +
.../standard/TestAttributesToJSON.java | 177 +++++++++++++++++++
3 files changed, 295 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/19b7a4cc/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
new file mode 100644
index 0000000..7098b6e
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AttributesToJSON.java
@@ -0,0 +1,117 @@
+package org.apache.nifi.processors.standard;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.*;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.*;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+
+import java.util.*;
+
+@EventDriven
+@SideEffectFree
+@SupportsBatching
+@Tags({"JSON", "attributes"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@CapabilityDescription("Evaluates the attributes from a FlowFile and generates a JSON string with the attribute key/value pair. " +
+ "The resulting JSON string is placed in the FlowFile as a new Attribute with the name 'JSONAttributes'. By default all" +
+ "Attributes in the FlowFile are placed in the resulting JSON string. If only certain Attributes are desired you may" +
+ "specify a list of FlowFile Attributes that you want in the resulting JSON string")
+@WritesAttribute(attribute = "JSONAttributes", description = "JSON string of all the pre-existing attributes in the flowfile")
+public class AttributesToJSON extends AbstractProcessor {
+
+ public static final String JSON_ATTRIBUTE_NAME = "JSONAttribute";
+ private static final String AT_LIST_SEPARATOR = ",";
+ private static final String DEFAULT_VALUE_IF_ATT_NOT_PRESENT = "";
+
+ public static final PropertyDescriptor ATTRIBUTES_LIST = new PropertyDescriptor.Builder()
+ .name("Attributes List")
+ .description("Comma separated list of attributes to be included in the '" + JSON_ATTRIBUTE_NAME +"' attribute. This list of attributes is case sensitive. If a specified attribute is not found" +
+ "in the flowfile an empty string will be output for that attritbute in the resulting JSON")
+ .required(false)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+
+ public static final Relationship REL_SUCCESS = new Relationship.Builder().name("success")
+ .description("'" + JSON_ATTRIBUTE_NAME + "' attribute has been successfully added to the flowfile").build();
+ public static final Relationship REL_FAILURE = new Relationship.Builder().name("failure")
+ .description("Failed to add '" + JSON_ATTRIBUTE_NAME + "' attribute to the flowfile").build();
+
+ private List<PropertyDescriptor> properties;
+ private Set<Relationship> relationships;
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+
+ @Override
+ protected void init(final ProcessorInitializationContext context) {
+ final List<PropertyDescriptor> properties = new ArrayList<>();
+ properties.add(ATTRIBUTES_LIST);
+ this.properties = Collections.unmodifiableList(properties);
+
+ final Set<Relationship> relationships = new HashSet<>();
+ relationships.add(REL_SUCCESS);
+ relationships.add(REL_FAILURE);
+ this.relationships = Collections.unmodifiableSet(relationships);
+ }
+
+ @Override
+ protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+ return properties;
+ }
+
+ @Override
+ public Set<Relationship> getRelationships() {
+ return relationships;
+ }
+
+ @Override
+ public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
+ final FlowFile original = session.get();
+ if (original == null) {
+ return;
+ }
+
+ final String atList = context.getProperty(ATTRIBUTES_LIST).getValue();
+ Map<String, String> atsToWrite = null;
+
+ //If list of attributes specified get only those attributes. Otherwise write them all
+ if (atList != null && !StringUtils.isEmpty(atList)) {
+ atsToWrite = new HashMap<>();
+ String[] ats = StringUtils.split(atList, AT_LIST_SEPARATOR);
+ if (ats != null) {
+ for (String str : ats) {
+ String cleanStr = str.trim();
+ String val = original.getAttribute(cleanStr);
+ if (val != null) {
+ atsToWrite.put(cleanStr, val);
+ } else {
+ atsToWrite.put(cleanStr, DEFAULT_VALUE_IF_ATT_NOT_PRESENT);
+ }
+ }
+ }
+ } else {
+ atsToWrite = original.getAttributes();
+ }
+
+ if (atsToWrite != null) {
+ if (atsToWrite.size() == 0) {
+ getLogger().debug("Flowfile contains no attributes to convert to JSON");
+ } else {
+ try {
+ FlowFile updated = session.putAttribute(original, JSON_ATTRIBUTE_NAME, objectMapper.writeValueAsString(atsToWrite));
+ session.transfer(updated, REL_SUCCESS);
+ } catch (JsonProcessingException e) {
+ getLogger().error(e.getMessage());
+ session.transfer(original, REL_FAILURE);
+ }
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/nifi/blob/19b7a4cc/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
index b12fb6f..8507c96 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
@@ -12,6 +12,7 @@
# 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.
+org.apache.nifi.processors.standard.AttributesToJSON
org.apache.nifi.processors.standard.Base64EncodeContent
org.apache.nifi.processors.standard.CompressContent
org.apache.nifi.processors.standard.ControlRate
http://git-wip-us.apache.org/repos/asf/nifi/blob/19b7a4cc/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
new file mode 100644
index 0000000..a057d15
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToJSON.java
@@ -0,0 +1,177 @@
+package org.apache.nifi.processors.standard;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertTrue;
+
+
+public class TestAttributesToJSON {
+
+ private static Logger LOGGER;
+
+ static {
+ System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "info");
+ System.setProperty("org.slf4j.simpleLogger.showDateTime", "true");
+ System.setProperty("org.slf4j.simpleLogger.log.nifi.io.nio", "debug");
+ System.setProperty("org.slf4j.simpleLogger.log.nifi.processors.standard.AttributesToJSON", "debug");
+ System.setProperty("org.slf4j.simpleLogger.log.nifi.processors.standard.TestAttributesToJSON", "debug");
+ LOGGER = LoggerFactory.getLogger(TestAttributesToJSON.class);
+ }
+
+ private static final String TEST_ATTRIBUTE_KEY = "TestAttribute";
+ private static final String TEST_ATTRIBUTE_VALUE = "TestValue";
+
+ @Test(expected = AssertionError.class)
+ public void testInvalidUserSuppliedAttributeList() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+
+ //Attribute list CANNOT be empty
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, "");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+ }
+
+ @Test
+ public void testInvalidJSONValueInAttribute() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ //Create attribute that contains an invalid JSON Character
+ ff = session.putAttribute(ff, TEST_ATTRIBUTE_KEY, "'badjson'");
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ //Expecting success transition because Jackson is taking care of escaping the bad JSON characters
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+ }
+
+
+ @Test
+ public void testAttribuets_emptyListUserSpecifiedAttributes() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+
+ ff = session.putAttribute(ff, TEST_ATTRIBUTE_KEY, TEST_ATTRIBUTE_VALUE);
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+
+ String json = testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS)
+ .get(0).getAttribute(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, String> val = mapper.readValue(json, HashMap.class);
+ assertTrue(val.get(TEST_ATTRIBUTE_KEY).equals(TEST_ATTRIBUTE_VALUE));
+ }
+
+
+ @Test
+ public void testAttribute_singleUserDefinedAttribute() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, TEST_ATTRIBUTE_KEY);
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+ ff = session.putAttribute(ff, TEST_ATTRIBUTE_KEY, TEST_ATTRIBUTE_VALUE);
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+
+ String json = testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS)
+ .get(0).getAttribute(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, String> val = mapper.readValue(json, HashMap.class);
+ assertTrue(val.get(TEST_ATTRIBUTE_KEY).equals(TEST_ATTRIBUTE_VALUE));
+ assertTrue(val.size() == 1);
+ }
+
+
+ @Test
+ public void testAttribute_singleUserDefinedAttributeWithWhiteSpace() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, " " + TEST_ATTRIBUTE_KEY + " ");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+ ff = session.putAttribute(ff, TEST_ATTRIBUTE_KEY, TEST_ATTRIBUTE_VALUE);
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+
+ String json = testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS)
+ .get(0).getAttribute(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, String> val = mapper.readValue(json, HashMap.class);
+ assertTrue(val.get(TEST_ATTRIBUTE_KEY).equals(TEST_ATTRIBUTE_VALUE));
+ assertTrue(val.size() == 1);
+ }
+
+
+ @Test
+ public void testAttribute_singleNonExistingUserDefinedAttribute() throws Exception {
+ final TestRunner testRunner = TestRunners.newTestRunner(new AttributesToJSON());
+ testRunner.setProperty(AttributesToJSON.ATTRIBUTES_LIST, "NonExistingAttribute");
+
+ ProcessSession session = testRunner.getProcessSessionFactory().createSession();
+ FlowFile ff = session.create();
+ ff = session.putAttribute(ff, TEST_ATTRIBUTE_KEY, TEST_ATTRIBUTE_VALUE);
+
+ testRunner.enqueue(ff);
+ testRunner.run();
+
+ testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS).get(0).
+ assertAttributeExists(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+ testRunner.assertTransferCount(AttributesToJSON.REL_SUCCESS, 1);
+ testRunner.assertTransferCount(AttributesToJSON.REL_FAILURE, 0);
+
+ String json = testRunner.getFlowFilesForRelationship(AttributesToJSON.REL_SUCCESS)
+ .get(0).getAttribute(AttributesToJSON.JSON_ATTRIBUTE_NAME);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, String> val = mapper.readValue(json, HashMap.class);
+
+ //If a Attribute is requested but does not exist then it is placed in the JSON with an empty string
+ assertTrue(val.get("NonExistingAttribute").equals(""));
+ assertTrue(val.size() == 1);
+ }
+
+}
[40/50] [abbrv] nifi git commit: NIFI-1122 moved to 0.4.0-SNAPSHOT
Posted by tk...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-image-bundle/nifi-image-viewer/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-image-bundle/nifi-image-viewer/pom.xml b/nifi-nar-bundles/nifi-image-bundle/nifi-image-viewer/pom.xml
index d8b20da..282fd4e 100755
--- a/nifi-nar-bundles/nifi-image-bundle/nifi-image-viewer/pom.xml
+++ b/nifi-nar-bundles/nifi-image-bundle/nifi-image-viewer/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-image-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-image-viewer</artifactId>
<description>NiFi image viewer</description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-image-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-image-bundle/pom.xml b/nifi-nar-bundles/nifi-image-bundle/pom.xml
index 2a5836f..2ac4536 100644
--- a/nifi-nar-bundles/nifi-image-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-image-bundle/pom.xml
@@ -19,11 +19,11 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-image-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-jetty-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-jetty-bundle/pom.xml b/nifi-nar-bundles/nifi-jetty-bundle/pom.xml
index 3cdb3b8..c388e2f 100644
--- a/nifi-nar-bundles/nifi-jetty-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-jetty-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-jetty-bundle</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-nar/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-nar/pom.xml
index 27423a8..6f5a9fa 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kafka-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-kafka-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/pom.xml
index ff10c09..c2e86fe 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kafka-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>nifi-kafka-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-kafka-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/pom.xml
index 39442dd..147d3bd 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-kafka-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-kafka-bundle</artifactId>
<packaging>pom</packaging>
@@ -30,7 +30,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kafka-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/pom.xml b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/pom.xml
index bb5c13f..350b7bc 100644
--- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kite-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-kite-nar</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml
index ed201e5..47bc2de 100644
--- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kite-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-kite-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-kite-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-kite-bundle/pom.xml b/nifi-nar-bundles/nifi-kite-bundle/pom.xml
index f0b32fc..4d30cbc 100644
--- a/nifi-nar-bundles/nifi-kite-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-kite-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-kite-bundle</artifactId>
@@ -36,7 +36,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kite-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/pom.xml b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/pom.xml
index 3c85358..5d18981 100644
--- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-language-translation-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-language-translation-nar</artifactId>
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-yandex-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml
index 639120a..a67e1f5 100644
--- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-language-translation-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-yandex-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml b/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml
index c0cc967..e7ed3ce 100644
--- a/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-language-translation-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/pom.xml b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/pom.xml
index 85e9714..cc8d7b9 100644
--- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/pom.xml
@@ -19,18 +19,18 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mongodb-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-mongodb-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>nar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mongodb-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml
index 82101e0..9a9042e 100644
--- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mongodb-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-mongodb-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-mongodb-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/pom.xml b/nifi-nar-bundles/nifi-mongodb-bundle/pom.xml
index cd72cf1..b3a0ca1 100644
--- a/nifi-nar-bundles/nifi-mongodb-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-mongodb-bundle/pom.xml
@@ -19,12 +19,12 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mongodb-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/pom.xml b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/pom.xml
index a3604f6..b6573fb 100644
--- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/pom.xml
+++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-provenance-repository-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-persistent-provenance-repository</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-provenance-repository-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-provenance-repository-nar/pom.xml b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-provenance-repository-nar/pom.xml
index 0f20880..c776259 100644
--- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-provenance-repository-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-provenance-repository-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-provenance-repository-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-provenance-repository-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/pom.xml b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/pom.xml
index 0ef7190..8963d3e 100644
--- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/pom.xml
+++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-volatile-provenance-repository/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-provenance-repository-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-volatile-provenance-repository</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml b/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml
index 679d41a..69fafcc 100644
--- a/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-provenance-repository-bundle</artifactId>
<packaging>pom</packaging>
@@ -31,12 +31,12 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-persistent-provenance-repository</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-volatile-provenance-repository</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-social-media-bundle/nifi-social-media-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-social-media-bundle/nifi-social-media-nar/pom.xml b/nifi-nar-bundles/nifi-social-media-bundle/nifi-social-media-nar/pom.xml
index b1321e3..2c39f50 100644
--- a/nifi-nar-bundles/nifi-social-media-bundle/nifi-social-media-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-social-media-bundle/nifi-social-media-nar/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-social-media-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-social-media-nar</artifactId>
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-twitter-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-social-media-bundle/nifi-twitter-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-social-media-bundle/nifi-twitter-processors/pom.xml b/nifi-nar-bundles/nifi-social-media-bundle/nifi-twitter-processors/pom.xml
index 86016f1..9a47517 100644
--- a/nifi-nar-bundles/nifi-social-media-bundle/nifi-twitter-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-social-media-bundle/nifi-twitter-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-social-media-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-twitter-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-social-media-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-social-media-bundle/pom.xml b/nifi-nar-bundles/nifi-social-media-bundle/pom.xml
index f4597e3..76e1fe8 100644
--- a/nifi-nar-bundles/nifi-social-media-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-social-media-bundle/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-social-media-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/pom.xml b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/pom.xml
index 44b0e1f..f5f3ff9 100644
--- a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-solr-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-solr-nar</artifactId>
@@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-solr-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/pom.xml b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/pom.xml
index a906f9a..0901f91 100644
--- a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-solr-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-solr-processors</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-solr-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-solr-bundle/pom.xml b/nifi-nar-bundles/nifi-solr-bundle/pom.xml
index 8e369e0..1f6fd6f 100644
--- a/nifi-nar-bundles/nifi-solr-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-solr-bundle/pom.xml
@@ -19,7 +19,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-solr-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
index 344b52a..a6747a0 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-content-viewer</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-nar/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-nar/pom.xml
index e513eee..39a4464 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-standard-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/pom.xml
index ede0d13..5c2dc58 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-prioritizers</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
index 4ee382f..2d93944 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml
@@ -14,7 +14,7 @@ language governing permissions and limitations under the License. -->
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-standard-processors</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/pom.xml
index 18e307c..d6efadd 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-standard-reporting-tasks</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/pom.xml
index 19c3c20..5a78127 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-standard-bundle</artifactId>
<packaging>pom</packaging>
@@ -35,23 +35,23 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-processors</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-prioritizers</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-reporting-tasks</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-content-viewer</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-api/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-api/pom.xml
index eb457b5..7df6539 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-api/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-api/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-dbcp-service-api</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/pom.xml
index 63d9e39..2cc55bb 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-dbcp-service-nar</artifactId>
@@ -31,7 +31,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
index 1da9d26..f1c8a2e 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-dbcp-service</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/pom.xml
index f74daac..e2869c8 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-dbcp-service-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/pom.xml
index 33cc5b0..b7ee726 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-distributed-cache-client-service-api</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
index e54b49d..e05f4dc 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-services-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-distributed-cache-client-service</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/pom.xml
index 5ede7b0..133c14b 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-protocol/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-services-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-distributed-cache-protocol</artifactId>
<description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/pom.xml
index 5888e3a..69f2d19 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-services-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-distributed-cache-server</artifactId>
<description>Provides a Controller Service for hosting Distributed Caches</description>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-services-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-services-nar/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-services-nar/pom.xml
index f4dc2da..947d5e2 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-services-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-services-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-services-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-distributed-cache-services-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/pom.xml
index e74fcf9..2f45205 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-distributed-cache-services-bundle</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-api/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-api/pom.xml
index e94c4ba..1b3f689 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-api/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-api/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-http-context-map-api</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map-nar/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map-nar/pom.xml
index 25e310e..a8ca678 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-http-context-map-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-http-context-map-nar</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map/pom.xml
index a818b41..0f1949a 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/nifi-http-context-map/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-http-context-map-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-http-context-map</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/pom.xml
index 39a4130..eba47c2 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-http-context-map-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-http-context-map-bundle</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-load-distribution-service-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-load-distribution-service-api/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-load-distribution-service-api/pom.xml
index d77a35b..6426da2 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-load-distribution-service-api/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-load-distribution-service-api/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-load-distribution-service-api</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-nar/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-nar/pom.xml
index c1cf658..9a95bec 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ssl-context-service-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/pom.xml
index c58652f..0aaf9fe 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ssl-context-service</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/pom.xml
index dc5ddef..4ce903b 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ssl-context-bundle</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-service-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-service-api/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-service-api/pom.xml
index ea45a33..e479891 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-service-api/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-service-api/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-ssl-context-service-api</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml
index d2efc1b..eb2eb7e 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-standard-services-api-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-standard-services/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/pom.xml b/nifi-nar-bundles/nifi-standard-services/pom.xml
index 3e27a66..17318f4 100644
--- a/nifi-nar-bundles/nifi-standard-services/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-standard-services</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/pom.xml
index 5d0b1f1..3b8eb9d 100644
--- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/pom.xml
+++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-model/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-model</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-nar/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-nar/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-nar/pom.xml
index 6cdbbdb..a1f7a44 100644
--- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-nar/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-update-attribute-nar</artifactId>
<packaging>nar</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml
index 7f7f722..c648b73 100644
--- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml
+++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-processor</artifactId>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml
index ad5d7cd..a13545d 100644
--- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml
+++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-update-attribute-ui</artifactId>
<packaging>war</packaging>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/nifi-update-attribute-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/pom.xml
index 744a337..fa86f81 100644
--- a/nifi-nar-bundles/nifi-update-attribute-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-update-attribute-bundle/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<artifactId>nifi-update-attribute-bundle</artifactId>
<packaging>pom</packaging>
@@ -34,18 +34,18 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-model</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-processor</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-ui</artifactId>
<type>war</type>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/nifi-nar-bundles/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/pom.xml b/nifi-nar-bundles/pom.xml
index d48b755..ce93109 100644
--- a/nifi-nar-bundles/pom.xml
+++ b/nifi-nar-bundles/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
@@ -52,81 +52,81 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-client-service</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-client-service-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-service-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-load-distribution-service-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-http-context-map-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-protocol</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-server</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-service</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-http-context-map</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-volatile-provenance-repository</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<!-- The following dependencies are marked provided because they must be provided by the container. Nars can assume they are there-->
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-runtime</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-properties</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/nifi/blob/99629646/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 74dc4a9..ded7257 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
</parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Apache NiFi is an easy to use, powerful, and reliable system to process and distribute data.</description>
<modules>
@@ -683,67 +683,67 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-site-to-site-client</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-expression-language</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-custom-ui-utilities</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ui-extension</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-flowfile-packager</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-socket-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-data-provenance-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-runtime</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-bootstrap</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-resources</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<classifier>resources</classifier>
<scope>runtime</scope>
<type>zip</type>
@@ -751,7 +751,7 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-docs</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<classifier>resources</classifier>
<scope>runtime</scope>
<type>zip</type>
@@ -759,204 +759,204 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-provenance-repository-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services-api-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-service-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-distributed-cache-services-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-jetty-bundle</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-update-attribute-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hadoop-libraries-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hadoop-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kite-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mongodb-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-solr-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kafka-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-http-context-map-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-social-media-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-hl7-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-language-translation-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-geo-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-aws-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-flume-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ambari-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-avro-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-image-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-couchbase-nar</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-properties</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-security-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-logging-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-processor-utils</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mock</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-write-ahead-log</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service-api</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
[46/50] [abbrv] nifi git commit: NIFI-1073 a couple closes that are
probably noops as they were implemented
Posted by tk...@apache.org.
NIFI-1073 a couple closes that are probably noops as they were implemented
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/4e8e2d09
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/4e8e2d09
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/4e8e2d09
Branch: refs/heads/NIFI-1073
Commit: 4e8e2d09e3fdb169f9d4f2c42ffae9562a1e9afa
Parents: e44e89c
Author: Tony Kurc <tr...@gmail.com>
Authored: Mon Oct 26 21:56:12 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 21:11:34 2015 -0500
----------------------------------------------------------------------
.../cluster/manager/impl/WebClusterManager.java | 14 ++++++++------
.../org/apache/nifi/web/server/JettyServer.java | 19 ++++++++++++-------
2 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/4e8e2d09/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
index 8d246c1..01f11b1 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
@@ -189,6 +189,7 @@ import org.apache.nifi.util.FormatUtils;
import org.apache.nifi.util.NiFiProperties;
import org.apache.nifi.util.ObjectHolder;
import org.apache.nifi.util.ReflectionUtils;
+import org.apache.nifi.util.file.FileUtils;
import org.apache.nifi.web.OptimisticLockingManager;
import org.apache.nifi.web.Revision;
import org.apache.nifi.web.UpdateRevision;
@@ -3401,15 +3402,16 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
completionService.submit(new Runnable() {
@Override
public void run() {
+ final OutputStream drain = new OutputStream() {
+ @Override
+ public void write(final int b) { /* drain response */ }
+ };
try {
- ((StreamingOutput) nodeResponse.getResponse().getEntity()).write(
- new OutputStream() {
- @Override
- public void write(final int b) { /* drain response */ }
- }
- );
+ ((StreamingOutput) nodeResponse.getResponse().getEntity()).write(drain);
} catch (final IOException | WebApplicationException ex) {
logger.info("Failed clearing out non-client response buffer due to: " + ex, ex);
+ } finally {
+ FileUtils.closeQuietly(drain);
}
}
}, null);
http://git-wip-us.apache.org/repos/asf/nifi/blob/4e8e2d09/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
index 99c11a8..73cf7c5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
@@ -38,8 +38,10 @@ import java.util.Map;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+
import javax.servlet.DispatcherType;
import javax.servlet.ServletContext;
+
import org.apache.nifi.NiFiServer;
import org.apache.nifi.controller.FlowSerializationException;
import org.apache.nifi.controller.FlowSynchronizationException;
@@ -49,6 +51,7 @@ import org.apache.nifi.nar.ExtensionMapping;
import org.apache.nifi.nar.NarClassLoaders;
import org.apache.nifi.services.FlowService;
import org.apache.nifi.util.NiFiProperties;
+import org.apache.nifi.util.file.FileUtils;
import org.apache.nifi.web.NiFiWebContext;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -438,6 +441,7 @@ public class JettyServer implements NiFiServer {
private List<String> getWarExtensions(final File war, final String path) {
List<String> processorTypes = new ArrayList<>();
JarFile jarFile = null;
+ BufferedReader in = null;
try {
// load the jar file and attempt to find the nifi-processor entry
jarFile = new JarFile(war);
@@ -446,7 +450,7 @@ public class JettyServer implements NiFiServer {
// ensure the nifi-processor entry was found
if (jarEntry != null) {
// get an input stream for the nifi-processor configuration file
- BufferedReader in = new BufferedReader(new InputStreamReader(jarFile.getInputStream(jarEntry)));
+ in = new BufferedReader(new InputStreamReader(jarFile.getInputStream(jarEntry)));
// read in each configured type
String rawProcessorType;
@@ -461,12 +465,13 @@ public class JettyServer implements NiFiServer {
} catch (IOException ioe) {
logger.warn(String.format("Unable to inspect %s for a custom processor UI.", war));
} finally {
- try {
- // close the jar file - which closes all input streams obtained via getInputStream above
- if (jarFile != null) {
- jarFile.close();
- }
- } catch (IOException ioe) {
+ // close the jar file - which closes all input streams obtained via getInputStream above
+ if (jarFile != null) {
+ FileUtils.closeQuietly(jarFile);
+ }
+ // close the BufferedReader, this may not be strictly necessary
+ if (in != null){
+ FileUtils.closeQuietly(in);
}
}
[47/50] [abbrv] nifi git commit: NIFI-1073 fixed possible,
but not realistic, resource leak in DistributedMapCacheClientService
Posted by tk...@apache.org.
NIFI-1073 fixed possible, but not realistic, resource leak in DistributedMapCacheClientService
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/e44e89cf
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/e44e89cf
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/e44e89cf
Branch: refs/heads/NIFI-1073
Commit: e44e89cf7b49cb236416b14455ecb71dcf5d2793
Parents: 35723d9
Author: Tony Kurc <tr...@gmail.com>
Authored: Mon Oct 26 21:35:45 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 21:11:34 2015 -0500
----------------------------------------------------------------------
.../nifi/controller/repository/VolatileContentRepository.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/e44e89cf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
index 7c7cade..0451812 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
@@ -50,6 +50,7 @@ import org.apache.nifi.processor.DataUnit;
import org.apache.nifi.stream.io.ByteArrayInputStream;
import org.apache.nifi.stream.io.StreamUtils;
import org.apache.nifi.util.NiFiProperties;
+import org.apache.nifi.util.file.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -407,8 +408,12 @@ public class VolatileContentRepository implements ContentRepository {
@Override
public long exportTo(ContentClaim claim, OutputStream destination, long offset, long length) throws IOException {
final InputStream in = read(claim);
+ try {
StreamUtils.skip(in, offset);
StreamUtils.copy(in, destination, length);
+ } finally {
+ FileUtils.closeQuietly(in);
+ }
return length;
}
[13/50] [abbrv] nifi git commit: Merge branch 'NIFI-1088'
Posted by tk...@apache.org.
Merge branch 'NIFI-1088'
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/6e193dff
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/6e193dff
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/6e193dff
Branch: refs/heads/NIFI-1073
Commit: 6e193dffa349b1f7627441489b8208666bea684a
Parents: 9c148da 9515b74
Author: Mark Payne <ma...@hotmail.com>
Authored: Sun Nov 1 14:16:35 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Sun Nov 1 14:16:35 2015 -0500
----------------------------------------------------------------------
.../main/java/org/apache/nifi/processors/kafka/PutKafka.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[42/50] [abbrv] nifi git commit: NIFI-1025 Updated aws-sdk and
joda-time to resolve AWS issues with Java 1.8 update 60. - Refactored tests -
created AbstractS3Test for common utility methods - Corrected incorrect unit
test in TestDeleteS3Object, and ad
Posted by tk...@apache.org.
NIFI-1025 Updated aws-sdk and joda-time to resolve AWS issues with Java 1.8 update 60.
- Refactored tests - created AbstractS3Test for common utility methods
- Corrected incorrect unit test in TestDeleteS3Object, and adjusted processor documentation to reflect behavior
- moved aws dependency management to root pom
This closes #107
Tested, Reviewed and Amended by Tony Kurc (<tk...@apache.org>)
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/77de51df
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/77de51df
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/77de51df
Branch: refs/heads/NIFI-1073
Commit: 77de51df19b768ea1180d52e0e6106629161add0
Parents: 9962964
Author: Venkatesh Sellappa <vs...@outlook.com>
Authored: Sat Nov 7 21:09:18 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sat Nov 7 21:09:18 2015 -0500
----------------------------------------------------------------------
.../nifi/processors/aws/s3/DeleteS3Object.java | 3 +-
.../nifi/processors/aws/s3/AbstractS3Test.java | 151 +++++++++++++++++++
.../processors/aws/s3/TestDeleteS3Object.java | 118 ++++++---------
.../processors/aws/s3/TestFetchS3Object.java | 55 +++++--
.../nifi/processors/aws/s3/TestPutS3Object.java | 42 +++---
nifi-nar-bundles/nifi-aws-bundle/pom.xml | 10 --
pom.xml | 7 +-
7 files changed, 273 insertions(+), 113 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java
index 836e0d8..056ff01 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java
@@ -41,7 +41,7 @@ import org.apache.nifi.processor.util.StandardValidators;
@SeeAlso({PutS3Object.class})
@Tags({"Amazon", "S3", "AWS", "Archive", "Delete"})
@CapabilityDescription("Deletes FlowFiles on an Amazon S3 Bucket. " +
- "And the FlowFiles are checked if exists or not before deleting.")
+ "If attempting to delete a file that does not exist, FlowFile is routed to success.")
public class DeleteS3Object extends AbstractS3Processor {
public static final PropertyDescriptor VERSION_ID = new PropertyDescriptor.Builder()
@@ -80,6 +80,7 @@ public class DeleteS3Object extends AbstractS3Processor {
try {
if (versionId == null) {
final DeleteObjectRequest r = new DeleteObjectRequest(bucket, key);
+ // This call returns success if object doesn't exist
s3.deleteObject(r);
} else {
final DeleteVersionRequest r = new DeleteVersionRequest(bucket, key, versionId);
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/AbstractS3Test.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/AbstractS3Test.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/AbstractS3Test.java
new file mode 100644
index 0000000..167c16b
--- /dev/null
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/AbstractS3Test.java
@@ -0,0 +1,151 @@
+/*
+ * 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.aws.s3;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Iterator;
+
+import org.apache.nifi.util.file.FileUtils;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import static org.junit.Assert.fail;
+
+import com.amazonaws.auth.PropertiesCredentials;
+import com.amazonaws.services.s3.AmazonS3Client;
+import com.amazonaws.services.s3.model.AmazonS3Exception;
+import com.amazonaws.services.s3.model.CreateBucketRequest;
+import com.amazonaws.services.s3.model.DeleteBucketRequest;
+import com.amazonaws.services.s3.model.ObjectListing;
+import com.amazonaws.services.s3.model.PutObjectRequest;
+import com.amazonaws.services.s3.model.S3ObjectSummary;
+
+/**
+ * Base class for S3 tests. Establishes a bucket and helper methods for creating test scenarios
+ */
+public abstract class AbstractS3Test {
+ protected final static String CREDENTIALS_FILE = System.getProperty("user.home") + "/aws-credentials.properties";
+ protected final static String BUCKET_NAME = "test-bucket-00000000-0000-0000-0000-123456789021";
+ protected final static String SAMPLE_FILE_RESOURCE_NAME = "/hello.txt";
+ protected final static String REGION = "eu-west-1";
+
+ // Static so multiple Tests can use same client
+ protected static AmazonS3Client client;
+
+ @BeforeClass
+ public static void oneTimeSetup() {
+ // Creates a client and bucket for this test
+
+ final FileInputStream fis;
+ try {
+ fis = new FileInputStream(CREDENTIALS_FILE);
+ } catch (FileNotFoundException e1) {
+ fail("Could not open credentials file " + CREDENTIALS_FILE + ": " + e1.getLocalizedMessage());
+ return;
+ }
+ try {
+ final PropertiesCredentials credentials = new PropertiesCredentials(fis);
+ client = new AmazonS3Client(credentials);
+
+ if (client.doesBucketExist(BUCKET_NAME)) {
+ fail("Bucket " + BUCKET_NAME + " exists. Choose a different bucket name to continue test");
+ }
+
+ CreateBucketRequest request = new CreateBucketRequest(BUCKET_NAME, REGION);
+ client.createBucket(request);
+
+ } catch (final AmazonS3Exception e) {
+ fail("Can't create the key " + BUCKET_NAME + ": " + e.getLocalizedMessage());
+ } catch (final IOException e) {
+ fail("Caught IOException preparing tests: " + e.getLocalizedMessage());
+ } finally {
+ FileUtils.closeQuietly(fis);
+ }
+
+ if (!client.doesBucketExist(BUCKET_NAME)) {
+ fail("Setup incomplete, tests will fail");
+ }
+ }
+
+ @AfterClass
+ public static void oneTimeTearDown() {
+ // Empty the bucket before deleting it.
+ try {
+ ObjectListing objectListing = client.listObjects(BUCKET_NAME);
+
+ while (true) {
+ for (Iterator<?> iterator = objectListing.getObjectSummaries().iterator(); iterator.hasNext(); ) {
+ S3ObjectSummary objectSummary = (S3ObjectSummary) iterator.next();
+ client.deleteObject(BUCKET_NAME, objectSummary.getKey());
+ }
+
+ if (objectListing.isTruncated()) {
+ objectListing = client.listNextBatchOfObjects(objectListing);
+ } else {
+ break;
+ }
+ }
+
+ DeleteBucketRequest dbr = new DeleteBucketRequest(BUCKET_NAME);
+ client.deleteBucket(dbr);
+ } catch (final AmazonS3Exception e) {
+ System.err.println("Unable to delete bucket " + BUCKET_NAME + e.toString());
+ }
+
+ if (client.doesBucketExist(BUCKET_NAME)) {
+ Assert.fail("Incomplete teardown, subsequent tests might fail");
+ }
+
+ }
+
+ protected void putTestFile(String key, File file) throws AmazonS3Exception {
+ PutObjectRequest putRequest = new PutObjectRequest(BUCKET_NAME, key, file);
+
+ client.putObject(putRequest);
+ }
+
+ protected Path getResourcePath(String resourceName) {
+ Path path = null;
+
+ try {
+ path = Paths.get(getClass().getResource(resourceName).toURI());
+ } catch (URISyntaxException e) {
+ Assert.fail("Resource: " + resourceName + " does not exist" + e.getLocalizedMessage());
+ }
+
+ return path;
+ }
+
+ protected File getFileFromResourceName(String resourceName) {
+ URI uri = null;
+ try {
+ uri = this.getClass().getResource(resourceName).toURI();
+ } catch (URISyntaxException e) {
+ Assert.fail("Cannot proceed without File : " + resourceName);
+ }
+
+ return new File(uri);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestDeleteS3Object.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestDeleteS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestDeleteS3Object.java
index 509a31f..643aa11 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestDeleteS3Object.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestDeleteS3Object.java
@@ -16,97 +16,74 @@
*/
package org.apache.nifi.processors.aws.s3;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
-import java.net.URL;
import java.util.HashMap;
import java.util.Map;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
import org.junit.Ignore;
import org.junit.Test;
-import com.amazonaws.auth.PropertiesCredentials;
-import com.amazonaws.services.s3.AmazonS3Client;
-import com.amazonaws.services.s3.model.AmazonS3Exception;
-import com.amazonaws.services.s3.model.CreateBucketRequest;
-import com.amazonaws.services.s3.model.DeleteBucketRequest;
-import com.amazonaws.services.s3.model.PutObjectRequest;
-import com.amazonaws.services.s3.model.PutObjectResult;
+@Ignore("For local testing only - interacts with S3 so the credentials file must be configured and all necessary buckets created")
+public class TestDeleteS3Object extends AbstractS3Test {
-import org.apache.nifi.util.TestRunner;
-import org.apache.nifi.util.TestRunners;
+ @Test
+ public void testSimpleDelete() throws IOException {
+ // Prepares for this test
+ putTestFile("delete-me", getFileFromResourceName(SAMPLE_FILE_RESOURCE_NAME));
+ final TestRunner runner = TestRunners.newTestRunner(new DeleteS3Object());
-@Ignore("For local testing only - interacts with S3 so the credentials file must be configured and all necessary buckets created")
-public class TestDeleteS3Object {
-
- private static final String CREDENTIALS_FILE = System.getProperty("user.home") + "/aws-credentials.properties";
-
- // When you want to test this, you should create a bucket on Amazon S3 as follows.
- private static final String TEST_REGION = "ap-northeast-1";
- private static final String TEST_BUCKET = "test-bucket-00000000-0000-0000-0000-1234567890123";
-
- @BeforeClass
- public static void oneTimeSetUp() {
- // Creates a new bucket for this test
- try {
- PropertiesCredentials credentials = new PropertiesCredentials(new FileInputStream(CREDENTIALS_FILE));
- AmazonS3Client client = new AmazonS3Client(credentials);
- CreateBucketRequest request = new CreateBucketRequest(TEST_BUCKET, TEST_REGION);
- client.createBucket(request);
- } catch (final AmazonS3Exception e) {
- System.out.println("Can't create the key " + TEST_BUCKET + ":" + e.toString());
- } catch (final IOException e) {
- System.out.println(CREDENTIALS_FILE + " doesn't exist.");
- }
- }
+ runner.setProperty(DeleteS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
+ runner.setProperty(DeleteS3Object.REGION, REGION);
+ runner.setProperty(DeleteS3Object.BUCKET, BUCKET_NAME);
+
+ final Map<String, String> attrs = new HashMap<>();
+ attrs.put("filename", "delete-me");
+ runner.enqueue(new byte[0], attrs);
- @AfterClass
- public static void oneTimeTearDown() throws IOException {
- // Delete a bucket for this test
- PropertiesCredentials credentials = new PropertiesCredentials(new FileInputStream(CREDENTIALS_FILE));
- AmazonS3Client client = new AmazonS3Client(credentials);
- DeleteBucketRequest dbr = new DeleteBucketRequest(TEST_BUCKET);
- client.deleteBucket(dbr);
+ runner.run(1);
+
+ runner.assertAllFlowFilesTransferred(DeleteS3Object.REL_SUCCESS, 1);
}
@Test
- public void testSimpleDelete() throws IOException {
+ public void testDeleteFolder() throws IOException {
// Prepares for this test
- uploadTestFile("hello.txt");
+ putTestFile("folder/delete-me", getFileFromResourceName(SAMPLE_FILE_RESOURCE_NAME));
+
+ final TestRunner runner = TestRunners.newTestRunner(new DeleteS3Object());
- DeleteS3Object deleter = new DeleteS3Object();
- final TestRunner runner = TestRunners.newTestRunner(deleter);
runner.setProperty(DeleteS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(DeleteS3Object.REGION, TEST_REGION);
- runner.setProperty(DeleteS3Object.BUCKET, TEST_BUCKET);
- runner.setProperty(DeleteS3Object.KEY, "hello.txt");
+ runner.setProperty(DeleteS3Object.REGION, REGION);
+ runner.setProperty(DeleteS3Object.BUCKET, BUCKET_NAME);
final Map<String, String> attrs = new HashMap<>();
- attrs.put("filename", "hello.txt");
+ attrs.put("filename", "folder/delete-me");
runner.enqueue(new byte[0], attrs);
+
runner.run(1);
runner.assertAllFlowFilesTransferred(DeleteS3Object.REL_SUCCESS, 1);
}
@Test
- public void testDeleteFolder() throws IOException {
+ public void testDeleteFolderNoExpressionLanguage() throws IOException {
// Prepares for this test
- uploadTestFile("folder/1.txt");
+ putTestFile("folder/delete-me", getFileFromResourceName(SAMPLE_FILE_RESOURCE_NAME));
+
+ final TestRunner runner = TestRunners.newTestRunner(new DeleteS3Object());
- DeleteS3Object deleter = new DeleteS3Object();
- final TestRunner runner = TestRunners.newTestRunner(deleter);
runner.setProperty(DeleteS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(DeleteS3Object.REGION, TEST_REGION);
- runner.setProperty(DeleteS3Object.BUCKET, TEST_BUCKET);
- runner.setProperty(DeleteS3Object.KEY, "folder/1.txt");
+ runner.setProperty(DeleteS3Object.REGION, REGION);
+ runner.setProperty(DeleteS3Object.BUCKET, BUCKET_NAME);
+ runner.setProperty(DeleteS3Object.KEY, "folder/delete-me");
final Map<String, String> attrs = new HashMap<>();
- attrs.put("filename", "hello.txt");
+ attrs.put("filename", "a-different-name");
runner.enqueue(new byte[0], attrs);
+
runner.run(1);
runner.assertAllFlowFilesTransferred(DeleteS3Object.REL_SUCCESS, 1);
@@ -114,28 +91,19 @@ public class TestDeleteS3Object {
@Test
public void testTryToDeleteNotExistingFile() throws IOException {
- DeleteS3Object deleter = new DeleteS3Object();
- final TestRunner runner = TestRunners.newTestRunner(deleter);
+ final TestRunner runner = TestRunners.newTestRunner(new DeleteS3Object());
+
runner.setProperty(DeleteS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(DeleteS3Object.REGION, TEST_REGION);
- runner.setProperty(DeleteS3Object.BUCKET, TEST_BUCKET);
- runner.setProperty(DeleteS3Object.BUCKET, "no-such-a-key");
+ runner.setProperty(DeleteS3Object.REGION, REGION);
+ runner.setProperty(DeleteS3Object.BUCKET, BUCKET_NAME);
final Map<String, String> attrs = new HashMap<>();
attrs.put("filename", "no-such-a-file");
runner.enqueue(new byte[0], attrs);
+
runner.run(1);
- runner.assertAllFlowFilesTransferred(DeleteS3Object.REL_FAILURE, 1);
+ runner.assertAllFlowFilesTransferred(DeleteS3Object.REL_SUCCESS, 1);
}
- // Uploads a test file
- private void uploadTestFile(String key) throws IOException {
- PropertiesCredentials credentials = new PropertiesCredentials(new FileInputStream(CREDENTIALS_FILE));
- AmazonS3Client client = new AmazonS3Client(credentials);
- URL fileURL = this.getClass().getClassLoader().getResource("hello.txt");
- File file = new File(fileURL.getPath());
- PutObjectRequest putRequest = new PutObjectRequest(TEST_BUCKET, key, file);
- PutObjectResult result = client.putObject(putRequest);
- }
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestFetchS3Object.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestFetchS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestFetchS3Object.java
index 0321514..e7d3e8b 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestFetchS3Object.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestFetchS3Object.java
@@ -18,7 +18,6 @@ package org.apache.nifi.processors.aws.s3;
import java.io.IOException;
import java.nio.file.Files;
-import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -30,32 +29,70 @@ import org.junit.Ignore;
import org.junit.Test;
@Ignore("For local testing only - interacts with S3 so the credentials file must be configured and all necessary buckets created")
-public class TestFetchS3Object {
+public class TestFetchS3Object extends AbstractS3Test {
+ @Test
+ public void testSimpleGet() throws IOException {
+ putTestFile("test-file", getFileFromResourceName(SAMPLE_FILE_RESOURCE_NAME));
+
+ final TestRunner runner = TestRunners.newTestRunner(new FetchS3Object());
+
+ runner.setProperty(FetchS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
+ runner.setProperty(FetchS3Object.REGION, REGION);
+ runner.setProperty(FetchS3Object.BUCKET, BUCKET_NAME);
- private final String CREDENTIALS_FILE = System.getProperty("user.home") + "/aws-credentials.properties";
+ final Map<String, String> attrs = new HashMap<>();
+ attrs.put("filename", "test-file");
+ runner.enqueue(new byte[0], attrs);
+
+ runner.run(1);
+
+ runner.assertAllFlowFilesTransferred(FetchS3Object.REL_SUCCESS, 1);
+ }
@Test
- public void testGet() throws IOException {
+ public void testTryToFetchNotExistingFile() throws IOException {
final TestRunner runner = TestRunners.newTestRunner(new FetchS3Object());
- runner.setProperty(FetchS3Object.BUCKET, "anonymous-test-bucket-00000000");
+
runner.setProperty(FetchS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(FetchS3Object.KEY, "folder/1.txt");
+ runner.setProperty(FetchS3Object.REGION, REGION);
+ runner.setProperty(FetchS3Object.BUCKET, BUCKET_NAME);
final Map<String, String> attrs = new HashMap<>();
- attrs.put("start", "0");
+ attrs.put("filename", "no-such-a-file");
+ runner.enqueue(new byte[0], attrs);
+ runner.run(1);
+
+ runner.assertAllFlowFilesTransferred(FetchS3Object.REL_FAILURE, 1);
+ }
+
+ @Test
+ public void testContentsOfFileRetrieved() throws IOException {
+ String key = "folder/1.txt";
+ putTestFile(key, getFileFromResourceName(SAMPLE_FILE_RESOURCE_NAME));
+
+ final TestRunner runner = TestRunners.newTestRunner(new FetchS3Object());
+
+ runner.setProperty(FetchS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
+ runner.setProperty(FetchS3Object.REGION, REGION);
+ runner.setProperty(FetchS3Object.BUCKET, BUCKET_NAME);
+
+ final Map<String, String> attrs = new HashMap<>();
+ attrs.put("filename", key);
runner.enqueue(new byte[0], attrs);
+
runner.run(1);
runner.assertAllFlowFilesTransferred(FetchS3Object.REL_SUCCESS, 1);
+
final List<MockFlowFile> ffs = runner.getFlowFilesForRelationship(FetchS3Object.REL_SUCCESS);
final MockFlowFile out = ffs.iterator().next();
- final byte[] expectedBytes = Files.readAllBytes(Paths.get("src/test/resources/hello.txt"));
+ final byte[] expectedBytes = Files.readAllBytes(getResourcePath(SAMPLE_FILE_RESOURCE_NAME));
out.assertContentEquals(new String(expectedBytes));
+
for (final Map.Entry<String, String> entry : out.getAttributes().entrySet()) {
System.out.println(entry.getKey() + " : " + entry.getValue());
}
}
-
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestPutS3Object.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestPutS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestPutS3Object.java
index de7816d..4dac0d4 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestPutS3Object.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/TestPutS3Object.java
@@ -17,7 +17,6 @@
package org.apache.nifi.processors.aws.s3;
import java.io.IOException;
-import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
@@ -30,22 +29,22 @@ import org.junit.Test;
import com.amazonaws.services.s3.model.StorageClass;
@Ignore("For local testing only - interacts with S3 so the credentials file must be configured and all necessary buckets created")
-public class TestPutS3Object {
-
- private final String CREDENTIALS_FILE = System.getProperty("user.home") + "/aws-credentials.properties";
+public class TestPutS3Object extends AbstractS3Test {
@Test
public void testSimplePut() throws IOException {
final TestRunner runner = TestRunners.newTestRunner(new PutS3Object());
+
runner.setProperty(PutS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(PutS3Object.BUCKET, "test-bucket-00000000-0000-0000-0000-123456789012");
- runner.setProperty(PutS3Object.EXPIRATION_RULE_ID, "Expire Quickly");
+ runner.setProperty(PutS3Object.REGION, REGION);
+ runner.setProperty(PutS3Object.BUCKET, BUCKET_NAME);
+
Assert.assertTrue(runner.setProperty("x-custom-prop", "hello").isValid());
for (int i = 0; i < 3; i++) {
final Map<String, String> attrs = new HashMap<>();
attrs.put("filename", String.valueOf(i) + ".txt");
- runner.enqueue(Paths.get("src/test/resources/hello.txt"), attrs);
+ runner.enqueue(getResourcePath(SAMPLE_FILE_RESOURCE_NAME), attrs);
}
runner.run(3);
@@ -55,14 +54,17 @@ public class TestPutS3Object {
@Test
public void testPutInFolder() throws IOException {
final TestRunner runner = TestRunners.newTestRunner(new PutS3Object());
- runner.setProperty(PutS3Object.BUCKET, "test-bucket-00000000-0000-0000-0000-123456789012");
+
runner.setProperty(PutS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(PutS3Object.EXPIRATION_RULE_ID, "Expire Quickly");
+ runner.setProperty(PutS3Object.REGION, REGION);
+ runner.setProperty(PutS3Object.BUCKET, BUCKET_NAME);
+
Assert.assertTrue(runner.setProperty("x-custom-prop", "hello").isValid());
final Map<String, String> attrs = new HashMap<>();
attrs.put("filename", "folder/1.txt");
- runner.enqueue(Paths.get("src/test/resources/hello.txt"), attrs);
+ runner.enqueue(getResourcePath(SAMPLE_FILE_RESOURCE_NAME), attrs);
+
runner.run();
runner.assertAllFlowFilesTransferred(PutS3Object.REL_SUCCESS, 1);
@@ -71,14 +73,18 @@ public class TestPutS3Object {
@Test
public void testStorageClass() throws IOException {
final TestRunner runner = TestRunners.newTestRunner(new PutS3Object());
- runner.setProperty(PutS3Object.BUCKET, "test-bucket-00000000-0000-0000-0000-123456789012");
+
runner.setProperty(PutS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
+ runner.setProperty(PutS3Object.REGION, REGION);
+ runner.setProperty(PutS3Object.BUCKET, BUCKET_NAME);
runner.setProperty(PutS3Object.STORAGE_CLASS, StorageClass.ReducedRedundancy.name());
+
Assert.assertTrue(runner.setProperty("x-custom-prop", "hello").isValid());
final Map<String, String> attrs = new HashMap<>();
attrs.put("filename", "folder/2.txt");
- runner.enqueue(Paths.get("src/test/resources/hello.txt"), attrs);
+ runner.enqueue(getResourcePath(SAMPLE_FILE_RESOURCE_NAME), attrs);
+
runner.run();
runner.assertAllFlowFilesTransferred(PutS3Object.REL_SUCCESS, 1);
@@ -87,16 +93,18 @@ public class TestPutS3Object {
@Test
public void testPermissions() throws IOException {
final TestRunner runner = TestRunners.newTestRunner(new PutS3Object());
- runner.setProperty(PutS3Object.BUCKET, "test-bucket-00000000-0000-0000-0000-123456789012");
+
runner.setProperty(PutS3Object.CREDENTAILS_FILE, CREDENTIALS_FILE);
- runner.setProperty(PutS3Object.FULL_CONTROL_USER_LIST, "28545acd76c35c7e91f8409b95fd1aa0c0914bfa1ac60975d9f48bc3c5e090b5");
+ runner.setProperty(PutS3Object.BUCKET, BUCKET_NAME);
+ runner.setProperty(PutS3Object.FULL_CONTROL_USER_LIST,"28545acd76c35c7e91f8409b95fd1aa0c0914bfa1ac60975d9f48bc3c5e090b5");
+ runner.setProperty(PutS3Object.REGION, REGION);
final Map<String, String> attrs = new HashMap<>();
attrs.put("filename", "folder/4.txt");
- runner.enqueue(Paths.get("src/test/resources/hello.txt"), attrs);
+ runner.enqueue(getResourcePath(SAMPLE_FILE_RESOURCE_NAME), attrs);
+
runner.run();
runner.assertAllFlowFilesTransferred(PutS3Object.REL_SUCCESS, 1);
}
-
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/nifi-nar-bundles/nifi-aws-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-aws-bundle/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/pom.xml
index a43bb80..2470e41 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/pom.xml
@@ -30,14 +30,4 @@
<module>nifi-aws-nar</module>
</modules>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.amazonaws</groupId>
- <artifactId>aws-java-sdk</artifactId>
- <version>1.9.24</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
</project>
http://git-wip-us.apache.org/repos/asf/nifi/blob/77de51df/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ded7257..08a227f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -492,7 +492,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
- <version>2.8</version>
+ <version>2.8.2</version>
</dependency>
<dependency>
<groupId>com.yammer.metrics</groupId>
@@ -968,6 +968,11 @@
<artifactId>derby</artifactId>
<version>10.11.1.1</version>
</dependency>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk</artifactId>
+ <version>1.10.32</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
[21/50] [abbrv] nifi git commit: NIFI-1051: Fixed checkstyle
violations
Posted by tk...@apache.org.
NIFI-1051: Fixed checkstyle violations
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/abf2c628
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/abf2c628
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/abf2c628
Branch: refs/heads/NIFI-1073
Commit: abf2c6288458958be54a7a9a5fddc91693aaa4cf
Parents: 7a73867
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 2 11:01:50 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 11:01:50 2015 -0500
----------------------------------------------------------------------
.../repository/FileSystemRepository.java | 12 ++++-----
.../repository/TestFileSystemRepository.java | 26 ++++++++++----------
2 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/abf2c628/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
----------------------------------------------------------------------
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 1354b4a..b4a1716 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
@@ -309,12 +309,12 @@ public class FileSystemRepository implements ContentRepository {
// the path already exists, so scan the path to find any files and update maxIndex to the max of
// all filenames seen.
Files.walkFileTree(realPath, new SimpleFileVisitor<Path>() {
-
- public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
- LOG.warn("Content repository contains un-readable file or directory '" + file.getFileName() + "'. Skipping. ", exc);
- return FileVisitResult.SKIP_SUBTREE;
- }
-
+ @Override
+ public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
+ LOG.warn("Content repository contains un-readable file or directory '" + file.getFileName() + "'. Skipping. ", exc);
+ return FileVisitResult.SKIP_SUBTREE;
+ }
+
@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
if (attrs.isDirectory()) {
http://git-wip-us.apache.org/repos/asf/nifi/blob/abf2c628/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
index 95e1f40..5da67a0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
@@ -71,23 +71,23 @@ public class TestFileSystemRepository {
public void shutdown() throws IOException {
repository.shutdown();
}
-
+
@Test
public void testBogusFile() throws IOException {
- repository.shutdown();
- System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
-
+ repository.shutdown();
+ System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, "src/test/resources/nifi.properties");
+
File bogus = new File(rootFile, "bogus");
try {
- bogus.mkdir();
- bogus.setReadable(false);
-
- repository = new FileSystemRepository();
- repository.initialize(new StandardResourceClaimManager());
- } finally {
- bogus.setReadable(true);
- assertTrue(bogus.delete());
- }
+ bogus.mkdir();
+ bogus.setReadable(false);
+
+ repository = new FileSystemRepository();
+ repository.initialize(new StandardResourceClaimManager());
+ } finally {
+ bogus.setReadable(true);
+ assertTrue(bogus.delete());
+ }
}
@Test
[32/50] [abbrv] nifi git commit: NIFI-274 - Fixing TestListenSyslog,
fixing default buffer size to be bytes,
adding syslog.protocol to attributes - Adding syslog.port to ListenSyslog
attributes, logging at warn level when rejecting tcp connectio
Posted by tk...@apache.org.
NIFI-274 - Fixing TestListenSyslog, fixing default buffer size to be bytes, adding syslog.protocol to attributes
- Adding syslog.port to ListenSyslog attributes, logging at warn level when rejecting tcp connections
- Adding @InputRequirement to processors and adding appropriate send and receive provenance events
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/618f22e1
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/618f22e1
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/618f22e1
Branch: refs/heads/NIFI-1073
Commit: 618f22e110032df09d77a80587b553e6995038e2
Parents: 5611dac
Author: Bryan Bende <bb...@apache.org>
Authored: Wed Nov 4 09:01:52 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Wed Nov 4 18:01:59 2015 -0500
----------------------------------------------------------------------
.../standard/AbstractSyslogProcessor.java | 4 +-
.../nifi/processors/standard/ListenSyslog.java | 36 +++++++++++----
.../nifi/processors/standard/PutSyslog.java | 15 +++++-
.../processors/standard/TestListenSyslog.java | 48 ++++++++++++++++++--
.../nifi/processors/standard/TestPutSyslog.java | 18 ++++++++
5 files changed, 104 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/618f22e1/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
index f7d5eeb..fea01bd 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java
@@ -64,7 +64,9 @@ public abstract class AbstractSyslogProcessor extends AbstractProcessor {
HOSTNAME("syslog.hostname"),
SENDER("syslog.sender"),
BODY("syslog.body"),
- VALID("syslog.valid");
+ VALID("syslog.valid"),
+ PROTOCOL("syslog.protocol"),
+ PORT("syslog.pprt");
private String key;
http://git-wip-us.apache.org/repos/asf/nifi/blob/618f22e1/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
index 8012b88..1660e3a 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
@@ -22,6 +22,7 @@ import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.StandardSocketOptions;
import java.nio.ByteBuffer;
+import java.nio.channels.Channel;
import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
@@ -45,6 +46,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.io.IOUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.behavior.WritesAttributes;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
@@ -68,7 +70,7 @@ import org.apache.nifi.processors.standard.util.SyslogEvent;
import org.apache.nifi.processors.standard.util.SyslogParser;
import org.apache.nifi.stream.io.ByteArrayOutputStream;
-
+@InputRequirement(InputRequirement.Requirement.INPUT_FORBIDDEN)
@Tags({"syslog", "listen", "udp", "tcp", "logs"})
@CapabilityDescription("Listens for Syslog messages being sent to a given port over TCP or UDP. Incoming messages are checked against regular " +
"expressions for RFC5424 and RFC3164 formatted messages. The format of each message is: (<PRIORITY>)(VERSION )(TIMESTAMP) (HOSTNAME) (BODY) " +
@@ -88,6 +90,8 @@ import org.apache.nifi.stream.io.ByteArrayOutputStream;
@WritesAttribute(attribute="syslog.body", description="The body of the Syslog message, everything after the hostname."),
@WritesAttribute(attribute="syslog.valid", description="An indicator of whether this message matched the expected formats. " +
"If this value is false, the other attributes will be empty and only the original message will be available in the content."),
+ @WritesAttribute(attribute="syslog.protocol", description="The protocol over which the Syslog message was received."),
+ @WritesAttribute(attribute="syslog.port", description="The port over which the Syslog message was received."),
@WritesAttribute(attribute="mime.type", description="The mime.type of the FlowFile which will be text/plain for Syslog messages.")})
public class ListenSyslog extends AbstractSyslogProcessor {
@@ -97,7 +101,7 @@ public class ListenSyslog extends AbstractSyslogProcessor {
"incoming Syslog messages. When UDP is selected each buffer will hold one Syslog message. When TCP is selected messages are read " +
"from an incoming connection until the buffer is full, or the connection is closed. ")
.addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
- .defaultValue("65507 KB")
+ .defaultValue("65507 B")
.required(true)
.build();
public static final PropertyDescriptor MAX_SOCKET_BUFFER_SIZE = new PropertyDescriptor.Builder()
@@ -110,8 +114,8 @@ public class ListenSyslog extends AbstractSyslogProcessor {
.required(true)
.build();
public static final PropertyDescriptor MAX_CONNECTIONS = new PropertyDescriptor.Builder()
- .name("Max number of TCP connections")
- .description("The maximum number of concurrent connections to accept syslog messages in TCP mode")
+ .name("Max Number of TCP Connections")
+ .description("The maximum number of concurrent connections to accept Syslog messages in TCP mode.")
.addValidator(StandardValidators.createLongValidator(1, 65535, true))
.defaultValue("2")
.required(true)
@@ -142,8 +146,8 @@ public class ListenSyslog extends AbstractSyslogProcessor {
descriptors.add(PORT);
descriptors.add(RECV_BUFFER_SIZE);
descriptors.add(MAX_SOCKET_BUFFER_SIZE);
- descriptors.add(CHARSET);
descriptors.add(MAX_CONNECTIONS);
+ descriptors.add(CHARSET);
this.descriptors = Collections.unmodifiableList(descriptors);
final Set<Relationship> relationships = new HashSet<>();
@@ -184,7 +188,7 @@ public class ListenSyslog extends AbstractSyslogProcessor {
if (protocol.equals(UDP_VALUE.getValue())) {
maxConnections = 1;
- } else{
+ } else {
maxConnections = context.getProperty(MAX_CONNECTIONS).asLong().intValue();
}
@@ -240,6 +244,8 @@ public class ListenSyslog extends AbstractSyslogProcessor {
}
final SyslogEvent event = initialEvent;
+ final String port = context.getProperty(PORT).getValue();
+ final String protocol = context.getProperty(PROTOCOL).getValue();
final Map<String,String> attributes = new HashMap<>();
attributes.put(SyslogAttributes.PRIORITY.key(), event.getPriority());
@@ -251,11 +257,16 @@ public class ListenSyslog extends AbstractSyslogProcessor {
attributes.put(SyslogAttributes.SENDER.key(), event.getSender());
attributes.put(SyslogAttributes.BODY.key(), event.getMsgBody());
attributes.put(SyslogAttributes.VALID.key(), String.valueOf(event.isValid()));
+ attributes.put(SyslogAttributes.PROTOCOL.key(), protocol);
+ attributes.put(SyslogAttributes.PORT.key(), port);
attributes.put(CoreAttributes.MIME_TYPE.key(), "text/plain");
FlowFile flowFile = session.create();
flowFile = session.putAllAttributes(flowFile, attributes);
+ final String transitUri = new StringBuilder().append(protocol).append("://").append(event.getSender())
+ .append(":").append(port).toString();
+
try {
// write the raw bytes of the message as the FlowFile content
flowFile = session.write(flowFile, new OutputStreamCallback() {
@@ -268,6 +279,7 @@ public class ListenSyslog extends AbstractSyslogProcessor {
if (event.isValid()) {
getLogger().info("Transferring {} to success", new Object[]{flowFile});
session.transfer(flowFile, REL_SUCCESS);
+ session.getProvenanceReporter().receive(flowFile, transitUri);
} else {
getLogger().info("Transferring {} to invalid", new Object[]{flowFile});
session.transfer(flowFile, REL_INVALID);
@@ -454,7 +466,8 @@ public class ListenSyslog extends AbstractSyslogProcessor {
// Check for available connections
if (currentConnections.incrementAndGet() > maxConnections){
currentConnections.decrementAndGet();
- logger.info("Rejecting connection from {} because max connections has been met", new Object[]{ socketChannel.getRemoteAddress().toString() });
+ logger.warn("Rejecting connection from {} because max connections has been met",
+ new Object[]{ socketChannel.getRemoteAddress().toString() });
IOUtils.closeQuietly(socketChannel);
continue;
}
@@ -494,8 +507,11 @@ public class ListenSyslog extends AbstractSyslogProcessor {
public int getPort() {
// Return the port for the key listening for accepts
for(SelectionKey key : selector.keys()){
- if (key.isValid() && key.isAcceptable()) {
- return ((SocketChannel)key.channel()).socket().getLocalPort();
+ if (key.isValid()) {
+ final Channel channel = key.channel();
+ if (channel instanceof ServerSocketChannel) {
+ return ((ServerSocketChannel)channel).socket().getLocalPort();
+ }
}
}
return 0;
@@ -619,7 +635,7 @@ public class ListenSyslog extends AbstractSyslogProcessor {
eof = true;
} catch (IOException e) {
logger.error("Error reading from channel", e);
- // Treat same as closed socket
+ // Treat same as closed socket
eof = true;
} finally {
if(eof == true) {
http://git-wip-us.apache.org/repos/asf/nifi/blob/618f22e1/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
index 5e558ca..b7e7a9c 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
@@ -17,6 +17,7 @@
package org.apache.nifi.processors.standard;
import org.apache.commons.io.IOUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.TriggerWhenEmpty;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
@@ -33,6 +34,7 @@ import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.processors.standard.util.SyslogParser;
import org.apache.nifi.util.ObjectHolder;
+import org.apache.nifi.util.StopWatch;
import java.io.IOException;
import java.net.InetAddress;
@@ -52,6 +54,7 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
@TriggerWhenEmpty
@Tags({"syslog", "put", "udp", "tcp", "logs"})
@CapabilityDescription("Sends Syslog messages to a given host and port over TCP or UDP. Messages are constructed from the \"Message ___\" properties of the processor " +
@@ -59,7 +62,7 @@ import java.util.regex.Pattern;
"(<PRIORITY>)(VERSION )(TIMESTAMP) (HOSTNAME) (BODY) where version is optional. The constructed messages are checked against regular expressions for " +
"RFC5424 and RFC3164 formatted messages. The timestamp can be an RFC5424 timestamp with a format of \"yyyy-MM-dd'T'HH:mm:ss.SZ\" or \"yyyy-MM-dd'T'HH:mm:ss.S+hh:mm\", " +
"or it can be an RFC3164 timestamp with a format of \"MMM d HH:mm:ss\". If a message is constructed that does not form a valid Syslog message according to the " +
- "above description, then it is routed to the invalid relationship. Valid messages are pushed to Syslog with successes routed to the success relationship, and " +
+ "above description, then it is routed to the invalid relationship. Valid messages are sent to the Syslog server and successes are routed to the success relationship, " +
"failures routed to the failure relationship.")
public class PutSyslog extends AbstractSyslogProcessor {
@@ -277,9 +280,14 @@ public class PutSyslog extends AbstractSyslogProcessor {
}
}
+ final String port = context.getProperty(PORT).getValue();
+ final String host = context.getProperty(HOSTNAME).getValue();
+ final String transitUri = new StringBuilder().append(protocol).append("://").append(host).append(":").append(port).toString();
final ObjectHolder<IOException> exceptionHolder = new ObjectHolder<>(null);
+
try {
for (FlowFile flowFile : flowFiles) {
+ final StopWatch timer = new StopWatch(true);
final String priority = context.getProperty(MSG_PRIORITY).evaluateAttributeExpressions(flowFile).getValue();
final String version = context.getProperty(MSG_VERSION).evaluateAttributeExpressions(flowFile).getValue();
final String timestamp = context.getProperty(MSG_TIMESTAMP).evaluateAttributeExpressions(flowFile).getValue();
@@ -304,6 +312,11 @@ public class PutSyslog extends AbstractSyslogProcessor {
}
sender.send(messageBuilder.toString());
+ timer.stop();
+
+ final long duration = timer.getDuration(TimeUnit.MILLISECONDS);
+ session.getProvenanceReporter().send(flowFile, transitUri, duration, true);
+
getLogger().info("Transferring {} to success", new Object[]{flowFile});
session.transfer(flowFile, REL_SUCCESS);
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/nifi/blob/618f22e1/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
index eb71f88..f0eb345 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
@@ -16,12 +16,15 @@
*/
package org.apache.nifi.processors.standard;
+import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.io.nio.BufferPool;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSessionFactory;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processors.standard.util.SyslogEvent;
import org.apache.nifi.processors.standard.util.SyslogParser;
+import org.apache.nifi.provenance.ProvenanceEventRecord;
+import org.apache.nifi.provenance.ProvenanceEventType;
import org.apache.nifi.util.MockFlowFile;
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
@@ -89,7 +92,16 @@ public class TestListenSyslog {
Assert.assertEquals("Did not process all the datagrams", numMessages, numTransfered);
MockFlowFile flowFile = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).get(0);
- checkFlowFile(flowFile);
+ checkFlowFile(flowFile, 0, ListenSyslog.UDP_VALUE.getValue());
+
+ final List<ProvenanceEventRecord> events = runner.getProvenanceEvents();
+ Assert.assertNotNull(events);
+ Assert.assertEquals(numMessages, events.size());
+
+ final ProvenanceEventRecord event = events.get(0);
+ Assert.assertEquals(ProvenanceEventType.RECEIVE, event.getEventType());
+ Assert.assertEquals(ListenSyslog.UDP_VALUE.getValue() + "://" + flowFile.getAttribute(ListenSyslog.SyslogAttributes.SENDER.key()) + ":0",
+ event.getTransitUri());
} finally {
// unschedule to close connections
@@ -131,7 +143,17 @@ public class TestListenSyslog {
Assert.assertEquals("Did not process all the messages", numMessages, numTransfered);
MockFlowFile flowFile = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).get(0);
- checkFlowFile(flowFile);
+ checkFlowFile(flowFile, 0, ListenSyslog.TCP_VALUE.getValue());
+
+ final List<ProvenanceEventRecord> events = runner.getProvenanceEvents();
+ Assert.assertNotNull(events);
+ Assert.assertEquals(numMessages, events.size());
+
+ final ProvenanceEventRecord event = events.get(0);
+ Assert.assertEquals(ProvenanceEventType.RECEIVE, event.getEventType());
+ Assert.assertEquals(ListenSyslog.TCP_VALUE.getValue() + "://" + flowFile.getAttribute(ListenSyslog.SyslogAttributes.SENDER.key()) + ":0",
+ event.getTransitUri());
+
} finally {
// unschedule to close connections
proc.onUnscheduled();
@@ -143,6 +165,7 @@ public class TestListenSyslog {
final ListenSyslog proc = new ListenSyslog();
final TestRunner runner = TestRunners.newTestRunner(proc);
runner.setProperty(ListenSyslog.PROTOCOL, ListenSyslog.TCP_VALUE.getValue());
+ runner.setProperty(ListenSyslog.MAX_CONNECTIONS, "5");
runner.setProperty(ListenSyslog.PORT, "0");
// schedule to start listening on a random port
@@ -172,7 +195,17 @@ public class TestListenSyslog {
Assert.assertEquals("Did not process all the messages", numMessages, numTransfered);
MockFlowFile flowFile = runner.getFlowFilesForRelationship(ListenSyslog.REL_SUCCESS).get(0);
- checkFlowFile(flowFile);
+ checkFlowFile(flowFile, 0, ListenSyslog.TCP_VALUE.getValue());
+
+ final List<ProvenanceEventRecord> events = runner.getProvenanceEvents();
+ Assert.assertNotNull(events);
+ Assert.assertEquals(numMessages, events.size());
+
+ final ProvenanceEventRecord event = events.get(0);
+ Assert.assertEquals(ProvenanceEventType.RECEIVE, event.getEventType());
+ Assert.assertEquals(ListenSyslog.TCP_VALUE.getValue() + "://" + flowFile.getAttribute(ListenSyslog.SyslogAttributes.SENDER.key()) + ":0",
+ event.getTransitUri());
+
} finally {
// unschedule to close connections
proc.onUnscheduled();
@@ -210,6 +243,8 @@ public class TestListenSyslog {
proc.onTrigger(context, processSessionFactory);
numTransfered = runner.getFlowFilesForRelationship(ListenSyslog.REL_INVALID).size();
}
+
+ // all messages should be transferred to invalid
Assert.assertEquals("Did not process all the messages", numMessages, numTransfered);
} finally {
@@ -241,7 +276,7 @@ public class TestListenSyslog {
}
- private void checkFlowFile(MockFlowFile flowFile) {
+ private void checkFlowFile(final MockFlowFile flowFile, final int port, final String protocol) {
flowFile.assertContentEquals(VALID_MESSAGE);
Assert.assertEquals(PRI, flowFile.getAttribute(ListenSyslog.SyslogAttributes.PRIORITY.key()));
Assert.assertEquals(SEV, flowFile.getAttribute(ListenSyslog.SyslogAttributes.SEVERITY.key()));
@@ -250,6 +285,9 @@ public class TestListenSyslog {
Assert.assertEquals(HOST, flowFile.getAttribute(ListenSyslog.SyslogAttributes.HOSTNAME.key()));
Assert.assertEquals(BODY, flowFile.getAttribute(ListenSyslog.SyslogAttributes.BODY.key()));
Assert.assertEquals("true", flowFile.getAttribute(ListenSyslog.SyslogAttributes.VALID.key()));
+ Assert.assertEquals(String.valueOf(port), flowFile.getAttribute(ListenSyslog.SyslogAttributes.PORT.key()));
+ Assert.assertEquals(protocol, flowFile.getAttribute(ListenSyslog.SyslogAttributes.PROTOCOL.key()));
+ Assert.assertTrue(!StringUtils.isBlank(flowFile.getAttribute(ListenSyslog.SyslogAttributes.SENDER.key())));
}
/**
@@ -392,7 +430,7 @@ public class TestListenSyslog {
@Override
protected ChannelReader createChannelReader(final String protocol, final BufferPool bufferPool, final SyslogParser syslogParser,
- final BlockingQueue<SyslogEvent> syslogEvents, int maxConnections) {
+ final BlockingQueue<SyslogEvent> syslogEvents, int maxConnections) {
return new ChannelReader() {
@Override
public void open(int port, int maxBufferSize) throws IOException {
http://git-wip-us.apache.org/repos/asf/nifi/blob/618f22e1/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
index 40a9123..eb0d3f4 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java
@@ -17,6 +17,8 @@
package org.apache.nifi.processors.standard;
import org.apache.nifi.processor.Processor;
+import org.apache.nifi.provenance.ProvenanceEventRecord;
+import org.apache.nifi.provenance.ProvenanceEventType;
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;
import org.junit.Assert;
@@ -70,6 +72,14 @@ public class TestPutSyslog {
runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
Assert.assertEquals(1, sender.messages.size());
Assert.assertEquals(expectedMessage, sender.messages.get(0));
+
+ final List<ProvenanceEventRecord> events = runner.getProvenanceEvents();
+ Assert.assertNotNull(events);
+ Assert.assertEquals(1, events.size());
+
+ final ProvenanceEventRecord event = events.get(0);
+ Assert.assertEquals(ProvenanceEventType.SEND, event.getEventType());
+ Assert.assertEquals("UDP://localhost:12345", event.getTransitUri());
}
@Test
@@ -95,6 +105,14 @@ public class TestPutSyslog {
runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1);
Assert.assertEquals(1, sender.messages.size());
Assert.assertEquals(expectedMessage, sender.messages.get(0).replace("\n", ""));
+
+ final List<ProvenanceEventRecord> events = runner.getProvenanceEvents();
+ Assert.assertNotNull(events);
+ Assert.assertEquals(1, events.size());
+
+ final ProvenanceEventRecord event = events.get(0);
+ Assert.assertEquals(ProvenanceEventType.SEND, event.getEventType());
+ Assert.assertEquals("TCP://localhost:12345", event.getTransitUri());
}
@Test
[16/50] [abbrv] nifi git commit: NIFI-1068 Fix EndpointConnectionPool
to properly remove connections from activeConnections when terminating
connections
Posted by tk...@apache.org.
NIFI-1068 Fix EndpointConnectionPool to properly remove connections from activeConnections when terminating connections
Signed-off-by: Mark Payne <ma...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/37e2f178
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/37e2f178
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/37e2f178
Branch: refs/heads/NIFI-1073
Commit: 37e2f178f8f0e4a0fed022e2541a64e97e4897d4
Parents: ad849c7
Author: Joseph Percivall <jo...@yahoo.com>
Authored: Mon Oct 26 17:35:23 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Sun Nov 1 14:47:23 2015 -0500
----------------------------------------------------------------------
.../apache/nifi/remote/client/socket/EndpointConnectionPool.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/37e2f178/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
index b162b3f..88a34aa 100644
--- a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
+++ b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
@@ -820,12 +820,13 @@ public class EndpointConnectionPool {
for (final BlockingQueue<EndpointConnection> connectionQueue : connectionQueueMap.values()) {
EndpointConnection state;
while ((state = connectionQueue.poll()) != null) {
- cleanup(state.getSocketClientProtocol(), state.getPeer());
+ terminate(state);
}
}
}
public void terminate(final EndpointConnection connection) {
+ activeConnections.remove(connection);
cleanup(connection.getSocketClientProtocol(), connection.getPeer());
}
[31/50] [abbrv] nifi git commit: NIFI-274 - added use of Selectors
for TCP and UDP connections. Added a max connections to the TCP thread -
Added comments and code review changes - fixed fixbugs bug
Posted by tk...@apache.org.
NIFI-274 - added use of Selectors for TCP and UDP connections. Added a max connections to the TCP thread
- Added comments and code review changes
- fixed fixbugs bug
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/5611dac3
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/5611dac3
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/5611dac3
Branch: refs/heads/NIFI-1073
Commit: 5611dac3f88efb9ba3148634b0546054363ff5b2
Parents: 9c54243
Author: Tony Kurc <tr...@gmail.com>
Authored: Fri Oct 30 08:45:06 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Wed Nov 4 18:00:18 2015 -0500
----------------------------------------------------------------------
.../nifi/processors/standard/ListenSyslog.java | 328 +++++++++++++------
.../nifi/processors/standard/PutSyslog.java | 45 +--
.../processors/standard/TestListenSyslog.java | 3 +-
3 files changed, 247 insertions(+), 129 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/5611dac3/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
index 9f57c9f..8012b88 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
@@ -16,6 +16,34 @@
*/
package org.apache.nifi.processors.standard;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.StandardSocketOptions;
+import java.nio.ByteBuffer;
+import java.nio.channels.ClosedByInterruptException;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
import org.apache.commons.io.IOUtils;
import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.behavior.WritesAttributes;
@@ -40,29 +68,6 @@ import org.apache.nifi.processors.standard.util.SyslogEvent;
import org.apache.nifi.processors.standard.util.SyslogParser;
import org.apache.nifi.stream.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.StandardSocketOptions;
-import java.nio.ByteBuffer;
-import java.nio.channels.ClosedByInterruptException;
-import java.nio.channels.DatagramChannel;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-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.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
@Tags({"syslog", "listen", "udp", "tcp", "logs"})
@CapabilityDescription("Listens for Syslog messages being sent to a given port over TCP or UDP. Incoming messages are checked against regular " +
@@ -104,7 +109,13 @@ public class ListenSyslog extends AbstractSyslogProcessor {
.defaultValue("1 MB")
.required(true)
.build();
-
+ public static final PropertyDescriptor MAX_CONNECTIONS = new PropertyDescriptor.Builder()
+ .name("Max number of TCP connections")
+ .description("The maximum number of concurrent connections to accept syslog messages in TCP mode")
+ .addValidator(StandardValidators.createLongValidator(1, 65535, true))
+ .defaultValue("2")
+ .required(true)
+ .build();
public static final Relationship REL_SUCCESS = new Relationship.Builder()
.name("success")
@@ -132,6 +143,7 @@ public class ListenSyslog extends AbstractSyslogProcessor {
descriptors.add(RECV_BUFFER_SIZE);
descriptors.add(MAX_SOCKET_BUFFER_SIZE);
descriptors.add(CHARSET);
+ descriptors.add(MAX_CONNECTIONS);
this.descriptors = Collections.unmodifiableList(descriptors);
final Set<Relationship> relationships = new HashSet<>();
@@ -168,14 +180,21 @@ public class ListenSyslog extends AbstractSyslogProcessor {
final int maxChannelBufferSize = context.getProperty(MAX_SOCKET_BUFFER_SIZE).asDataSize(DataUnit.B).intValue();
final String protocol = context.getProperty(PROTOCOL).getValue();
final String charSet = context.getProperty(CHARSET).getValue();
+ final int maxConnections;
+
+ if (protocol.equals(UDP_VALUE.getValue())) {
+ maxConnections = 1;
+ } else{
+ maxConnections = context.getProperty(MAX_CONNECTIONS).asLong().intValue();
+ }
parser = new SyslogParser(Charset.forName(charSet));
- bufferPool = new BufferPool(context.getMaxConcurrentTasks(), bufferSize, false, Integer.MAX_VALUE);
+ bufferPool = new BufferPool(maxConnections, bufferSize, false, Integer.MAX_VALUE);
syslogEvents = new LinkedBlockingQueue<>(10);
errorEvents = new LinkedBlockingQueue<>(context.getMaxConcurrentTasks());
// create either a UDP or TCP reader and call open() to bind to the given port
- channelReader = createChannelReader(protocol, bufferPool, parser, syslogEvents);
+ channelReader = createChannelReader(protocol, bufferPool, parser, syslogEvents, maxConnections);
channelReader.open(port, maxChannelBufferSize);
final Thread readerThread = new Thread(channelReader);
@@ -185,12 +204,12 @@ public class ListenSyslog extends AbstractSyslogProcessor {
}
// visible for testing to be overridden and provide a mock ChannelReader if desired
- protected ChannelReader createChannelReader(final String protocol, final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents)
+ protected ChannelReader createChannelReader(final String protocol, final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents, int maxConnections)
throws IOException {
if (protocol.equals(UDP_VALUE.getValue())) {
return new DatagramChannelReader(bufferPool, syslogParser, syslogEvents, getLogger());
} else {
- return new SocketChannelReader(bufferPool, syslogParser, syslogEvents, getLogger());
+ return new SocketChannelReader(bufferPool, syslogParser, syslogEvents, getLogger(), maxConnections);
}
}
@@ -287,6 +306,7 @@ public class ListenSyslog extends AbstractSyslogProcessor {
private final ProcessorLog logger;
private DatagramChannel datagramChannel;
private volatile boolean stopped = false;
+ private Selector selector;
public DatagramChannelReader(final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents,
final ProcessorLog logger) {
@@ -308,37 +328,48 @@ public class ListenSyslog extends AbstractSyslogProcessor {
}
}
datagramChannel.socket().bind(new InetSocketAddress(port));
+ selector = Selector.open();
+ datagramChannel.register(selector, SelectionKey.OP_READ);
}
@Override
public void run() {
+ final ByteBuffer buffer = bufferPool.poll();
while (!stopped) {
- final ByteBuffer buffer = bufferPool.poll();
try {
- if (buffer == null) {
- Thread.sleep(10L);
- logger.debug("no available buffers, continuing...");
- continue;
- }
-
- final SocketAddress sender = datagramChannel.receive(buffer);
- if (sender == null) {
- Thread.sleep(1000L); // nothing to do so wait...
- } else {
- final SyslogEvent event = syslogParser.parseEvent(buffer); // TODO parse with sender?
- logger.trace(event.getFullMessage());
- syslogEvents.put(event); // block until space is available
+ int selected = selector.select();
+ if (selected > 0){
+ Iterator<SelectionKey> selectorKeys = selector.selectedKeys().iterator();
+ while (selectorKeys.hasNext()) {
+ SelectionKey key = selectorKeys.next();
+ selectorKeys.remove();
+ if (!key.isValid()) {
+ continue;
+ }
+ DatagramChannel channel = (DatagramChannel) key.channel();
+ SocketAddress sender;
+ buffer.clear();
+ while (!stopped && (sender = channel.receive(buffer)) != null) {
+ final SyslogEvent event;
+ if (sender instanceof InetSocketAddress) {
+ event = syslogParser.parseEvent(buffer, ((InetSocketAddress)sender).getAddress().toString());
+ } else {
+ event = syslogParser.parseEvent(buffer);
+ }
+ logger.trace(event.getFullMessage());
+ syslogEvents.put(event); // block until space is available
+ }
+ }
}
} catch (InterruptedException e) {
- stop();
+ stopped = true;
} catch (IOException e) {
logger.error("Error reading from DatagramChannel", e);
- } finally {
- if (buffer != null) {
- bufferPool.returnBuffer(buffer, 0);
- }
}
}
+ if (buffer != null) {
+ bufferPool.returnBuffer(buffer, 0);
+ }
}
@Override
@@ -348,11 +379,13 @@ public class ListenSyslog extends AbstractSyslogProcessor {
@Override
public void stop() {
+ selector.wakeup();
stopped = true;
}
@Override
public void close() {
+ IOUtils.closeQuietly(selector);
IOUtils.closeQuietly(datagramChannel);
}
}
@@ -367,21 +400,27 @@ public class ListenSyslog extends AbstractSyslogProcessor {
private final SyslogParser syslogParser;
private final BlockingQueue<SyslogEvent> syslogEvents;
private final ProcessorLog logger;
- private ServerSocketChannel serverSocketChannel;
- private ExecutorService executor = Executors.newFixedThreadPool(2);
+ private final ExecutorService executor;
private volatile boolean stopped = false;
+ private Selector selector;
+ private final BlockingQueue<SelectionKey> keyQueue;
+ private final int maxConnections;
+ private final AtomicInteger currentConnections = new AtomicInteger(0);
public SocketChannelReader(final BufferPool bufferPool, final SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents,
- final ProcessorLog logger) {
+ final ProcessorLog logger, final int maxConnections) {
this.bufferPool = bufferPool;
this.syslogParser = syslogParser;
this.syslogEvents = syslogEvents;
this.logger = logger;
+ this.maxConnections = maxConnections;
+ this.keyQueue = new LinkedBlockingQueue<>(maxConnections);
+ this.executor = Executors.newFixedThreadPool(maxConnections);
}
@Override
public void open(final int port, int maxBufferSize) throws IOException {
- serverSocketChannel = ServerSocketChannel.open();
+ final ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
serverSocketChannel.configureBlocking(false);
if (maxBufferSize > 0) {
serverSocketChannel.setOption(StandardSocketOptions.SO_RCVBUF, maxBufferSize);
@@ -391,42 +430,85 @@ public class ListenSyslog extends AbstractSyslogProcessor {
}
}
serverSocketChannel.socket().bind(new InetSocketAddress(port));
+ selector = Selector.open();
+ serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
}
@Override
public void run() {
while (!stopped) {
try {
- final SocketChannel socketChannel = serverSocketChannel.accept();
- if (socketChannel == null) {
- Thread.sleep(1000L); // wait for an incoming connection...
- } else {
- final SocketChannelHandler handler = new SocketChannelHandler(
- bufferPool, socketChannel, syslogParser, syslogEvents, logger);
- logger.debug("Accepted incoming connection");
- executor.submit(handler);
+ int selected = selector.select();
+ if (selected > 0){
+ Iterator<SelectionKey> selectorKeys = selector.selectedKeys().iterator();
+ while (selectorKeys.hasNext()){
+ SelectionKey key = selectorKeys.next();
+ selectorKeys.remove();
+ if (!key.isValid()){
+ continue;
+ }
+ if (key.isAcceptable()) {
+ // Handle new connections coming in
+ final ServerSocketChannel channel = (ServerSocketChannel) key.channel();
+ final SocketChannel socketChannel = channel.accept();
+ // Check for available connections
+ if (currentConnections.incrementAndGet() > maxConnections){
+ currentConnections.decrementAndGet();
+ logger.info("Rejecting connection from {} because max connections has been met", new Object[]{ socketChannel.getRemoteAddress().toString() });
+ IOUtils.closeQuietly(socketChannel);
+ continue;
+ }
+ logger.debug("Accepted incoming connection from {}",
+ new Object[]{socketChannel.getRemoteAddress().toString()} );
+ // Set socket to non-blocking, and register with selector
+ socketChannel.configureBlocking(false);
+ SelectionKey readKey = socketChannel.register(selector, SelectionKey.OP_READ);
+ // Prepare the byte buffer for the reads, clear it out and attach to key
+ ByteBuffer buffer = bufferPool.poll();
+ buffer.clear();
+ buffer.mark();
+ readKey.attach(buffer);
+ } else if (key.isReadable()) {
+ // Clear out the operations the select is interested in until done reading
+ key.interestOps(0);
+ // Create and execute the read handler
+ final SocketChannelHandler handler = new SocketChannelHandler(key, this,
+ syslogParser, syslogEvents, logger);
+ // and launch the thread
+ executor.execute(handler);
+ }
+ }
+ }
+ // Add back all idle sockets to the select
+ SelectionKey key;
+ while((key = keyQueue.poll()) != null){
+ key.interestOps(SelectionKey.OP_READ);
}
} catch (IOException e) {
logger.error("Error accepting connection from SocketChannel", e);
- } catch (InterruptedException e) {
- stop();
}
}
}
@Override
public int getPort() {
- return serverSocketChannel == null ? 0 : serverSocketChannel.socket().getLocalPort();
+ // Return the port for the key listening for accepts
+ for(SelectionKey key : selector.keys()){
+ if (key.isValid() && key.isAcceptable()) {
+ return ((SocketChannel)key.channel()).socket().getLocalPort();
+ }
+ }
+ return 0;
}
@Override
public void stop() {
stopped = true;
+ selector.wakeup();
}
@Override
public void close() {
- IOUtils.closeQuietly(serverSocketChannel);
executor.shutdown();
try {
// Wait a while for existing tasks to terminate
@@ -439,6 +521,21 @@ public class ListenSyslog extends AbstractSyslogProcessor {
// Preserve interrupt status
Thread.currentThread().interrupt();
}
+ for(SelectionKey key : selector.keys()){
+ IOUtils.closeQuietly(key.channel());
+ }
+ IOUtils.closeQuietly(selector);
+ }
+
+ public void completeConnection(SelectionKey key) {
+ // connection is done. Return the buffer to the pool
+ bufferPool.returnBuffer((ByteBuffer) key.attachment(), 0);
+ currentConnections.decrementAndGet();
+ }
+
+ public void addBackForSelection(SelectionKey key) {
+ keyQueue.offer(key);
+ selector.wakeup();
}
}
@@ -449,17 +546,17 @@ public class ListenSyslog extends AbstractSyslogProcessor {
*/
public static class SocketChannelHandler implements Runnable {
- private final BufferPool bufferPool;
- private final SocketChannel socketChannel;
+ private final SelectionKey key;
+ private final SocketChannelReader dispatcher;
private final SyslogParser syslogParser;
private final BlockingQueue<SyslogEvent> syslogEvents;
private final ProcessorLog logger;
private final ByteArrayOutputStream currBytes = new ByteArrayOutputStream(4096);
- public SocketChannelHandler(final BufferPool bufferPool, final SocketChannel socketChannel, final SyslogParser syslogParser,
+ public SocketChannelHandler(final SelectionKey key, final SocketChannelReader dispatcher, final SyslogParser syslogParser,
final BlockingQueue<SyslogEvent> syslogEvents, final ProcessorLog logger) {
- this.bufferPool = bufferPool;
- this.socketChannel = socketChannel;
+ this.key = key;
+ this.dispatcher = dispatcher;
this.syslogParser = syslogParser;
this.syslogEvents = syslogEvents;
this.logger = logger;
@@ -467,55 +564,72 @@ public class ListenSyslog extends AbstractSyslogProcessor {
@Override
public void run() {
- try {
- int bytesRead = 0;
- while (bytesRead >= 0 && !Thread.interrupted()) {
-
- final ByteBuffer buffer = bufferPool.poll();
- if (buffer == null) {
- Thread.sleep(10L);
- logger.debug("no available buffers, continuing...");
- continue;
- }
+ boolean eof = false;
+ SocketChannel socketChannel = null;
+ ByteBuffer socketBuffer = null;
- try {
- // read until the buffer is full
- bytesRead = socketChannel.read(buffer);
- while (bytesRead > 0) {
- bytesRead = socketChannel.read(buffer);
- }
- buffer.flip();
-
- // go through the buffer looking for the end of each message
- int bufferLength = buffer.limit();
- for (int i = 0; i < bufferLength; i++) {
- byte currByte = buffer.get(i);
- currBytes.write(currByte);
-
- // at the end of a message so parse an event, reset the buffer, and break out of the loop
- if (currByte == '\n') {
- final SyslogEvent event = syslogParser.parseEvent(currBytes.toByteArray(),
- socketChannel.socket().getInetAddress().toString());
- logger.trace(event.getFullMessage());
- syslogEvents.put(event); // block until space is available
- currBytes.reset();
- }
+ try {
+ int bytesRead;
+ socketChannel = (SocketChannel) key.channel();
+ socketBuffer = (ByteBuffer) key.attachment();
+ // read until the buffer is full
+ while ((bytesRead = socketChannel.read(socketBuffer)) > 0) {
+ // prepare byte buffer for reading
+ socketBuffer.flip();
+ // mark the current position as start, in case of partial message read
+ socketBuffer.mark();
+
+ // get total bytes in buffer
+ int total = socketBuffer.remaining();
+ // go through the buffer looking for the end of each message
+ currBytes.reset();
+ for (int i = 0; i < total; i++) {
+ // NOTE: For higher throughput, the looking for \n and copying into the byte
+ // stream could be improved
+ // Pull data out of buffer and cram into byte array
+ byte currByte = socketBuffer.get();
+ currBytes.write(currByte);
+
+ // check if at end of a message
+ if (currByte == '\n') {
+ // parse an event, reset the buffer
+ final SyslogEvent event = syslogParser.parseEvent(currBytes.toByteArray(),
+ socketChannel.socket().getInetAddress().toString());
+ logger.trace(event.getFullMessage());
+ syslogEvents.put(event); // block until space is available
+ currBytes.reset();
+ // Mark this as the start of the next message
+ socketBuffer.mark();
}
- } finally {
- bufferPool.returnBuffer(buffer, 0);
}
+ // Preserve bytes in buffer for next call to run
+ // NOTE: This code could benefit from the two ByteBuffer read calls to avoid
+ // this compact for higher throughput
+ socketBuffer.reset();
+ socketBuffer.compact();
+ logger.debug("done handling SocketChannel");
+ }
+ // Check for closed socket
+ if( bytesRead < 0 ){
+ eof = true;
}
-
- logger.debug("done handling SocketChannel");
} catch (ClosedByInterruptException | InterruptedException e) {
- // nothing to do here
+ logger.debug("read loop interrupted, closing connection");
+ // Treat same as closed socket
+ eof = true;
} catch (IOException e) {
logger.error("Error reading from channel", e);
+ // Treat same as closed socket
+ eof = true;
} finally {
- IOUtils.closeQuietly(socketChannel);
+ if(eof == true) {
+ IOUtils.closeQuietly(socketChannel);
+ dispatcher.completeConnection(key);
+ } else {
+ dispatcher.addBackForSelection(key);
+ }
}
}
-
}
static void logMaxBufferWarning(final ProcessorLog logger, int maxBufferSize, int actualReceiveBufSize) {
http://git-wip-us.apache.org/repos/asf/nifi/blob/5611dac3/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
index 502b26f..5e558ca 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
@@ -225,6 +225,29 @@ public class PutSyslog extends AbstractSyslogProcessor {
}
}
+ private void pruneIdleSenders(final long idleThreshold){
+ long currentTime = System.currentTimeMillis();
+ final List<ChannelSender> putBack = new ArrayList<>();
+
+ // if a connection hasn't been used with in the threshold then it gets closed
+ ChannelSender sender;
+ while ((sender = senderPool.poll()) != null) {
+ if (currentTime > (sender.lastUsed + idleThreshold)) {
+ getLogger().debug("Closing idle connection...");
+ sender.close();
+ } else {
+ putBack.add(sender);
+ }
+ }
+ // re-queue senders that weren't idle, but if the queue is full then close the sender
+ for (ChannelSender putBackSender : putBack) {
+ boolean returned = senderPool.offer(putBackSender);
+ if (!returned) {
+ putBackSender.close();
+ }
+ }
+ }
+
@Override
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
final String protocol = context.getProperty(PROTOCOL).getValue();
@@ -232,27 +255,7 @@ public class PutSyslog extends AbstractSyslogProcessor {
final List<FlowFile> flowFiles = session.get(batchSize);
if (flowFiles == null || flowFiles.isEmpty()) {
- final List<ChannelSender> putBack = new ArrayList<>();
- final long expirationThreshold = context.getProperty(IDLE_EXPIRATION).asTimePeriod(TimeUnit.MILLISECONDS).longValue();
-
- // if a connection hasn't been used with in the threshold then it gets closed
- ChannelSender sender;
- while ((sender = senderPool.poll()) != null) {
- if (System.currentTimeMillis() > (sender.lastUsed + expirationThreshold)) {
- getLogger().debug("Closing idle connection...");
- sender.close();
- } else {
- putBack.add(sender);
- }
- }
-
- // re-queue senders that weren't idle, but if the queue is full then close the sender
- for (ChannelSender putBackSender : putBack) {
- boolean returned = senderPool.offer(putBackSender);
- if (!returned) {
- putBackSender.close();
- }
- }
+ pruneIdleSenders(context.getProperty(IDLE_EXPIRATION).asTimePeriod(TimeUnit.MILLISECONDS).longValue());
return;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/5611dac3/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
index 0e0d972..eb71f88 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java
@@ -391,7 +391,8 @@ public class TestListenSyslog {
}
@Override
- protected ChannelReader createChannelReader(String protocol, BufferPool bufferPool, SyslogParser syslogParser, final BlockingQueue<SyslogEvent> syslogEvents) throws IOException {
+ protected ChannelReader createChannelReader(final String protocol, final BufferPool bufferPool, final SyslogParser syslogParser,
+ final BlockingQueue<SyslogEvent> syslogEvents, int maxConnections) {
return new ChannelReader() {
@Override
public void open(int port, int maxBufferSize) throws IOException {
[48/50] [abbrv] nifi git commit: NIFI-1073 - completed more tests,
rebased on recent master
Posted by tk...@apache.org.
NIFI-1073 - completed more tests, rebased on recent master
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/1e6c10fe
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/1e6c10fe
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/1e6c10fe
Branch: refs/heads/NIFI-1073
Commit: 1e6c10fe6916b56f12e76c1c0ac89c9368deea52
Parents: 4e8e2d0
Author: Tony Kurc <tr...@gmail.com>
Authored: Sun Nov 8 22:44:49 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sun Nov 8 22:44:49 2015 -0500
----------------------------------------------------------------------
.../stream/io/TestLeakyBucketThrottler.java | 48 ++++++------
.../cluster/manager/impl/WebClusterManager.java | 13 ++--
.../repository/VolatileContentRepository.java | 9 ++-
.../org/apache/nifi/web/server/JettyServer.java | 75 ++++++++-----------
.../hadoop/TestCreateHadoopSequenceFile.java | 79 +++++++++++---------
.../processors/standard/ConvertJSONToSQL.java | 30 ++++----
.../nifi/processors/standard/GetHTTP.java | 9 ++-
.../processors/standard/ListFileTransfer.java | 9 ++-
.../nifi/processors/standard/PostHTTP.java | 2 +
.../processors/standard/TestTransformXml.java | 30 ++++----
.../pom.xml | 4 +
.../DistributedSetCacheClientService.java | 29 +++----
12 files changed, 175 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java b/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
index 52bd8de..e1d6ce0 100644
--- a/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
+++ b/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/stream/io/TestLeakyBucketThrottler.java
@@ -41,15 +41,16 @@ public class TestLeakyBucketThrottler {
final byte[] data = new byte[1024 * 1024 * 4];
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final OutputStream throttledOut = throttler.newThrottledOutputStream(baos);
-
- final long start = System.currentTimeMillis();
- throttledOut.write(data);
- throttler.close();
- final long millis = System.currentTimeMillis() - start;
- // should take 4 sec give or take
- assertTrue(millis > 3000);
- assertTrue(millis < 6000);
+ try (final OutputStream throttledOut = throttler.newThrottledOutputStream(baos) ){
+
+ final long start = System.currentTimeMillis();
+ throttledOut.write(data);
+ throttler.close();
+ final long millis = System.currentTimeMillis() - start;
+ // should take 4 sec give or take
+ assertTrue(millis > 3000);
+ assertTrue(millis < 6000);
+ }
}
@Test(timeout = 10000)
@@ -58,23 +59,22 @@ public class TestLeakyBucketThrottler {
final LeakyBucketStreamThrottler throttler = new LeakyBucketStreamThrottler(1024 * 1024);
final byte[] data = new byte[1024 * 1024 * 4];
- final ByteArrayInputStream bais = new ByteArrayInputStream(data);
- final InputStream throttledIn = throttler.newThrottledInputStream(bais);
-
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try ( final ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ final InputStream throttledIn = throttler.newThrottledInputStream(bais);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream() ){
+
+ final byte[] buffer = new byte[4096];
+ final long start = System.currentTimeMillis();
+ int len;
+ while ((len = throttledIn.read(buffer)) > 0) {
+ baos.write(buffer, 0, len);
+ }
- final byte[] buffer = new byte[4096];
- final long start = System.currentTimeMillis();
- int len;
- while ((len = throttledIn.read(buffer)) > 0) {
- baos.write(buffer, 0, len);
+ final long millis = System.currentTimeMillis() - start;
+ // should take 4 sec give or take
+ assertTrue(millis > 3000);
+ assertTrue(millis < 6000);
}
- throttler.close();
- final long millis = System.currentTimeMillis() - start;
- // should take 4 sec give or take
- assertTrue(millis > 3000);
- assertTrue(millis < 6000);
- baos.close();
}
@Test(timeout = 10000)
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
index 01f11b1..a354647 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
@@ -3402,16 +3402,15 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
completionService.submit(new Runnable() {
@Override
public void run() {
- final OutputStream drain = new OutputStream() {
- @Override
- public void write(final int b) { /* drain response */ }
- };
try {
- ((StreamingOutput) nodeResponse.getResponse().getEntity()).write(drain);
+ try (final OutputStream drain = new OutputStream() {
+ @Override
+ public void write(final int b) { /* drain response */ }
+ }) {
+ ((StreamingOutput) nodeResponse.getResponse().getEntity()).write(drain);
+ }
} catch (final IOException | WebApplicationException ex) {
logger.info("Failed clearing out non-client response buffer due to: " + ex, ex);
- } finally {
- FileUtils.closeQuietly(drain);
}
}
}, null);
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
index 0451812..29870a7 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
@@ -401,16 +401,17 @@ public class VolatileContentRepository implements ContentRepository {
@Override
public long exportTo(ContentClaim claim, OutputStream destination) throws IOException {
- final InputStream in = read(claim);
- return StreamUtils.copy(in, destination);
+ try (final InputStream in = read(claim) ){
+ return StreamUtils.copy(in, destination);
+ }
}
@Override
public long exportTo(ContentClaim claim, OutputStream destination, long offset, long length) throws IOException {
final InputStream in = read(claim);
try {
- StreamUtils.skip(in, offset);
- StreamUtils.copy(in, destination, length);
+ StreamUtils.skip(in, offset);
+ StreamUtils.copy(in, destination, length);
} finally {
FileUtils.closeQuietly(in);
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
index 73cf7c5..983ffd4 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
@@ -375,24 +375,25 @@ public class JettyServer implements NiFiServer {
}
// get an input stream for the nifi-processor configuration file
- BufferedReader in = new BufferedReader(new InputStreamReader(jarFile.getInputStream(jarEntry)));
-
- // read in each configured type
- String rawComponentType;
- while ((rawComponentType = in.readLine()) != null) {
- // extract the component type
- final String componentType = extractComponentType(rawComponentType);
- if (componentType != null) {
- List<String> extensions = uiExtensions.get(uiExtensionType);
-
- // if there are currently no extensions for this type create it
- if (extensions == null) {
- extensions = new ArrayList<>();
- uiExtensions.put(uiExtensionType, extensions);
- }
+ try (BufferedReader in = new BufferedReader(new InputStreamReader(jarFile.getInputStream(jarEntry)))) {
+
+ // read in each configured type
+ String rawComponentType;
+ while ((rawComponentType = in.readLine()) != null) {
+ // extract the component type
+ final String componentType = extractComponentType(rawComponentType);
+ if (componentType != null) {
+ List<String> extensions = uiExtensions.get(uiExtensionType);
+
+ // if there are currently no extensions for this type create it
+ if (extensions == null) {
+ extensions = new ArrayList<>();
+ uiExtensions.put(uiExtensionType, extensions);
+ }
- // add the specified type
- extensions.add(componentType);
+ // add the specified type
+ extensions.add(componentType);
+ }
}
}
}
@@ -440,40 +441,30 @@ public class JettyServer implements NiFiServer {
*/
private List<String> getWarExtensions(final File war, final String path) {
List<String> processorTypes = new ArrayList<>();
- JarFile jarFile = null;
- BufferedReader in = null;
- try {
- // load the jar file and attempt to find the nifi-processor entry
- jarFile = new JarFile(war);
+
+ // load the jar file and attempt to find the nifi-processor entry
+ try (JarFile jarFile = new JarFile(war)) {
JarEntry jarEntry = jarFile.getJarEntry(path);
// ensure the nifi-processor entry was found
if (jarEntry != null) {
// get an input stream for the nifi-processor configuration file
- in = new BufferedReader(new InputStreamReader(jarFile.getInputStream(jarEntry)));
-
- // read in each configured type
- String rawProcessorType;
- while ((rawProcessorType = in.readLine()) != null) {
- // extract the processor type
- final String processorType = extractComponentType(rawProcessorType);
- if (processorType != null) {
- processorTypes.add(processorType);
+ try (final BufferedReader in = new BufferedReader(new InputStreamReader(jarFile.getInputStream(jarEntry))) ){
+
+ // read in each configured type
+ String rawProcessorType;
+ while ((rawProcessorType = in.readLine()) != null) {
+ // extract the processor type
+ final String processorType = extractComponentType(rawProcessorType);
+ if (processorType != null) {
+ processorTypes.add(processorType);
+ }
}
}
}
} catch (IOException ioe) {
- logger.warn(String.format("Unable to inspect %s for a custom processor UI.", war));
- } finally {
- // close the jar file - which closes all input streams obtained via getInputStream above
- if (jarFile != null) {
- FileUtils.closeQuietly(jarFile);
- }
- // close the BufferedReader, this may not be strictly necessary
- if (in != null){
- FileUtils.closeQuietly(in);
- }
- }
+ logger.warn("Unable to inspect {} for a custom processor UI.", new Object[]{war, ioe});
+ }
return processorTypes;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
index 430b4fa..30d386a 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
@@ -71,9 +71,11 @@ public class TestCreateHadoopSequenceFile {
}
@Test
- public void testSimpleCase() throws FileNotFoundException {
+ public void testSimpleCase() throws IOException {
for (File inFile : inFiles) {
- controller.enqueue(new FileInputStream(inFile));
+ try (FileInputStream fin = new FileInputStream(inFile) ) {
+ controller.enqueue(fin);
+ }
}
controller.run(3);
@@ -88,7 +90,9 @@ public class TestCreateHadoopSequenceFile {
@Test
public void testSequenceFileSaysValueIsBytesWritable() throws UnsupportedEncodingException, IOException {
for (File inFile : inFiles) {
- controller.enqueue(new FileInputStream(inFile));
+ try (FileInputStream fin = new FileInputStream(inFile) ){
+ controller.enqueue();
+ }
}
controller.run(3);
@@ -118,35 +122,39 @@ public class TestCreateHadoopSequenceFile {
}
@Test
- public void testMergedTarData() throws FileNotFoundException {
+ public void testMergedTarData() throws IOException {
Map<String, String> attributes = new HashMap<>();
attributes.put(CoreAttributes.MIME_TYPE.key(), "application/tar");
- controller.enqueue(new FileInputStream("src/test/resources/testdata/13545312236534130.tar"), attributes);
- controller.run();
- List<MockFlowFile> successSeqFiles = controller.getFlowFilesForRelationship(CreateHadoopSequenceFile.RELATIONSHIP_SUCCESS);
- assertEquals(1, successSeqFiles.size());
- final byte[] data = successSeqFiles.iterator().next().toByteArray();
- // Data should be greater than 1000000 because that's the size of 2 of our input files,
- // and the file size should contain all of that plus headers, but the headers should only
- // be a couple hundred bytes.
- assertTrue(data.length > 1000000);
- assertTrue(data.length < 1501000);
+ try (final FileInputStream fin = new FileInputStream("src/test/resources/testdata/13545312236534130.tar")) {
+ controller.enqueue(fin, attributes);
+ controller.run();
+ List<MockFlowFile> successSeqFiles = controller.getFlowFilesForRelationship(CreateHadoopSequenceFile.RELATIONSHIP_SUCCESS);
+ assertEquals(1, successSeqFiles.size());
+ final byte[] data = successSeqFiles.iterator().next().toByteArray();
+ // Data should be greater than 1000000 because that's the size of 2 of our input files,
+ // and the file size should contain all of that plus headers, but the headers should only
+ // be a couple hundred bytes.
+ assertTrue(data.length > 1000000);
+ assertTrue(data.length < 1501000);
+ }
}
@Test
public void testMergedZipData() throws IOException {
Map<String, String> attributes = new HashMap<>();
attributes.put(CoreAttributes.MIME_TYPE.key(), "application/zip");
- controller.enqueue(new FileInputStream("src/test/resources/testdata/13545423550275052.zip"), attributes);
- controller.run();
- List<MockFlowFile> successSeqFiles = controller.getFlowFilesForRelationship(CreateHadoopSequenceFile.RELATIONSHIP_SUCCESS);
- assertEquals(1, successSeqFiles.size());
- final byte[] data = successSeqFiles.iterator().next().toByteArray();
- // Data should be greater than 1000000 because that's the size of 2 of our input files,
- // and the file size should contain all of that plus headers, but the headers should only
- // be a couple hundred bytes.
- assertTrue(data.length > 1000000);
- assertTrue(data.length < 1501000);
+ try (FileInputStream fin = new FileInputStream("src/test/resources/testdata/13545423550275052.zip")){
+ controller.enqueue(fin, attributes);
+ controller.run();
+ List<MockFlowFile> successSeqFiles = controller.getFlowFilesForRelationship(CreateHadoopSequenceFile.RELATIONSHIP_SUCCESS);
+ assertEquals(1, successSeqFiles.size());
+ final byte[] data = successSeqFiles.iterator().next().toByteArray();
+ // Data should be greater than 1000000 because that's the size of 2 of our input files,
+ // and the file size should contain all of that plus headers, but the headers should only
+ // be a couple hundred bytes.
+ assertTrue(data.length > 1000000);
+ assertTrue(data.length < 1501000);
+ }
// FileOutputStream fos = new FileOutputStream("zip-3-randoms.sf");
// fos.write(data);
// fos.flush();
@@ -157,16 +165,19 @@ public class TestCreateHadoopSequenceFile {
public void testMergedFlowfilePackagedData() throws IOException {
Map<String, String> attributes = new HashMap<>();
attributes.put(CoreAttributes.MIME_TYPE.key(), "application/flowfile-v3");
- controller.enqueue(new FileInputStream("src/test/resources/testdata/13545479542069498.pkg"), attributes);
- controller.run();
- List<MockFlowFile> successSeqFiles = controller.getFlowFilesForRelationship(CreateHadoopSequenceFile.RELATIONSHIP_SUCCESS);
- assertEquals(1, successSeqFiles.size());
- final byte[] data = successSeqFiles.iterator().next().toByteArray();
- // Data should be greater than 1000000 because that's the size of 2 of our input files,
- // and the file size should contain all of that plus headers, but the headers should only
- // be a couple hundred bytes.
- assertTrue(data.length > 1000000);
- assertTrue(data.length < 1501000);
+ try ( final FileInputStream fin = new FileInputStream("src/test/resources/testdata/13545479542069498.pkg")) {
+ controller.enqueue(fin, attributes);
+
+ controller.run();
+ List<MockFlowFile> successSeqFiles = controller.getFlowFilesForRelationship(CreateHadoopSequenceFile.RELATIONSHIP_SUCCESS);
+ assertEquals(1, successSeqFiles.size());
+ final byte[] data = successSeqFiles.iterator().next().toByteArray();
+ // Data should be greater than 1000000 because that's the size of 2 of our input files,
+ // and the file size should contain all of that plus headers, but the headers should only
+ // be a couple hundred bytes.
+ assertTrue(data.length > 1000000);
+ assertTrue(data.length < 1501000);
+ }
// FileOutputStream fos = new FileOutputStream("flowfilePkg-3-randoms.sf");
// fos.write(data);
// fos.flush();
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java
index 9591960..6f14800 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java
@@ -561,25 +561,27 @@ public class ConvertJSONToSQL extends AbstractProcessor {
public static TableSchema from(final Connection conn, final String catalog, final String tableName,
final boolean translateColumnNames, final boolean includePrimaryKeys) throws SQLException {
- final ResultSet colrs = conn.getMetaData().getColumns(catalog, null, tableName, "%");
+ try (final ResultSet colrs = conn.getMetaData().getColumns(catalog, null, tableName, "%")) {
- final List<ColumnDescription> cols = new ArrayList<>();
- while (colrs.next()) {
- final ColumnDescription col = ColumnDescription.from(colrs);
- cols.add(col);
- }
+ final List<ColumnDescription> cols = new ArrayList<>();
+ while (colrs.next()) {
+ final ColumnDescription col = ColumnDescription.from(colrs);
+ cols.add(col);
+ }
- final Set<String> primaryKeyColumns = new HashSet<>();
- if (includePrimaryKeys) {
- final ResultSet pkrs = conn.getMetaData().getPrimaryKeys(catalog, null, tableName);
+ final Set<String> primaryKeyColumns = new HashSet<>();
+ if (includePrimaryKeys) {
+ try (final ResultSet pkrs = conn.getMetaData().getPrimaryKeys(catalog, null, tableName)) {
- while (pkrs.next()) {
- final String colName = pkrs.getString("COLUMN_NAME");
- primaryKeyColumns.add(normalizeColumnName(colName, translateColumnNames));
+ while (pkrs.next()) {
+ final String colName = pkrs.getString("COLUMN_NAME");
+ primaryKeyColumns.add(normalizeColumnName(colName, translateColumnNames));
+ }
+ }
}
- }
- return new TableSchema(cols, translateColumnNames, primaryKeyColumns);
+ return new TableSchema(cols, translateColumnNames, primaryKeyColumns);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java
index 48ca2de..06d7182 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java
@@ -49,13 +49,13 @@ import java.util.regex.Pattern;
import javax.net.ssl.SSLContext;
+import org.apache.commons.io.IOUtils;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
-import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.config.Registry;
@@ -67,6 +67,7 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.apache.nifi.annotation.behavior.InputRequirement;
@@ -427,7 +428,7 @@ public class GetHTTP extends AbstractSessionFactoryProcessor {
}
// create the http client
- final HttpClient client = clientBuilder.build();
+ final CloseableHttpClient client = clientBuilder.build();
// create request
final HttpGet get = new HttpGet(url);
@@ -527,9 +528,13 @@ public class GetHTTP extends AbstractSessionFactoryProcessor {
session.rollback();
logger.error("Failed to process due to {}; rolling back session", new Object[]{t.getMessage()}, t);
throw t;
+ } finally {
+ IOUtils.closeQuietly(client);
}
+
} finally {
+
conMan.shutdown();
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
index ce344ed..994ccf0 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
@@ -93,8 +93,13 @@ public abstract class ListFileTransfer extends AbstractListProcessor<FileInfo> {
@Override
protected List<FileInfo> performListing(final ProcessContext context, final Long minTimestamp) throws IOException {
final FileTransfer transfer = getFileTransfer(context);
- final List<FileInfo> listing = transfer.getListing();
- FileUtils.closeQuietly(transfer);
+ final List<FileInfo> listing;
+ try {
+ listing = transfer.getListing();
+ } finally {
+ FileUtils.closeQuietly(transfer);
+ }
+
if (minTimestamp == null) {
return listing;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
index ef84629..9a7f0f4 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
@@ -49,6 +49,7 @@ import javax.net.ssl.SSLSession;
import javax.security.cert.X509Certificate;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.compress.utils.IOUtils;
import org.apache.http.Header;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
@@ -637,6 +638,7 @@ public class PostHTTP extends AbstractProcessor {
+ "configured to deliver FlowFiles; rolling back session", new Object[]{url});
session.rollback();
context.yield();
+ IOUtils.closeQuietly(client);
return;
}
} else {
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java
index 7074ec9..7239f01 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java
@@ -93,23 +93,25 @@ public class TestTransformXml {
StringBuilder builder = new StringBuilder();
builder.append("<data>\n");
- InputStream in = new FileInputStream(new File("src/test/resources/TestTransformXml/tokens.csv"));
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+ try(BufferedReader reader = new BufferedReader(new InputStreamReader(
+ new FileInputStream(new File("src/test/resources/TestTransformXml/tokens.csv"))))){
- String line = null;
- while ((line = reader.readLine()) != null) {
- builder.append(line).append("\n");
- }
- builder.append("</data>");
- String data = builder.toString();
- runner.enqueue(data.getBytes(), attributes);
- runner.run();
- runner.assertAllFlowFilesTransferred(TransformXml.REL_SUCCESS);
- final MockFlowFile transformed = runner.getFlowFilesForRelationship(TransformXml.REL_SUCCESS).get(0);
- final String transformedContent = new String(transformed.toByteArray(), StandardCharsets.ISO_8859_1);
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ builder.append(line).append("\n");
+ }
+ builder.append("</data>");
+ String data = builder.toString();
+ runner.enqueue(data.getBytes(), attributes);
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(TransformXml.REL_SUCCESS);
+ final MockFlowFile transformed = runner.getFlowFilesForRelationship(TransformXml.REL_SUCCESS).get(0);
+ final String transformedContent = new String(transformed.toByteArray(), StandardCharsets.ISO_8859_1);
- transformed.assertContentEquals(Paths.get("src/test/resources/TestTransformXml/tokens.xml"));
+ transformed.assertContentEquals(Paths.get("src/test/resources/TestTransformXml/tokens.xml"));
+ }
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
index e05f4dc..e335b1e 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/pom.xml
@@ -47,5 +47,9 @@
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-service-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/nifi/blob/1e6c10fe/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedSetCacheClientService.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedSetCacheClientService.java b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedSetCacheClientService.java
index 8c95c77..fd855e4 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedSetCacheClientService.java
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedSetCacheClientService.java
@@ -24,6 +24,7 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.io.IOUtils;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.SeeAlso;
import org.apache.nifi.annotation.documentation.Tags;
@@ -127,10 +128,7 @@ public class DistributedSetCacheClientService extends AbstractControllerService
try {
ProtocolHandshake.initiateHandshake(session.getInputStream(), session.getOutputStream(), versionNegotiator);
} catch (final HandshakeException e) {
- try {
- session.close();
- } catch (final IOException ioe) {
- }
+ IOUtils.closeQuietly(session);
throw new IOException(e);
}
@@ -162,9 +160,9 @@ public class DistributedSetCacheClientService extends AbstractControllerService
try (final DataOutputStream dos = new DataOutputStream(commsSession.getOutputStream())) {
dos.writeUTF("close");
dos.flush();
- commsSession.close();
} catch (final IOException e) {
}
+ IOUtils.closeQuietly(commsSession);
}
if (logger.isDebugEnabled() && getIdentifier() != null) {
logger.debug("Closed {}", new Object[]{getIdentifier()});
@@ -185,6 +183,7 @@ public class DistributedSetCacheClientService extends AbstractControllerService
}
final CommsSession session = leaseCommsSession();
+ boolean sessionError = false;
try {
final DataOutputStream dos = new DataOutputStream(session.getOutputStream());
dos.writeUTF(methodName);
@@ -198,22 +197,14 @@ public class DistributedSetCacheClientService extends AbstractControllerService
final DataInputStream dis = new DataInputStream(session.getInputStream());
return dis.readBoolean();
} catch (final IOException ioe) {
- try {
- session.close();
- } catch (final IOException ignored) {
- }
-
+ sessionError = true;
throw ioe;
} finally {
- if (!session.isClosed()) {
- if (this.closed) {
- try {
- session.close();
- } catch (final IOException ioe) {
- }
- } else {
- queue.offer(session);
- }
+ if (sessionError == false && this.closed == false) {
+ queue.offer(session);
+ }
+ else{
+ IOUtils.closeQuietly(session);
}
}
}
[17/50] [abbrv] nifi git commit: NIFI-730: Ensure that we always
populate queue counts when initiating a Drop FlowFile request
Posted by tk...@apache.org.
NIFI-730: Ensure that we always populate queue counts when initiating a Drop FlowFile request
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f5727cfb
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f5727cfb
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f5727cfb
Branch: refs/heads/NIFI-1073
Commit: f5727cfb0fe73b7226fe9eca96fd594f8d423ffa
Parents: edf238e
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 2 08:36:50 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Nov 2 08:36:50 2015 -0500
----------------------------------------------------------------------
.../apache/nifi/controller/StandardFlowFileQueue.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/f5727cfb/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
----------------------------------------------------------------------
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 0f6d258..6b6bb57 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
@@ -923,7 +923,15 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
}
final DropFlowFileRequest dropRequest = new DropFlowFileRequest(requestIdentifier);
- dropRequest.setCurrentSize(size());
+ final QueueSize originalSize = getQueueSize();
+ dropRequest.setCurrentSize(originalSize);
+ dropRequest.setOriginalSize(originalSize);
+ if (originalSize.getObjectCount() == 0) {
+ dropRequest.setDroppedSize(originalSize);
+ dropRequest.setState(DropFlowFileState.COMPLETE);
+ return dropRequest;
+ }
+
final Thread t = new Thread(new Runnable() {
@Override
public void run() {
@@ -931,7 +939,6 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
try {
dropRequest.setState(DropFlowFileState.DROPPING_FLOWFILES);
logger.debug("For DropFlowFileRequest {}, original size is {}", requestIdentifier, getQueueSize());
- dropRequest.setOriginalSize(getQueueSize());
try {
final List<FlowFileRecord> activeQueueRecords = new ArrayList<>(activeQueue);