// Load a schema from the current hbase row
private Schema loadSchema(final byte[] row, final byte[] schemaKey, int offset, int length) throws AvroBaseException, IOException {
if (schemaKey == null) {
throw new AvroBaseException("Schema not set for row: " + $_(row));
}
Schema schema = schemaCache.get($_(schemaKey, offset, length));
if (schema == null) {
HTableInterface schemaTable = pool.getTable(schemaName);
try {
Get schemaGet = new Get(schemaKey);
schemaGet.addColumn(AVRO_FAMILY, SCHEMA_COLUMN);
byte[] schemaBytes = schemaTable.get(schemaGet).getValue(AVRO_FAMILY, SCHEMA_COLUMN);
if (schemaBytes == null) {
throw new AvroBaseException("No schema " + $_(schemaKey) + " found in hbase for row " + $_(row));
}
schema = loadSchema(schemaBytes, $_(schemaKey));
} finally {
pool.putTable(schemaTable);
}