Skip to content

Instantly share code, notes, and snippets.

@malaikannan
Created December 4, 2015 04:39
Show Gist options
  • Save malaikannan/cc16962d593d44b82dae to your computer and use it in GitHub Desktop.
Save malaikannan/cc16962d593d44b82dae to your computer and use it in GitHub Desktop.
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.Serializable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
public class ColorWritable implements WritableComparable<ColorWritable>,
Serializable {
private Text color;
public ColorWritable() {
this.color = new Text();
}
public ColorWritable(Text color) {
this.color = color;
}
public Text getColor() {
return color;
}
public void write(DataOutput out) throws IOException {
color.write(out);
}
public void readFields(DataInput in) throws IOException {
color.readFields(in);
}
public int compareTo(ColorWritable arg0) {
return 0;
}
@Override
public int hashCode() {
return super.hashCode();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment