hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject svn commit: r1493268 - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
Date Fri, 14 Jun 2013 22:29:55 GMT
Author: mbertozzi
Date: Fri Jun 14 22:29:54 2013
New Revision: 1493268

URL: http://svn.apache.org/r1493268
Log:
HBASE-8742 HTableDescriptor Properties not preserved when cloning

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=1493268&r1=1493267&r2=1493268&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java Fri
Jun 14 22:29:54 2013
@@ -518,10 +518,12 @@ public class HTableDescriptor implements
   }
 
   /*
+   * 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);
   }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java?rev=1493268&r1=1493267&r2=1493268&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
Fri Jun 14 22:29:54 2013
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.backup.HF
 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;
   }
 }



Mime
View raw message