Index: src/main/java/org/apache/hadoop/hbase/HServerLoad.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/HServerLoad.java (revision 1326332) +++ src/main/java/org/apache/hadoop/hbase/HServerLoad.java (working copy) @@ -378,11 +378,46 @@ this.currentCompactedKVs = currentCompactedKVs; } + /** + * HBASE-5256 and HBASE-5283 introduced incompatible serialization changes + * This method reads the fields in 0.92 serialization format, ex-version field + * @param in + * @throws IOException + */ + private void readFields92(DataInput in) throws IOException { + // in 0.92, the version was actually written twice, consume the second copy + int version = in.readByte(); + int namelen = in.readInt(); + this.name = new byte[namelen]; + in.readFully(this.name); + this.stores = in.readInt(); + this.storefiles = in.readInt(); + this.storeUncompressedSizeMB = in.readInt(); + this.storefileSizeMB = in.readInt(); + this.memstoreSizeMB = in.readInt(); + this.storefileIndexSizeMB = in.readInt(); + this.readRequestsCount = in.readInt(); + this.writeRequestsCount = in.readInt(); + this.rootIndexSizeKB = in.readInt(); + this.totalStaticIndexSizeKB = in.readInt(); + this.totalStaticBloomSizeKB = in.readInt(); + this.totalCompactingKVs = in.readLong(); + this.currentCompactedKVs = in.readLong(); + int coprocessorsSize = in.readInt(); + coprocessors = new TreeSet(); + for (int i = 0; i < coprocessorsSize; i++) { + coprocessors.add(in.readUTF()); + } + } + // Writable public void readFields(DataInput in) throws IOException { - super.readFields(in); int version = in.readByte(); if (version > VERSION) throw new IOException("Version mismatch; " + version); + if (version == 1) { + readFields92(in); + return; + } int namelen = WritableUtils.readVInt(in); this.name = new byte[namelen]; in.readFully(this.name); @@ -408,7 +443,6 @@ public void write(DataOutput out) throws IOException { super.write(out); - out.writeByte(VERSION); WritableUtils.writeVInt(out, name.length); out.write(name); WritableUtils.writeVInt(out, stores);