Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save justinpitts/4aac9d94ead8bd0c1a88dc59eff369f0 to your computer and use it in GitHub Desktop.
Save justinpitts/4aac9d94ead8bd0c1a88dc59eff369f0 to your computer and use it in GitHub Desktop.
scala wrapper for hadoop remote iterator
case class RemoteIteratorWrapper[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) extends scala.collection.AbstractIterator[T] with scala.collection.Iterator[T] {
def hasNext = underlying.hasNext
def next() = underlying.next()
}
object Conversions {
implicit def remoteIterator2ScalaIterator[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) : scala.collection.Iterator[T] = RemoteIteratorWrapper[T](underlying)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment