autumnust commented on a change in pull request #909:
URL: https://github.com/apache/orc/pull/909#discussion_r743901933



##########
File path: java/core/src/test/org/apache/orc/impl/TestOutStream.java
##########
@@ -59,6 +60,56 @@ public void testFlush() throws Exception {
     }
   }
 
+  /**
+   * Creates randomness into whether a compression should be committed or 
aborted (so that
+   * the isOriginal bits is set to true and data being flushed as 
uncompressed).
+   * This class should be used for testing purpose only.
+   */
+  private static class TestZlibCodec extends ZlibCodec {
+    private Random rand = new Random();
+
+    @Override
+    public boolean compress(ByteBuffer in, ByteBuffer out, ByteBuffer 
overflow, Options options) {
+      super.compress(in, out, overflow, options);
+      return rand.nextBoolean();
+    }
+  }
+
+  @Test
+  public void testCompressWithoutEncryption() throws Exception {
+    TestInStream.OutputCollector receiver = new TestInStream.OutputCollector();
+    CompressionCodec codec = new TestZlibCodec();
+    StreamOptions options = new StreamOptions( 1024)

Review comment:
       Thanks for reviewing ! Will address. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to