Created
January 17, 2016 03:24
-
-
Save sameei/d4289d40da37ba67f622 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in the name of ALLAH | |
case class PopulationStat( | |
val country: String, | |
val symbol: String, | |
val year: Int, | |
val amount: Long | |
) | |
class WritablePopulationStat extends WritableComparable[WritablePopulationStat] { | |
def this(v:PopulationStat) = { value = v } | |
var value: PopulationStat = _ | |
private val text = new Text | |
def wrtie(out: DataOutput) = { | |
text set value.symbol | |
text write out | |
WritableUtils writeVInt(out, value.year) | |
WritableUtils writeVLong(out, value.amount) | |
text set value.country | |
text write out | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment