---
title: "spark 源码疑问"
author: "quguilai"
date: "2016-07-20T22:56:53Z"
tags: []
categories: ["行业应用"]
slug: "spark"
draft: false
lastmod: "2016-07-20T22:56:53Z"
id: 2312506
url: "https://qgl.iteye.com/blog/2312506"
---

```
protected def getInputFormat(conf: JobConf): InputFormat[K, V] = {
  val newInputFormat = ReflectionUtils.newInstance(inputFormatClass.asInstanceOf[Class[_]], conf)
    .asInstanceOf[InputFormat[K, V]]
  newInputFormat match {
    case c: Configurable => c.setConf(conf)
    case _ =>
  }
  newInputFormat
}
```