nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bbe...@apache.org
Subject nifi git commit: NIFI-919 Committed wrong version of SplitAvro, this version demonstrates the error
Date Thu, 03 Sep 2015 18:58:58 GMT
Repository: nifi
Updated Branches:
  refs/heads/NIFI-919 af88def24 -> eb64448e6


NIFI-919 Committed wrong version of SplitAvro, this version demonstrates the error


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/eb64448e
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/eb64448e
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/eb64448e

Branch: refs/heads/NIFI-919
Commit: eb64448e628a045dfac8066672a4ad810bc6d306
Parents: af88def
Author: Bryan Bende <bbende@apache.org>
Authored: Thu Sep 3 14:58:47 2015 -0400
Committer: Bryan Bende <bbende@apache.org>
Committed: Thu Sep 3 14:58:47 2015 -0400

----------------------------------------------------------------------
 .../org/apache/nifi/processors/avro/SplitAvro.java    | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/eb64448e/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java
b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java
index 4f3c890..b21dc51 100644
--- a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java
+++ b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/src/main/java/org/apache/nifi/processors/avro/SplitAvro.java
@@ -297,31 +297,23 @@ public class SplitAvro extends AbstractProcessor {
 
                                         writer.setCodec(CodecFactory.fromString(codec.get()));
                                         writer.create(reader.getSchema(), out);
-                                        writer.sync();
 
                                         // we already read the first block so update the
count and append that block
                                         long recordCount = reader.getBlockCount();
-                                        //writer.appendEncoded(outerBlock.get());
-                                        out.write(outerBlock.get().array());
-                                        writer.sync();
+                                        writer.appendEncoded(outerBlock.get());
 
                                         if (recordCount < splitSize) {
                                             try {
                                                 // now loop again until no more blocks or
we reached the split size
                                                 final ObjectHolder<ByteBuffer> innerBlock
= new ObjectHolder<>(reader.nextBlock());
                                                 while (innerBlock.get() != null &&
recordCount < splitSize) {
-                                                    //writer.appendEncoded(innerBlock.get());
-                                                    out.write(innerBlock.get().array());
-                                                    writer.sync();
-
+                                                    writer.appendEncoded(innerBlock.get());
                                                     recordCount += reader.getBlockCount();
                                                     innerBlock.set(reader.nextBlock());
                                                 }
 
                                                 if (innerBlock.get() != null) {
-                                                    //writer.appendEncoded(innerBlock.get());
-                                                    out.write(innerBlock.get().array());
-                                                    writer.sync();
+                                                    writer.appendEncoded(innerBlock.get());
                                                 }
                                             } catch (NoSuchElementException e) {
                                                 getLogger().debug("Reached end of datafile
for {}", new Object[]{originalFlowFile});


Mime
View raw message