You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/08/02 22:49:08 UTC

svn commit: r1509853 - in /hbase/trunk/hbase-client/src: main/java/org/apache/hadoop/hbase/client/Mutation.java test/java/org/apache/hadoop/hbase/client/TestPutWriteToWal.java

Author: stack
Date: Fri Aug  2 20:49:07 2013
New Revision: 1509853

URL: http://svn.apache.org/r1509853
Log:
HBASE-9093 Hbase client API: Restore the writeToWal method; REVERT

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
    hbase/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutWriteToWal.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java?rev=1509853&r1=1509852&r2=1509853&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java Fri Aug  2 20:49:07 2013
@@ -179,34 +179,6 @@ public abstract class Mutation extends O
   }
 
   /**
-   * Set the durability for this mutation. If this is set to true,
-   * the default durability of the table is set.
-   * @param writeToWal
-   */
-  @Deprecated
-  public void setWriteToWal(boolean writeToWal) {
-    if(!writeToWal) {
-      setDurability(Durability.SKIP_WAL);
-    } else {
-    // This is required to handle the case where this method is
-    // called twice, first with writeToWal = false,
-    // and then with writeToWal = true
-      setDurability(Durability.USE_DEFAULT);
-    }
-  }
-
-  /**
-   * Get the durability for this mutation.
-   * @return - true if this mutation is set to write to the WAL either
-   * synchronously, asynchronously or fsync to disk on the file system.
-   * - to get the exact durability, use the {#getDurability} method.
-   */
-  @Deprecated
-  public boolean getWriteToWal() {
-    return Durability.SKIP_WAL != getDurability();
-  }
-
-  /**
    * Method for retrieving the put's familyMap
    * @return familyMap
    */

Modified: hbase/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutWriteToWal.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutWriteToWal.java?rev=1509853&r1=1509852&r2=1509853&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutWriteToWal.java (original)
+++ hbase/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutWriteToWal.java Fri Aug  2 20:49:07 2013
@@ -18,55 +18,11 @@
  */
 package org.apache.hadoop.hbase.client;
 
-import org.apache.hadoop.hbase.SmallTests;
-import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
-/**
- * Tests for testing methods added in HBASE-9093. This set of tests is meant
- * to test the {@linkplain Mutation#setWriteToWal(boolean)}
- * and {@linkplain Mutation#getWriteToWal()} methods which provide
- * a compatibility layer with HBase versions < 95's client side WAL semantics.
- */
-@Category(SmallTests.class)
 public class TestPutWriteToWal {
-
-  private Put put;
   @Before
   public void setUp() throws Exception {
-    put = new Put("test".getBytes());
-  }
-
-  @Test
-  public void testWriteToWal(){
-    put.setWriteToWal(true);
-    Assert.assertEquals(Durability.USE_DEFAULT, put.getDurability());
-  }
-
-  @Test
-  public void testNoWriteToWal() {
-    put.setWriteToWal(false);
-    Assert.assertEquals(Durability.SKIP_WAL, put.getDurability());
-  }
-
-  @Test
-  public void testWriteToWalSwitch() {
-    put.setWriteToWal(false);
-    Assert.assertEquals(Durability.SKIP_WAL, put.getDurability());
-    put.setWriteToWal(true);
-    Assert.assertEquals(Durability.USE_DEFAULT, put.getDurability());
-  }
-
-  @Test
-  public void testPutCopy() {
-    put.setWriteToWal(false);
-    Put putCopy1 = new Put(put);
-    Assert.assertEquals(Durability.SKIP_WAL, putCopy1.getDurability());
 
-    put.setWriteToWal(true);
-    Put putCopy2 = new Put(put);
-    Assert.assertEquals(Durability.USE_DEFAULT, putCopy2.getDurability());
   }
 }