HBASE-8742 HTableDescriptor Properties not preserved when cloning

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1493268 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
mbertozzi 2013-06-14 22:29:54 +00:00
parent 6e2df4c617
commit a53d0b2512
2 changed files with 11 additions and 1 deletions

View File

@ -518,10 +518,12 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
}
/*
* Setter for storing metadata as a (key, value) pair in {@link #values} map
*
* @param key The key.
* @param value The value.
*/
private void setValue(final ImmutableBytesWritable key,
public void setValue(final ImmutableBytesWritable key,
final ImmutableBytesWritable value) {
values.put(key, value);
}

View File

@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.backup.HFileArchiver;
import org.apache.hadoop.hbase.monitoring.MonitoredTask;
import org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher;
import org.apache.hadoop.hbase.io.HFileLink;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
@ -595,6 +596,13 @@ public class RestoreSnapshotHelper {
for (HColumnDescriptor hcd: snapshotTableDescriptor.getColumnFamilies()) {
htd.addFamily(hcd);
}
for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e:
snapshotTableDescriptor.getValues().entrySet()) {
htd.setValue(e.getKey(), e.getValue());
}
for (Map.Entry<String, String> e: snapshotTableDescriptor.getConfiguration().entrySet()) {
htd.setConfiguration(e.getKey(), e.getValue());
}
return htd;
}
}