Would this match actually work? I am not sure if we keep enough type information to make this pattern match work (also consider how type erasure might affect this). One idea is you can put the block in getDependencies. Something like:

    override def getDependencies: Seq[Dependency[_]] = {
      rdds.map { rdd =>
        if (rdd.partitioner == Some(part)) {
          logInfo("Adding one-to-one dependency with " + rdd)
          new OneToOneDependency(rdd.map { 
            // do the key, value clone to ReduceKeyReduceSide / Array[Byte] here
          })
        } else {
          logInfo("Adding shuffle dependency with " + rdd)
          new ShuffleDependency[Any, Any](rdd, part, SharkEnv.shuffleSerializerName)
        }
      }
    }