Github user mridulm commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16989#discussion_r117203833
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/server/OneForOneStreamManager.java
 ---
    @@ -95,6 +97,25 @@ public ManagedBuffer getChunk(long streamId, int 
chunkIndex) {
       }
     
       @Override
    +  public ManagedBuffer openStream(String streamChunkId) {
    +    Tuple2<Long, Integer> streamIdAndChunkId = 
parseStreamChunkId(streamChunkId);
    +    return getChunk(streamIdAndChunkId._1, streamIdAndChunkId._2);
    +  }
    +
    +  public static String genStreamChunkId(long streamId, int chunkId) {
    +    return String.format("%d_%d", streamId, chunkId);
    +  }
    +
    +  public static Tuple2<Long, Integer> parseStreamChunkId(String 
streamChunkId) {
    --- End diff --
    
    Idea was to ensure that string parsing and unparsing it localized to a 
single place (genStreamChunkId and parseStreamChunkId) - so that we can modify 
it in future if required without needing to look for where all we did a split 
by "_"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to