hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject svn commit: r1493270 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase: HTableDescriptor.java snapshot/RestoreSnapshotHelper.java
Date Fri, 14 Jun 2013 22:30:19 GMT
Author: mbertozzi
Date: Fri Jun 14 22:30:19 2013
New Revision: 1493270

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

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=1493270&r1=1493269&r2=1493270&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java Fri Jun
14 22:30:19 2013
@@ -476,10 +476,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/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java?rev=1493270&r1=1493269&r2=1493270&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
Fri Jun 14 22:30:19 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.StoreFile;
@@ -594,6 +595,10 @@ 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());
+    }
     return htd;
   }
 }



Mime
View raw message