hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1478654 - in /hbase/branches/0.95: hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/ hbase-client/src/main/java...
Date Fri, 03 May 2013 06:31:14 GMT
Author: stack
Date: Fri May  3 06:31:12 2013
New Revision: 1478654

URL: http://svn.apache.org/r1478654
Log:
HBASE-8430 Cell decoder/scanner/etc. should not hide exceptions

Added:
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java
Removed:
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseIOException.java
Modified:
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/WrongRowIOException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/StoppedRpcClientException.java
    hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
    hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellScanner.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseEncoder.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CellCodec.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CodecException.java
    hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/KeyValueCodec.java
    hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSearcherRowMiss.java
    hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSimple.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/codec/MessageCodec.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDeleteEtcCellIteration.java
    hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestIPC.java
    hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Fri May  3 06:31:12 2013
@@ -38,6 +38,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.hbase.Abortable;
 import org.apache.hadoop.hbase.ClusterStatus;
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HBaseIOException;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -50,7 +51,6 @@ import org.apache.hadoop.hbase.client.Me
 import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitorBase;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.exceptions.FailedLogCloseException;
-import org.apache.hadoop.hbase.exceptions.HBaseIOException;
 import org.apache.hadoop.hbase.exceptions.HBaseSnapshotException;
 import org.apache.hadoop.hbase.exceptions.MasterNotRunningException;
 import org.apache.hadoop.hbase.exceptions.NotServingRegionException;

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/WrongRowIOException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/WrongRowIOException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/WrongRowIOException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/client/WrongRowIOException.java
Fri May  3 06:31:12 2013
@@ -17,7 +17,7 @@
  */
 package org.apache.hadoop.hbase.client;
 
-import org.apache.hadoop.hbase.exceptions.HBaseIOException;
+import org.apache.hadoop.hbase.HBaseIOException;
 
 public class WrongRowIOException extends HBaseIOException {
   private static final long serialVersionUID = -5849522209440123059L;

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java
Fri May  3 06:31:12 2013
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.exceptio
 
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.hbase.HBaseIOException;
 
 /**
  * Subclass if exception is not meant to be retried: e.g.

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java
Fri May  3 06:31:12 2013
@@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.exceptio
 
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.hbase.HBaseIOException;
 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
 
 /**

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java
Fri May  3 06:31:12 2013
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.exceptio
 
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.hbase.HBaseIOException;
 
 /**
  * This exception is thrown by the master when a region server was shut down and

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java
Fri May  3 06:31:12 2013
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.exceptio
 
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.hbase.HBaseIOException;
 
 /**
  * Thrown when something happens related to region handling.

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java
Fri May  3 06:31:12 2013
@@ -18,6 +18,7 @@
 package org.apache.hadoop.hbase.exceptions;
 
 import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.HBaseIOException;
 
 /**
  * 

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/StoppedRpcClientException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/StoppedRpcClientException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/StoppedRpcClientException.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/StoppedRpcClientException.java
Fri May  3 06:31:12 2013
@@ -17,7 +17,7 @@
  */
 package org.apache.hadoop.hbase.ipc;
 
-import org.apache.hadoop.hbase.exceptions.HBaseIOException;
+import org.apache.hadoop.hbase.HBaseIOException;
 
 public class StoppedRpcClientException extends HBaseIOException {
   public StoppedRpcClientException() {
@@ -27,4 +27,4 @@ public class StoppedRpcClientException e
   public StoppedRpcClientException(String msg) {
     super(msg);
   }
-}
\ No newline at end of file
+}

Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
(original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
Fri May  3 06:31:12 2013
@@ -559,10 +559,10 @@ public final class ProtobufUtil {
    * @param cellScanner
    * @param proto the protocol buffer Mutate to convert
    * @return the converted client Append
-   * @throws DoNotRetryIOException
+   * @throws IOException 
    */
   public static Append toAppend(final MutationProto proto, final CellScanner cellScanner)
-  throws DoNotRetryIOException {
+  throws IOException {
     MutationType type = proto.getMutateType();
     assert type == MutationType.APPEND : type.name();
     byte [] row = proto.hasRow()? proto.getRow().toByteArray(): null;

Modified: hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java
(original)
+++ hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java
Fri May  3 06:31:12 2013
@@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.ipc;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -36,7 +37,7 @@ import org.junit.experimental.categories
 @Category(SmallTests.class)
 public class TestPayloadCarryingRpcController {
   @Test
-  public void testListOfCellScannerables() {
+  public void testListOfCellScannerables() throws IOException {
     List<CellScannable> cells = new ArrayList<CellScannable>();
     final int count = 10;
     for (int i = 0; i < count; i++) {

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellScanner.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellScanner.java
(original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellScanner.java
Fri May  3 06:31:12 2013
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.hbase;
 
+import java.io.IOException;
+
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.hbase.Cell;
@@ -57,6 +59,7 @@ public interface CellScanner {
   /**
    * Advance the scanner 1 cell.
    * @return true if the next cell is found and {@link #current()} will return a valid Cell
+   * @throws IOException
    */
-  boolean advance();
-}
+  boolean advance() throws IOException;
+}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java (original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java Fri
May  3 06:31:12 2013
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.hbase;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.Iterator;
 import java.util.List;
@@ -142,7 +143,7 @@ public final class CellUtil {
       }
 
       @Override
-      public boolean advance() {
+      public boolean advance() throws IOException {
         if (this.cellScanner == null) {
           if (!this.iterator.hasNext()) return false;
           this.cellScanner = this.iterator.next().cellScanner();

Added: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java?rev=1478654&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java
(added)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java
Fri May  3 06:31:12 2013
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+
+import java.io.IOException;
+
+/**
+ * All hbase specific IOExceptions should be subclasses of HBaseIOException
+ */
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class HBaseIOException extends IOException {
+
+  private static final long serialVersionUID = 1L;
+
+  public HBaseIOException() {
+    super();
+  }
+
+  public HBaseIOException(String message) {
+    super(message);
+  }
+
+  public HBaseIOException(String message, Throwable cause) {
+      super(message, cause);
+  }
+
+  public HBaseIOException(Throwable cause) {
+      super(cause);
+  }}

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java
(original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java
Fri May  3 06:31:12 2013
@@ -32,17 +32,13 @@ public abstract class BaseDecoder implem
   }
 
   @Override
-  public boolean advance() {
+  public boolean advance() throws IOException {
     if (!this.hasNext) return this.hasNext;
-    try {
-      if (this.in.available() <= 0) {
-        this.hasNext = false;
-        return this.hasNext;
-      }
-      this.current = parseCell();
-    } catch (IOException e) {
-      throw new RuntimeException(e);
+    if (this.in.available() <= 0) {
+      this.hasNext = false;
+      return this.hasNext;
     }
+    this.current = parseCell();
     return this.hasNext;
   }
 
@@ -56,4 +52,4 @@ public abstract class BaseDecoder implem
   public Cell current() {
     return this.current;
   }
-}
+}
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseEncoder.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseEncoder.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseEncoder.java
(original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseEncoder.java
Fri May  3 06:31:12 2013
@@ -42,10 +42,6 @@ public abstract class BaseEncoder implem
   public void flush() throws IOException {
     if (this.flushed) return;
     this.flushed = true;
-    try {
-      this.out.flush();
-    } catch (IOException e) {
-      throw new CodecException(e);
-    }
+    this.out.flush();
   }
 }
\ No newline at end of file

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CellCodec.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CellCodec.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CellCodec.java
(original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CellCodec.java
Fri May  3 06:31:12 2013
@@ -40,22 +40,18 @@ public class CellCodec implements Codec 
     @Override
     public void write(Cell cell) throws IOException {
       checkFlushed();
-      try {
-        // Row
-        write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
-        // Column family
-        write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());
-        // Qualifier
-        write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
-        // Version
-        this.out.write(Bytes.toBytes(cell.getTimestamp()));
-        // Type
-        this.out.write(cell.getTypeByte());
-        // Value
-        write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
-      } catch (IOException e) {
-        throw new CodecException(e);
-      }
+      // Row
+      write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
+      // Column family
+      write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());
+      // Qualifier
+      write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
+      // Version
+      this.out.write(Bytes.toBytes(cell.getTimestamp()));
+      // Type
+      this.out.write(cell.getTypeByte());
+      // Value
+      write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
     }
 
     /**

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CodecException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CodecException.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CodecException.java
(original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/CodecException.java
Fri May  3 06:31:12 2013
@@ -17,12 +17,16 @@
  */
 package org.apache.hadoop.hbase.codec;
 
-import java.io.IOException;
 
-public class CodecException extends IOException {
-  private static final long serialVersionUID = -2850095011686914405L;
+import org.apache.hadoop.hbase.HBaseIOException;
 
+/**
+ * Thrown when problems in the codec whether setup or context.
+ */
+@SuppressWarnings("serial")
+public class CodecException extends HBaseIOException {
   public CodecException() {
+    super();
   }
 
   public CodecException(String message) {

Modified: hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/KeyValueCodec.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/KeyValueCodec.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/KeyValueCodec.java
(original)
+++ hbase/branches/0.95/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/KeyValueCodec.java
Fri May  3 06:31:12 2013
@@ -53,11 +53,7 @@ public class KeyValueCodec implements Co
       checkFlushed();
       // This is crass and will not work when KV changes. Also if passed a non-kv Cell, it
will
       // make expensive copy.
-      try {
-        KeyValue.oswrite((KeyValue)KeyValueUtil.ensureKeyValue(cell), this.out);
-      } catch (IOException e) {
-        throw new CodecException(e);
-      }
+      KeyValue.oswrite((KeyValue)KeyValueUtil.ensureKeyValue(cell), this.out);
     }
   }
 

Modified: hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSearcherRowMiss.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSearcherRowMiss.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSearcherRowMiss.java
(original)
+++ hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSearcherRowMiss.java
Fri May  3 06:31:12 2013
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.hbase.codec.prefixtree.row.data;
 
+import java.io.IOException;
 import java.util.List;
 
 import org.apache.hadoop.hbase.Cell;
@@ -61,12 +62,16 @@ public class TestRowDataSearcherRowMiss 
 
 	@Override
 	public void individualSearcherAssertions(CellSearcher searcher) {
-	  assertRowOffsetsCorrect();
+    assertRowOffsetsCorrect();
 
     searcher.resetToBeforeFirstEntry();
 
     //test first cell
-    searcher.advance();
+    try {
+      searcher.advance();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
     Cell first = searcher.current();
     Assert.assertTrue(CellComparator.equals(d.get(0), first));
 

Modified: hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSimple.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSimple.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSimple.java
(original)
+++ hbase/branches/0.95/hbase-prefix-tree/src/test/java/org/apache/hadoop/hbase/codec/prefixtree/row/data/TestRowDataSimple.java
Fri May  3 06:31:12 2013
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.hbase.codec.prefixtree.row.data;
 
+import java.io.IOException;
 import java.util.List;
 
 import org.apache.hadoop.hbase.Cell;
@@ -66,7 +67,11 @@ public class TestRowDataSimple extends B
     searcher.resetToBeforeFirstEntry();
 
     // test first cell
-    searcher.advance();
+    try {
+      searcher.advance();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
     Cell first = searcher.current();
     Assert.assertTrue(CellComparator.equals(d.get(0), first));
 

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/codec/MessageCodec.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/codec/MessageCodec.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/codec/MessageCodec.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/codec/MessageCodec.java
Fri May  3 06:31:12 2013
@@ -27,7 +27,6 @@ import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.codec.BaseDecoder;
 import org.apache.hadoop.hbase.codec.BaseEncoder;
 import org.apache.hadoop.hbase.codec.Codec;
-import org.apache.hadoop.hbase.codec.CodecException;
 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
 
 import com.google.protobuf.ByteString;
@@ -62,11 +61,7 @@ public class MessageCodec implements Cod
       builder.setValue(ByteString.copyFrom(cell.getValueArray(), cell.getValueOffset(),
           cell.getValueLength()));
       HBaseProtos.Cell pbcell = builder.build();
-      try {
-        pbcell.writeDelimitedTo(this.out);
-      } catch (IOException e) {
-        throw new CodecException(e);
-      }
+      pbcell.writeDelimitedTo(this.out);
     }
   }
 

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Fri May  3 06:31:12 2013
@@ -48,6 +48,7 @@ import org.apache.hadoop.hbase.Abortable
 import org.apache.hadoop.hbase.Chore;
 import org.apache.hadoop.hbase.ClusterId;
 import org.apache.hadoop.hbase.ClusterStatus;
+import org.apache.hadoop.hbase.HBaseIOException;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -66,7 +67,6 @@ import org.apache.hadoop.hbase.client.Me
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
-import org.apache.hadoop.hbase.exceptions.HBaseIOException;
 import org.apache.hadoop.hbase.exceptions.MasterNotRunningException;
 import org.apache.hadoop.hbase.exceptions.NotAllMetaRegionsOnlineException;
 import org.apache.hadoop.hbase.exceptions.PleaseHoldException;

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDeleteEtcCellIteration.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDeleteEtcCellIteration.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDeleteEtcCellIteration.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDeleteEtcCellIteration.java
Fri May  3 06:31:12 2013
@@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.client;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
 import java.util.Arrays;
 import java.util.ConcurrentModificationException;
 
@@ -42,7 +43,7 @@ public class TestPutDeleteEtcCellIterati
   private static final int COUNT = 10;
 
   @Test
-  public void testPutIteration() {
+  public void testPutIteration() throws IOException {
     Put p = new Put(ROW);
     for (int i = 0; i < COUNT; i++) {
       byte [] bytes = Bytes.toBytes(i);
@@ -58,7 +59,7 @@ public class TestPutDeleteEtcCellIterati
   }
 
   @Test (expected = ConcurrentModificationException.class)
-  public void testPutConcurrentModificationOnIteration() {
+  public void testPutConcurrentModificationOnIteration() throws IOException {
     Put p = new Put(ROW);
     for (int i = 0; i < COUNT; i++) {
       byte [] bytes = Bytes.toBytes(i);
@@ -77,7 +78,7 @@ public class TestPutDeleteEtcCellIterati
   }
 
   @Test
-  public void testDeleteIteration() {
+  public void testDeleteIteration() throws IOException {
     Delete d = new Delete(ROW);
     for (int i = 0; i < COUNT; i++) {
       byte [] bytes = Bytes.toBytes(i);
@@ -93,7 +94,7 @@ public class TestPutDeleteEtcCellIterati
   }
 
   @Test
-  public void testAppendIteration() {
+  public void testAppendIteration() throws IOException {
     Append a = new Append(ROW);
     for (int i = 0; i < COUNT; i++) {
       byte [] bytes = Bytes.toBytes(i);
@@ -111,7 +112,7 @@ public class TestPutDeleteEtcCellIterati
   }
 
   @Test
-  public void testIncrementIteration() {
+  public void testIncrementIteration() throws IOException {
     Increment increment = new Increment(ROW);
     for (int i = 0; i < COUNT; i++) {
       byte [] bytes = Bytes.toBytes(i);
@@ -131,7 +132,7 @@ public class TestPutDeleteEtcCellIterati
   }
 
   @Test
-  public void testResultIteration() {
+  public void testResultIteration() throws IOException {
     Cell [] cells = new Cell[COUNT];
     for(int i = 0; i < COUNT; i++) {
       byte [] bytes = Bytes.toBytes(i);

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestIPC.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestIPC.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestIPC.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestIPC.java
Fri May  3 06:31:12 2013
@@ -113,8 +113,12 @@ public class TestIPC {
         // building.
         CellScanner cellScanner = pcrc.cellScanner();
         List<Cell> list = new ArrayList<Cell>();
-        while(cellScanner.advance()) {
-          list.add(cellScanner.current());
+        try {
+          while(cellScanner.advance()) {
+            list.add(cellScanner.current());
+          }
+        } catch (IOException e) {
+          throw new ServiceException(e);
         }
         cellScanner = CellUtil.createCellScanner(list);
         ((PayloadCarryingRpcController)controller).setCellScanner(cellScanner);
@@ -155,7 +159,7 @@ public class TestIPC {
   @Test
   public void testCompressCellBlock()
   throws IOException, InterruptedException, SecurityException, NoSuchMethodException {
-    // Currently, you set 
+    // Currently, you set
     Configuration conf = HBaseConfiguration.create();
     conf.set("hbase.client.rpc.compressor", GzipCodec.class.getCanonicalName());
     TestRpcServer rpcServer = new TestRpcServer();
@@ -265,4 +269,4 @@ public class TestIPC {
       rpcServer.stop();
     }
   }
-}
\ No newline at end of file
+}

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1478654&r1=1478653&r2=1478654&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Fri May  3 06:31:12 2013
@@ -34,6 +34,7 @@ import java.util.concurrent.CountDownLat
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseIOException;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -48,7 +49,6 @@ import org.apache.hadoop.hbase.client.HB
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
-import org.apache.hadoop.hbase.exceptions.HBaseIOException;
 import org.apache.hadoop.hbase.exceptions.MasterNotRunningException;
 import org.apache.hadoop.hbase.exceptions.UnknownRegionException;
 import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException;



Mime
View raw message