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

    https://github.com/apache/spark/pull/1241#discussion_r14279781
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/ShuffleBlockManager.scala ---
    @@ -0,0 +1,36 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.shuffle
    +
    +import org.apache.spark.storage.{FileSegment, ShuffleBlockId}
    +import java.nio.ByteBuffer
    +
    +private[spark]
    +trait ShuffleBlockManager {
    --- End diff --
    
    yeah, I see your concern, I thought about this too. actually in this PR, it 
mostly is used internally by HashShuffleManager's writter. While, we can take 
this as a way to give a chance to expose the internal storage objects for short 
cut usage. Such as current netty based shuffle sender. Without this interface, 
it's hard to implement without introduce maybe many more extra interface. to 
keep it simple. I offer the chance to expose the ShuffleBlockManager. 
    
    And then, this "location" conception might not be meaningful, but and 
BlockObjectId might be a good  fit for all the possible shuffleManager, 
afterall, you are handling some objects whether it is a File , or a Stream, or 
whatever way you save your data to, So, a ShuffleBlockManager it self might 
still be needed to access this object in certain shortcut cases for simplifier 
API, and you can name the method getDataObjectHandle or whatever fits.. I do 
also have a PR for this idea, say generalize the object and pass around an 
ObjectID for different storage type at #1209 
    
    So does this make any sense to you ;)  Still, I agree if we could find 
better way to solve the netty block fetcher problem, This could be hide.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to