hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject svn commit: r1493269 - in /hbase/branches/0.95: 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:58 GMT
Author: mbertozzi
Date: Fri Jun 14 22:29:58 2013
New Revision: 1493269

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

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

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=1493269&r1=1493268&r2=1493269&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
Fri Jun 14 22:29:58 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/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java?rev=1493269&r1=1493268&r2=1493269&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
Fri Jun 14 22:29:58 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