diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java index ce9a0a586cd..0fddf7dc4ea 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -518,10 +518,12 @@ public class HTableDescriptor implements WritableComparable { } /* + * 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); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java index bae0366f07c..41fdbc3993d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java @@ -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 e: + snapshotTableDescriptor.getValues().entrySet()) { + htd.setValue(e.getKey(), e.getValue()); + } + for (Map.Entry e: snapshotTableDescriptor.getConfiguration().entrySet()) { + htd.setConfiguration(e.getKey(), e.getValue()); + } return htd; } }