HBASE-811 HTD is not fully copyable (Andrew Purtell via Jim Kellerman)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@684911 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Kellerman 2008-08-11 20:45:35 +00:00
parent 8763e9e92c
commit 0c3bd478b3
4 changed files with 1261 additions and 1228 deletions

View File

@ -6,6 +6,7 @@ Release 0.3.0 - Unreleased
BUG FIXES
HBASE-805 Remove unnecessary getRow overloads in HRS (Jonathan Gray via
Jim Kellerman) (Fix whitespace diffs in HRegionServer)
HBASE-811 HTD is not fully copyable (Andrew Purtell via Jim Kellerman)
IMPROVEMENTS
HBASE-801 When a table haven't disable, shell could response in a "user

View File

@ -22,6 +22,7 @@ package org.apache.hadoop.hbase;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@ -288,6 +289,13 @@ public class HColumnDescriptor implements WritableComparable {
return Bytes.toString(value);
}
/**
* @return All values.
*/
public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues() {
return Collections.unmodifiableMap(values);
}
/**
* @param key The key.
* @param value The value.

View File

@ -96,6 +96,23 @@ public class HTableDescriptor implements WritableComparable {
}
}
/**
* Private constructor used internally creating table descriptors for
* catalog tables: e.g. .META. and -ROOT-.
*/
protected HTableDescriptor(final byte [] name, HColumnDescriptor[] families,
Map<ImmutableBytesWritable,ImmutableBytesWritable> values) {
this.name = name.clone();
setMetaFlags(name);
for(HColumnDescriptor descriptor : families) {
this.families.put(Bytes.mapKey(descriptor.getName()), descriptor);
}
for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> entry:
values.entrySet()) {
this.values.put(entry.getKey(), entry.getValue());
}
}
/**
* Constructs an empty object.
* For deserializing an HTableDescriptor instance only.
@ -252,6 +269,13 @@ public class HTableDescriptor implements WritableComparable {
return Bytes.toString(value);
}
/**
* @return All values.
*/
public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues() {
return Collections.unmodifiableMap(values);
}
/**
* @param key The key.
* @param value The value.

View File

@ -36,7 +36,7 @@ public class UnmodifyableHTableDescriptor extends HTableDescriptor {
* @param desc
*/
UnmodifyableHTableDescriptor(final HTableDescriptor desc) {
super(desc.getName(), getUnmodifyableFamilies(desc));
super(desc.getName(), getUnmodifyableFamilies(desc), desc.getValues());
}
/*