@mridulm Thanks for your great help! I am not a native English speaker. Do you mean the code should looks like this?

```java
    def writeToHBase(iter: Iterator[Text]) {
      val writer = new SparkHBaseWriter(conf)

      writer.init()
      while (iter.hasNext) {
        val record = iter.next()
        writer.write(record)
      }
      writer.close()
    }
```