Author: edwardyoon
Date: Sat Oct 29 22:38:17 2011
New Revision: 1195061
URL: http://svn.apache.org/viewvc?rev=1195061&view=rev
Log:
Remove zookeeper package.
Added:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java
- copied, changed from r1194876,
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncClientImpl.java
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncServerImpl.java
- copied, changed from r1194876,
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncServerImpl.java
Removed:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncClientImpl.java
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncServerImpl.java
Modified:
incubator/hama/trunk/core/conf/hama-default.xml
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServerRunner.java
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServiceFactory.java
incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/sync/TestSyncServiceFactory.java
Modified: incubator/hama/trunk/core/conf/hama-default.xml
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/conf/hama-default.xml?rev=1195061&r1=1195060&r2=1195061&view=diff
==============================================================================
--- incubator/hama/trunk/core/conf/hama-default.xml (original)
+++ incubator/hama/trunk/core/conf/hama-default.xml Sat Oct 29 22:38:17 2011
@@ -100,20 +100,6 @@
by a groom server.</description>
</property>
- <property>
- <name>hama.sync.server.class</name>
- <value>org.apache.hama.bsp.sync.zookeeper.ZooKeeperSyncServerImpl</value>
- <description>The server class which is used for the barrier
synchronization.
- This has only effects in YARN module.</description>
- </property>
-
- <property>
- <name>hama.sync.client.class</name>
- <value>org.apache.hama.bsp.sync.zookeeper.ZooKeeperSyncClientImpl</value>
- <description>The client class which is used for the
- barrier synchronization.</description>
- </property>
-
<!--
Beginning of properties that are directly mapped from ZooKeeper's zoo.cfg.
All properties with an "hama.zookeeper.property." prefix are converted for
Modified:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServerRunner.java
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServerRunner.java?rev=1195061&r1=1195060&r2=1195061&view=diff
==============================================================================
---
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServerRunner.java
(original)
+++
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServerRunner.java
Sat Oct 29 22:38:17 2011
@@ -30,7 +30,12 @@ public class SyncServerRunner implements
// use the SyncServiceFactory to obtain a new instance.
SyncServerRunner(Configuration conf) {
- syncServer = SyncServiceFactory.getSyncServer(conf);
+ try {
+ syncServer = SyncServiceFactory.getSyncServer(conf);
+ } catch (ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
public Configuration init(Configuration conf) throws Exception {
@@ -48,4 +53,4 @@ public class SyncServerRunner implements
syncServer.stopServer();
}
-}
\ No newline at end of file
+}
Modified:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServiceFactory.java
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServiceFactory.java?rev=1195061&r1=1195060&r2=1195061&view=diff
==============================================================================
---
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServiceFactory.java
(original)
+++
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/SyncServiceFactory.java
Sat Oct 29 22:38:17 2011
@@ -17,17 +17,10 @@
*/
package org.apache.hama.bsp.sync;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.hama.bsp.sync.zookeeper.ZooKeeperSyncClientImpl;
-import org.apache.hama.bsp.sync.zookeeper.ZooKeeperSyncServerImpl;
public class SyncServiceFactory {
-
- private static final Log LOG = LogFactory.getLog(SyncServiceFactory.class);
-
public static final String SYNC_SERVER_CLASS = "hama.sync.server.class";
public static final String SYNC_CLIENT_CLASS = "hama.sync.client.class";
@@ -37,20 +30,11 @@ public class SyncServiceFactory {
* @param conf
* @return
*/
- public static SyncClient getSyncClient(Configuration conf) {
- if (conf.get(SYNC_CLIENT_CLASS) != null) {
- try {
- return (SyncClient) ReflectionUtils.newInstance(
- conf.getClassByName(conf.get(SYNC_CLIENT_CLASS)), conf);
- } catch (ClassNotFoundException e) {
- LOG.error(
- "Class for sync client has not been found, returning default
zookeeper client!",
- e);
- }
- } else {
- LOG.info("No property set for \"hama.sync.client.class\", using default
zookeeper client");
- }
- return ReflectionUtils.newInstance(ZooKeeperSyncClientImpl.class, conf);
+ public static SyncClient getSyncClient(Configuration conf)
+ throws ClassNotFoundException {
+ return (SyncClient) ReflectionUtils.newInstance(conf.getClassByName(conf
+ .get(SYNC_CLIENT_CLASS,
+ "org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl")), conf);
}
/**
@@ -59,20 +43,11 @@ public class SyncServiceFactory {
* @param conf
* @return
*/
- public static SyncServer getSyncServer(Configuration conf) {
- if (conf.get(SYNC_SERVER_CLASS) != null) {
- try {
- return (SyncServer) ReflectionUtils.newInstance(
- conf.getClassByName(conf.get(SYNC_SERVER_CLASS)), conf);
- } catch (ClassNotFoundException e) {
- LOG.error(
- "Class for sync server has not been found, returning default
zookeeper server!",
- e);
- }
- } else {
- LOG.info("No property set for \"hama.sync.server.class\", using default
zookeeper client");
- }
- return ReflectionUtils.newInstance(ZooKeeperSyncServerImpl.class, conf);
+ public static SyncServer getSyncServer(Configuration conf)
+ throws ClassNotFoundException {
+ return (SyncServer) ReflectionUtils.newInstance(conf.getClassByName(conf
+ .get(SYNC_SERVER_CLASS,
+ "org.apache.hama.bsp.sync.ZooKeeperSyncServerImpl")), conf);
}
/**
Copied:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java
(from r1194876,
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncClientImpl.java)
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java?p2=incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java&p1=incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncClientImpl.java&r1=1194876&r2=1195061&rev=1195061&view=diff
==============================================================================
---
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncClientImpl.java
(original)
+++
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java
Sat Oct 29 22:38:17 2011
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hama.bsp.sync.zookeeper;
+package org.apache.hama.bsp.sync;
import java.net.InetSocketAddress;
import java.util.Arrays;
Copied:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncServerImpl.java
(from r1194876,
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncServerImpl.java)
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncServerImpl.java?p2=incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncServerImpl.java&p1=incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncServerImpl.java&r1=1194876&r2=1195061&rev=1195061&view=diff
==============================================================================
---
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/zookeeper/ZooKeeperSyncServerImpl.java
(original)
+++
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncServerImpl.java
Sat Oct 29 22:38:17 2011
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hama.bsp.sync.zookeeper;
+package org.apache.hama.bsp.sync;
import org.apache.hadoop.conf.Configuration;
import org.apache.hama.bsp.sync.SyncServer;
Modified:
incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/sync/TestSyncServiceFactory.java
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/sync/TestSyncServiceFactory.java?rev=1195061&r1=1195060&r2=1195061&view=diff
==============================================================================
---
incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/sync/TestSyncServiceFactory.java
(original)
+++
incubator/hama/trunk/core/src/test/java/org/apache/hama/bsp/sync/TestSyncServiceFactory.java
Sat Oct 29 22:38:17 2011
@@ -20,8 +20,6 @@ package org.apache.hama.bsp.sync;
import junit.framework.TestCase;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hama.bsp.sync.zookeeper.ZooKeeperSyncClientImpl;
-import org.apache.hama.bsp.sync.zookeeper.ZooKeeperSyncServerImpl;
public class TestSyncServiceFactory extends TestCase {