// version 6+
this.name = Bytes.readByteArray(in);
this.values.clear();
int numValues = in.readInt();
for (int i = 0; i < numValues; i++) {
ImmutableBytesWritable key = new ImmutableBytesWritable();
ImmutableBytesWritable value = new ImmutableBytesWritable();
key.readFields(in);
value.readFields(in);
// in version 8, the BloomFilter setting changed from bool to enum
if (version < 8 && Bytes.toString(key.get()).equals(BLOOMFILTER)) {
value.set(Bytes.toBytes(
Boolean.getBoolean(Bytes.toString(value.get()))
? BloomType.ROW.toString()
: BloomType.NONE.toString()));
}
values.put(key, value);
}
if (version == 6) {
// Convert old values.
setValue(COMPRESSION, Compression.Algorithm.NONE.getName());
}
String value = getValue(HConstants.VERSIONS);
this.cachedMaxVersions = (value != null)?
Integer.valueOf(value).intValue(): DEFAULT_VERSIONS;
if (version > 10) {
configuration.clear();
int numConfigs = in.readInt();
for (int i = 0; i < numConfigs; i++) {
ImmutableBytesWritable key = new ImmutableBytesWritable();
ImmutableBytesWritable val = new ImmutableBytesWritable();
key.readFields(in);
val.readFields(in);
configuration.put(
Bytes.toString(key.get(), key.getOffset(), key.getLength()),
Bytes.toString(val.get(), val.getOffset(), val.getLength()));
}
}
}
}