errose28 commented on PR #1321:
URL: https://github.com/apache/ratis/pull/1321#issuecomment-3662859003

   > I think about this change. It seems not a good idea to simple changing the 
methods to public and let other projects using it. We should have some kind of 
APIs.
   
   The class is already public so it is part of the API. We are not changing 
arbitrary methods to public either. The class is named `LogSegmentStartEnd`, so 
it seems reasonable for it to expose read-only methods to retrieve the start 
and end indices that it is named for. The `compareTo` method which works on 
these indices is public as well.
   
   > I wonder if the we could move the RaftLog tool from Ozone to Ratis?
   
   This might be possible but the implementation may look strange. The tool is 
to replace the message contents of one raft log entry with a different type of 
message/content which is specific to Ozone. An implementation in Ratis that 
takes a byte string to replace the log entry with could be used for this. 
However I don't see how adding a low level mutator to the public API is less 
harmful than two read-only methods in an already public class.
   
   > As a workaround, Ozone could add a RaftLogUtils class in the 
org.apache.ratis.server.raftlog.segmented package for accessing the package 
private methods in the meantime. 
   
   I'd rather not do a hack like this if we have the above two options 
available.


-- 
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