[ 
https://issues.apache.org/jira/browse/BEAM-9325?focusedWorklogId=413380&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-413380
 ]

ASF GitHub Bot logged work on BEAM-9325:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Mar/20 17:07
            Start Date: 31/Mar/20 17:07
    Worklog Time Spent: 10m 
      Work Description: lukemin89 commented on pull request #11263: [BEAM-9325] 
Override proper write method in UnownedOutputStream
URL: https://github.com/apache/beam/pull/11263#discussion_r401075112
 
 

 ##########
 File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/util/UnownedOutputStreamTest.java
 ##########
 @@ -53,4 +56,22 @@ public void testClosingThrows() throws Exception {
     expectedException.expectMessage("Caller does not own the underlying");
     os.close();
   }
+
+  @Test
+  public void testWrite() throws IOException {
+    ByteArrayOutputStream expected = new ByteArrayOutputStream();
+    ByteArrayOutputStream actual = new ByteArrayOutputStream();
+    UnownedOutputStream osActual = new UnownedOutputStream(actual);
+
+    byte[] data0 = "Hello World!".getBytes(StandardCharsets.UTF_8);
+    byte[] data1 = "Welcome!".getBytes(StandardCharsets.UTF_8);
+
+    expected.write(data0, 0, data0.length);
+    osActual.write(data0, 0, data0.length);
+
+    expected.write(data1, 0, data1.length);
+    osActual.write(data1, 0, data1.length);
+
+    assertArrayEquals(expected.toByteArray(), actual.toByteArray());
 
 Review comment:
   Added CallCountOutput Stream. Testing the proper number of call count.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 413380)
    Time Spent: 3h  (was: 2h 50m)

> UnownedOutputStream not overriding Array write method.
> ------------------------------------------------------
>
>                 Key: BEAM-9325
>                 URL: https://issues.apache.org/jira/browse/BEAM-9325
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>    Affects Versions: 2.19.0
>            Reporter: Kyoungha Min
>            Assignee: Kyoungha Min
>            Priority: Major
>             Fix For: 2.21.0
>
>   Original Estimate: 1m
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> org.apache.beam.sdk.util.UnownedOutputStream does not override a method
> `public void write(byte b[], int off, int len) throws IOException`
> resulting in extremely slow writing speed.
> This is because `java.io.FilteredOutputStream` does not provide proper method.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to