Created
July 28, 2012 19:31
-
-
Save okram/3194495 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
public static class Map extends Mapper<ByteBuffer, SortedMap<ByteBuffer, IColumn>, Text, Text> { | |
@Override | |
public void map(final ByteBuffer key, final SortedMap<ByteBuffer, IColumn> value, final Mapper<ByteBuffer, SortedMap<ByteBuffer, IColumn>, Text, Text>.Context context) throws IOException, InterruptedException { | |
final StringBuffer string = new StringBuffer(); | |
for (java.util.Map.Entry<ByteBuffer, IColumn> entry : value.entrySet()) { | |
string.append(ByteBufferUtil.string(entry.getKey())).append("\t").append(ByteBufferUtil.string(entry.getValue().value())); | |
} | |
context.write(new Text(ByteBufferUtil.string(key, Charset.forName("UTF-8"))), new Text(string.toString())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment