hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1230351 - in /hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common: ./ src/main/java/org/apache/hadoop/ha/
Date Thu, 12 Jan 2012 01:39:31 GMT
Author: suresh
Date: Thu Jan 12 01:39:30 2012
New Revision: 1230351

URL: http://svn.apache.org/viewvc?rev=1230351&view=rev
Log:
HADOOP-7970. HAServiceProtocol methods must throw IOException.Contributed by Hari Mankude.

Modified:
    hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/CHANGES.HDFS-1623.txt
    hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/FailoverController.java
    hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java
    hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java
    hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java

Modified: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/CHANGES.HDFS-1623.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/CHANGES.HDFS-1623.txt?rev=1230351&r1=1230350&r2=1230351&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/CHANGES.HDFS-1623.txt
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/CHANGES.HDFS-1623.txt
Thu Jan 12 01:39:30 2012
@@ -28,3 +28,6 @@ HADOOP-7932. Make client connection retr
 HADOOP-7924. 
FailoverController for client-based configuration (eli)
 
 HADOOP-7961. Move HA fencing to common. (eli)
+
+HADOOP-7970. HAServiceProtocol methods must throw IOException.
+(Hari Mankude via suresh).

Modified: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/FailoverController.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/FailoverController.java?rev=1230351&r1=1230350&r2=1230351&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/FailoverController.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/FailoverController.java
Thu Jan 12 01:39:30 2012
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.ha;
 
+import java.io.IOException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -51,7 +53,7 @@ public class FailoverController {
     HAServiceState toSvcState;
     try {
       toSvcState = toSvc.getServiceState();
-    } catch (Exception e) {
+    } catch (IOException e) {
       String msg = "Unable to get service state for " + toSvcName;
       LOG.error(msg, e);
       throw new FailoverFailedException(msg, e);
@@ -65,6 +67,9 @@ public class FailoverController {
     } catch (HealthCheckFailedException hce) {
       throw new FailoverFailedException(
           "Can't failover to an unhealthy service", hce);
+    } catch (IOException e) {
+      throw new FailoverFailedException(
+          "Got an io exception", e);
     }
     // TODO(HA): ask toSvc if it's capable. Eg not in SM.
   }

Modified: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java?rev=1230351&r1=1230350&r2=1230351&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java
Thu Jan 12 01:39:30 2012
@@ -21,6 +21,8 @@ import org.apache.hadoop.classification.
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.ipc.VersionedProtocol;
 
+import java.io.IOException;
+
 /**
  * Protocol interface that provides High Availability related primitives to
  * monitor and fail-over the service.
@@ -69,8 +71,11 @@ public interface HAServiceProtocol exten
    * 
    * @throws HealthCheckFailedException
    *           if the health check of a service fails.
+   * @throws IOException
+   *           if other errors happen
    */
-  public void monitorHealth() throws HealthCheckFailedException;
+  public void monitorHealth() throws HealthCheckFailedException,
+                                     IOException;
 
   /**
    * Request service to transition to active state. No operation, if the
@@ -78,8 +83,11 @@ public interface HAServiceProtocol exten
    * 
    * @throws ServiceFailedException
    *           if transition from standby to active fails.
+   * @throws IOException
+   *           if other errors happen
    */
-  public void transitionToActive() throws ServiceFailedException;
+  public void transitionToActive() throws ServiceFailedException,
+                                          IOException;
 
   /**
    * Request service to transition to standby state. No operation, if the
@@ -87,11 +95,17 @@ public interface HAServiceProtocol exten
    * 
    * @throws ServiceFailedException
    *           if transition from active to standby fails.
+   * @throws IOException
+   *           if other errors happen
    */
-  public void transitionToStandby() throws ServiceFailedException;
+  public void transitionToStandby() throws ServiceFailedException,
+                                           IOException;
 
   /**
    * Return the current state of the service.
+   * 
+   * @throws IOException
+   *           if other errors happen
    */
-  public HAServiceState getServiceState();
+  public HAServiceState getServiceState() throws IOException;
 }

Modified: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java?rev=1230351&r1=1230350&r2=1230351&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java
Thu Jan 12 01:39:30 2012
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.ha;
 
+import java.io.IOException;
+
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 
@@ -25,7 +27,7 @@ import org.apache.hadoop.classification.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
-public class HealthCheckFailedException extends Exception {
+public class HealthCheckFailedException extends IOException {
   private static final long serialVersionUID = 1L;
 
   public HealthCheckFailedException(final String message) {

Modified: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java?rev=1230351&r1=1230350&r2=1230351&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java
Thu Jan 12 01:39:30 2012
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.ha;
 
+import java.io.IOException;
+
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 
@@ -27,7 +29,7 @@ import org.apache.hadoop.classification.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
-public class ServiceFailedException extends Exception {
+public class ServiceFailedException extends IOException {
   private static final long serialVersionUID = 1L;
 
   public ServiceFailedException(final String message) {



Mime
View raw message