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

    https://github.com/apache/spark/pull/11436#discussion_r54492430
  
    --- Diff: core/src/test/scala/org/apache/spark/CacheManagerSuite.scala ---
    @@ -1,97 +0,0 @@
    -/*
    - * 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
    -
    -import org.mockito.Mockito._
    -import org.scalatest.BeforeAndAfter
    -import org.scalatest.mock.MockitoSugar
    -
    -import org.apache.spark.executor.{DataReadMethod, TaskMetrics}
    -import org.apache.spark.rdd.RDD
    -import org.apache.spark.storage._
    -
    -// TODO: Test the CacheManager's thread-safety aspects
    -class CacheManagerSuite extends SparkFunSuite with LocalSparkContext with 
BeforeAndAfter
    -  with MockitoSugar {
    -
    -  var blockManager: BlockManager = _
    -  var cacheManager: CacheManager = _
    -  var split: Partition = _
    -  /** An RDD which returns the values [1, 2, 3, 4]. */
    -  var rdd: RDD[Int] = _
    -  var rdd2: RDD[Int] = _
    -  var rdd3: RDD[Int] = _
    -
    -  before {
    -    sc = new SparkContext("local", "test")
    -    blockManager = mock[BlockManager]
    -    cacheManager = new CacheManager(blockManager)
    -    split = new Partition { override def index: Int = 0 }
    -    rdd = new RDD[Int](sc, Nil) {
    -      override def getPartitions: Array[Partition] = Array(split)
    -      override val getDependencies = List[Dependency[_]]()
    -      override def compute(split: Partition, context: TaskContext): 
Iterator[Int] =
    -        Array(1, 2, 3, 4).iterator
    -    }
    -    rdd2 = new RDD[Int](sc, List(new OneToOneDependency(rdd))) {
    -      override def getPartitions: Array[Partition] = 
firstParent[Int].partitions
    -      override def compute(split: Partition, context: TaskContext): 
Iterator[Int] =
    -        firstParent[Int].iterator(split, context)
    -    }.cache()
    -    rdd3 = new RDD[Int](sc, List(new OneToOneDependency(rdd2))) {
    -      override def getPartitions: Array[Partition] = 
firstParent[Int].partitions
    -      override def compute(split: Partition, context: TaskContext): 
Iterator[Int] =
    -        firstParent[Int].iterator(split, context)
    -    }.cache()
    -  }
    -
    -  test("get uncached rdd") {
    --- End diff --
    
    Open question: which test cases do we need to preserve in the new code? 
Should I test this more end-to-end to make sure that caching still works (i.e. 
doesn't recompute + stores blocks as side effect), or is that handled at a 
higher level of the stack in existing tests?


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