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

ASF GitHub Bot logged work on GOBBLIN-1918:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Sep/23 17:08
            Start Date: 22/Sep/23 17:08
    Worklog Time Spent: 10m 
      Work Description: Will-Lo opened a new pull request, #3787:
URL: https://github.com/apache/gobblin/pull/3787

   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I 
have checked off all the steps below!
   
   
   ### JIRA
   - [ ] My PR addresses the following [Gobblin 
JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references 
them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1918
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if 
applicable):
   The GobblinOrcWriter contains a converter and a buffer rowbatch. The buffer 
holds the converted Avro -> Orc records before adding them to the native orc 
writer.
   
   Since it can contain multiple records, it constantly needs to resize the 
columns of the rowbatch in order to hold multiple records. This problem affects 
both performance and memory when resizing is done either too often (enlarge 
factor is too low) or not often enough (enlarge factor is too high and thus the 
buffer dominates the container memory).
   
   Because there is a bounded number of records that can persist in the buffer 
before getting flushed, we want to reduce the aggressiveness of the resizing 
algorithm the more records that have been processed.
   
   This PR proposes changing the smart resizing algorithm to be a *exponential 
decay algorithm*, where it is bounded between some max and a min. Given the 
default values, it will converge to the min at around ~500 records. 
   
   The logic here is that after a rowbatch is saturated, it is very unlikely 
that it needs to be resized significantly, otherwise a record with large arrays 
can cause the rowbatch to grow out of bounds and cause OOM. So when the row 
batch approaches saturation, we want to decrease the amount we are resizing by.
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   
   ### Commits
   - [ ] My commits all reference JIRA issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   




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

            Worklog Id:     (was: 881437)
    Remaining Estimate: 0h
            Time Spent: 10m

> Optimize smart resizing for ORC Writer converter buffer
> -------------------------------------------------------
>
>                 Key: GOBBLIN-1918
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1918
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-core
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The GobblinOrcWriter contains a converter and a buffer rowbatch. The buffer 
> holds the converted Avro -> Orc records before adding them to the native orc 
> writer.
> Since it can contain multiple records, it constantly needs to resize the 
> columns of the rowbatch in order to hold multiple records. This problem 
> affects both performance and memory when resizing is done either too often 
> (enlarge factor is too low) or not often enough (enlarge factor is too high 
> and thus the buffer dominates the container memory).
> Because there is a bounded number of records that can persist in the buffer 
> before getting flushed, we want to reduce the aggressiveness of the resizing 
> algorithm the more records that have been processed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to