You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by to...@apache.org on 2011/08/27 00:48:43 UTC
svn commit: r1162279 [2/2] - in
/hadoop/common/branches/HDFS-1623/hadoop-common-project: ./ dev-support/
hadoop-annotations/ hadoop-annotations/src/ hadoop-annotations/src/main/
hadoop-annotations/src/main/java/ hadoop-annotations/src/main/java/org/ ha...
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-annotations/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1,5 @@
+.classpath
+.git
+.project
+.settings
+target
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-auth/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1,5 @@
+.classpath
+.git
+.project
+.settings
+target
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1,5 @@
+.classpath
+.git
+.project
+.settings
+target
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/ivy/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1,4 @@
+hadoop-core.xml
+hadoop-core-test.xml
+ivy*.jar
+maven-ant-tasks*.jar
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/lib/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1 @@
+excluded
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/conf/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1,10 @@
+masters
+slaves
+hadoop-env.sh
+hadoop-site.xml
+core-site.xml
+mapred-site.xml
+hdfs-site.xml
+hadoop-policy.xml
+capacity-scheduler.xml
+mapred-queue-acls.xml
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/docs/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 26 22:46:17 2011
@@ -0,0 +1 @@
+build
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/docs/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Aug 26 22:46:17 2011
@@ -0,0 +1,2 @@
+/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/docs:1152502-1162221
+/hadoop/core/branches/branch-0.19/src/docs:713112
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Aug 26 22:46:17 2011
@@ -0,0 +1,3 @@
+/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:1152502-1162221
+/hadoop/core/branches/branch-0.19/core/src/java:713112
+/hadoop/core/trunk/src/core:776175-785643,785929-786278
Added: 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=1162279&view=auto
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java (added)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java Fri Aug 26 22:46:17 2011
@@ -0,0 +1,72 @@
+/**
+ * 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.ha;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.ipc.VersionedProtocol;
+
+/**
+ * Protocol interface that provides High Availability related primitives to
+ * monitor and fail-over the service.
+ *
+ * This interface could be used by HA frameworks to manage the service.
+ */
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public interface HAServiceProtocol extends VersionedProtocol {
+ /**
+ * Initial version of the protocol
+ */
+ public static final long versionID = 1L;
+
+ /**
+ * Monitor the health of service. This periodically called by the HA
+ * frameworks to monitor the health of the service.
+ *
+ * Service is expected to perform checks to ensure it is functional.
+ * If the service is not healthy due to failure or partial failure,
+ * it is expected to throw {@link HealthCheckFailedException}.
+ * The definition of service not healthy is left to the service.
+ *
+ * Note that when health check of an Active service fails,
+ * failover to standby may be done.
+ *
+ * @throws HealthCheckFailedException
+ * if the health check of a service fails.
+ */
+ public void monitorHealth() throws HealthCheckFailedException;
+
+ /**
+ * Request service to transition to active state. No operation, if the
+ * service is already in active state.
+ *
+ * @throws ServiceFailedException
+ * if transition from standby to active fails.
+ */
+ public void transitionToActive() throws ServiceFailedException;
+
+ /**
+ * Request service to transition to standby state. No operation, if the
+ * service is already in standby state.
+ *
+ * @throws ServiceFailedException
+ * if transition from active to standby fails.
+ */
+ public void transitionToStandby() throws ServiceFailedException;
+}
Added: 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=1162279&view=auto
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java (added)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthCheckFailedException.java Fri Aug 26 22:46:17 2011
@@ -0,0 +1,55 @@
+/**
+ * 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.ha;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+
+/**
+ * Exception thrown to indicate that health check of a service
+ * failed.
+ */
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class HealthCheckFailedException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructs exception with the specified detail message.
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ */
+ public HealthCheckFailedException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and
+ * cause.
+ *
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A <tt>null</tt> value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ */
+ public HealthCheckFailedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Added: 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=1162279&view=auto
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java (added)
+++ hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ServiceFailedException.java Fri Aug 26 22:46:17 2011
@@ -0,0 +1,56 @@
+/**
+ * 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.ha;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+
+
+/**
+ * Exception thrown to indicate that an operation performed
+ * to modify the state of a service or application failed.
+ */
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class ServiceFailedException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructs exception with the specified detail message.
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ */
+ public ServiceFailedException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and
+ * cause.
+ *
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A <tt>null</tt> value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ */
+ public ServiceFailedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Propchange: hadoop/common/branches/HDFS-1623/hadoop-common-project/hadoop-common/src/test/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Aug 26 22:46:17 2011
@@ -0,0 +1,3 @@
+/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/core:1152502-1162221
+/hadoop/core/branches/branch-0.19/core/src/test/core:713112
+/hadoop/core/trunk/src/test/core:776175-785643,785929-786278