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

ASF GitHub Bot logged work on HDDS-2233:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Oct/19 12:40
            Start Date: 04/Oct/19 12:40
    Worklog Time Spent: 10m 
      Work Description: fapifta commented on pull request #1596: HDDS-2233 - 
Remove ByteStringHelper and refactor the code to the place where it used
URL: https://github.com/apache/hadoop/pull/1596
 
 
   There are a couple of things in this pull request.
   ByteStringHelper was used in two general places, once in BlockOutputStream, 
and once in ChunkUtils.
   ChunkUtils was an easy one, as in that case the method was used directly 
from KeyValueHandler only, where the configuration is present. I moved the 
logic back to the KeyValueHandler class, and at initialization time, I created 
the proper converter based on the config.
   At this point I realized that we use byte[] type in readChunk like methods 
here and there, but at the end most of the usage outside is via a ByteBuffer 
after a ByteBuffer.wrap(byte[]) call, so I changed the readChunk logic to 
return a ByteBuffer instead, and used that one, with this I eliminated the need 
of a conversion from byte[] to ByteString.
   
   BlockOutputStream was a bit harder, as in that case, RPCClient initialized 
the old class with the config. The decision became the following: based on the 
Configuration, RPCClient already created an XCeiverClientManager that preserved 
a reference to the configuration, and which was already available in the 
BlockOutputStreamEntryPool class, that uses a BufferPool to create the buffers 
in BlockOutputStream, so that BlockOutputStream when does the conversion can 
reach it via its BufferPool.
   
   I have cleaned up one code path, that came into my way during 
implementation, and I removed two declared exception from ChunkUtils.readData, 
and with that eliminated the need for a try-catch block in the place where it 
is called.
 
----------------------------------------------------------------
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: 323395)
    Remaining Estimate: 0h
            Time Spent: 10m

> Remove ByteStringHelper and refactor the code to the place where it used
> ------------------------------------------------------------------------
>
>                 Key: HDDS-2233
>                 URL: https://issues.apache.org/jira/browse/HDDS-2233
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Istvan Fajth
>            Priority: Critical
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> See HDDS-2203 where there is a race condition reported by me.
> Later in the discussion we agreed that it is better to refactor the code and 
> remove the class completely for now, and that would also resolve the race 
> condition.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to