Created
October 2, 2010 01:00
-
-
Save spullara/607125 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
| KeyValue[] raw = result.raw(); | |
| for (KeyValue kv : raw) { | |
| byte[] buffer = kv.getBuffer(); | |
| int offset = kv.getValueOffset(); | |
| int length = kv.getValueLength(); | |
| switch(buffer[kv.getQualifierOffset()]) { | |
| case DATA_COLUMN_BYTE: | |
| value = readValue(buffer, schema, format, offset, length); | |
| break; | |
| case VERSION_COLUMN_BYTE: | |
| version = Bytes.toLong(buffer, offset, length); | |
| break; | |
| case FORMAT_COLUMN_BYTE: | |
| format = AvroFormat.values()[Bytes.toInt(buffer, offset, length)]; | |
| break; | |
| case SCHEMA_COLUMN_BYTE: | |
| schema = loadSchema(row, schemaBytes, offset, length); | |
| break; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment