[11/12] incubator-nifi git commit: NIFI-271
NIFI-271 Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/525ce7fb Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/525ce7fb Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/525ce7fb Branch: refs/heads/develop Commit: 525ce7fb2db5c039c3b5d1c36085953f6ca9af10 Parents: e1160f5 Author: joewitt joew...@apache.org Authored: Tue Apr 28 00:32:13 2015 -0400 Committer: joewitt joew...@apache.org Committed: Tue Apr 28 00:32:13 2015 -0400 -- .../flowfile/attributes/CoreAttributes.java | 12 +- .../apache/nifi/remote/VersionNegotiator.java | 15 +-- .../TransmissionDisabledException.java | 3 +- .../nifi/remote/io/CompressionOutputStream.java | 3 +- .../remote/io/socket/BufferStateManager.java| 4 +- .../socket/ssl/SSLSocketChannelInputStream.java | 3 +- .../ssl/SSLSocketChannelOutputStream.java | 3 +- .../nifi/stream/io/BufferedInputStream.java | 7 +- .../nifi/stream/io/BufferedOutputStream.java| 31 ++--- .../nifi/stream/io/ByteArrayInputStream.java| 113 ++ .../nifi/stream/io/ByteArrayOutputStream.java | 80 + .../stream/io/ByteCountingOutputStream.java | 5 +- .../apache/nifi/stream/io/DataOutputStream.java | 113 ++ .../apache/nifi/stream/io/GZIPOutputStream.java | 4 +- .../stream/io/LeakyBucketStreamThrottler.java | 3 +- .../stream/io/MinimumLengthInputStream.java | 3 +- .../nifi/stream/io/NonCloseableInputStream.java | 5 +- .../org/apache/nifi/stream/io/StreamUtils.java | 30 ++--- .../apache/nifi/stream/io/ZipOutputStream.java | 5 +- .../java/org/apache/nifi/util/EscapeUtils.java | 4 +- .../java/org/apache/nifi/util/LongHolder.java | 6 +- .../apache/nifi/util/NaiveSearchRingBuffer.java | 21 ++-- .../java/org/apache/nifi/util/RingBuffer.java | 26 ++--- .../java/org/apache/nifi/util/StopWatch.java| 3 +- .../org/apache/nifi/util/file/FileUtils.java| 114 ++- .../file/monitor/CompoundUpdateMonitor.java | 7 +- .../file/monitor/SynchronousFileWatcher.java| 6 +- .../org/apache/nifi/util/search/Search.java | 18 +-- .../org/apache/nifi/util/search/SearchTerm.java | 5 +- 29 files changed, 203 insertions(+), 449 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/525ce7fb/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/CoreAttributes.java -- diff --git a/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/CoreAttributes.java b/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/CoreAttributes.java index b0f4048..9b4c3af 100644 --- a/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/CoreAttributes.java +++ b/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/CoreAttributes.java @@ -19,18 +19,15 @@ package org.apache.nifi.flowfile.attributes; public enum CoreAttributes implements FlowFileAttributeKey { /** - * The flowfile's path indicates the relative directory to which a FlowFile - * belongs and does not contain the filename + * The flowfile's path indicates the relative directory to which a FlowFile belongs and does not contain the filename */ PATH(path), /** - * The flowfile's absolute path indicates the absolute directory to which a - * FlowFile belongs and does not contain the filename + * The flowfile's absolute path indicates the absolute directory to which a FlowFile belongs and does not contain the filename */ ABSOLUTE_PATH(absolute.path), /** - * The filename of the FlowFile. The filename should not contain any - * directory structure. + * The filename of the FlowFile. The filename should not contain any directory structure. */ FILENAME(filename), /** @@ -50,8 +47,7 @@ public enum CoreAttributes implements FlowFileAttributeKey { */ DISCARD_REASON(discard.reason), /** - * Indicates an identifier other than the FlowFile's UUID that is known to - * refer to this FlowFile. + * Indicates an identifier other than the FlowFile's UUID that is known to refer to this FlowFile. */ ALTERNATE_IDENTIFIER(alternate.identifier); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/525ce7fb/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/remote/VersionNegotiator.java -- diff --git a/nifi/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/remote/VersionNegotiator.java
[11/12] incubator-nifi git commit: NIFI-271
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/d29a2d68/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java -- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java index b37471e..65bbb36 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java @@ -96,14 +96,14 @@ public class PutJMS extends AbstractProcessor { public static final Charset UTF8 = Charset.forName(UTF-8); public static final int DEFAULT_MESSAGE_PRIORITY = 4; -public static final Relationship REL_SUCCESS = new Relationship.Builder(). -name(success). -description(All FlowFiles that are sent to the JMS destination are routed to this relationship). -build(); -public static final Relationship REL_FAILURE = new Relationship.Builder(). -name(failure). -description(All FlowFiles that cannot be routed to the JMS destination are routed to this relationship). -build(); +public static final Relationship REL_SUCCESS = new Relationship.Builder() +.name(success) +.description(All FlowFiles that are sent to the JMS destination are routed to this relationship) +.build(); +public static final Relationship REL_FAILURE = new Relationship.Builder() +.name(failure) +.description(All FlowFiles that cannot be routed to the JMS destination are routed to this relationship) +.build(); private final QueueWrappedMessageProducer producerQueue = new LinkedBlockingQueue(); private final ListPropertyDescriptor properties; @@ -156,10 +156,7 @@ public class PutJMS extends AbstractProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { final ProcessorLog logger = getLogger(); -final ListFlowFile flowFiles = session.get(context. -getProperty(BATCH_SIZE). -asInteger(). -intValue()); +final ListFlowFile flowFiles = session.get(context.getProperty(BATCH_SIZE).asInteger().intValue()); if (flowFiles.isEmpty()) { return; } @@ -167,14 +164,10 @@ public class PutJMS extends AbstractProcessor { WrappedMessageProducer wrappedProducer = producerQueue.poll(); if (wrappedProducer == null) { try { -wrappedProducer = JmsFactory. -createMessageProducer(context, true); -logger.info(Connected to JMS server {}, new Object[]{context. -getProperty(URL). -getValue()}); +wrappedProducer = JmsFactory.createMessageProducer(context, true); +logger.info(Connected to JMS server {}, new Object[]{context.getProperty(URL).getValue()}); } catch (final JMSException e) { -logger. -error(Failed to connect to JMS Server due to {}, new Object[]{e}); +logger.error(Failed to connect to JMS Server due to {}, new Object[]{e}); session.transfer(flowFiles, REL_FAILURE); context.yield(); return; @@ -184,9 +177,7 @@ public class PutJMS extends AbstractProcessor { final Session jmsSession = wrappedProducer.getSession(); final MessageProducer producer = wrappedProducer.getProducer(); -final int maxBufferSize = context.getProperty(MAX_BUFFER_SIZE). -asDataSize(DataUnit.B). -intValue(); +final int maxBufferSize = context.getProperty(MAX_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); try { final SetFlowFile successfulFlowFiles = new HashSet(); @@ -194,8 +185,7 @@ public class PutJMS extends AbstractProcessor { for (FlowFile flowFile : flowFiles) { if (flowFile.getSize() maxBufferSize) { session.transfer(flowFile, REL_FAILURE); -logger. -warn(Routing {} to failure because its size exceeds the configured max, new Object[]{flowFile}); +logger.warn(Routing {} to failure because its size exceeds the configured max, new Object[]{flowFile}); continue; } @@ -208,29 +198,18 @@ public class PutJMS extends AbstractProcessor {