in sync w/ hadoop YARN-913 commit 80ed39b; registry API -> draft1
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/4f5bf0a4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/4f5bf0a4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/4f5bf0a4 Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry Commit: 4f5bf0a4a307e609fb4b648790590665e49ba339 Parents: 9a8ee80 Author: Steve Loughran <ste...@apache.org> Authored: Mon Aug 18 16:50:19 2014 +0100 Committer: Steve Loughran <ste...@apache.org> Committed: Mon Aug 18 16:50:19 2014 +0100 ---------------------------------------------------------------------- .../java/org/apache/slider/client/SliderClient.java | 10 +++++----- .../slider/server/appmaster/SliderAppMaster.java | 6 +++--- .../slider/server/appmaster/web/SliderAMWebApp.java | 6 +++--- .../server/services/curator/CuratorService.java | 2 +- .../utility/AbstractSliderLaunchedService.java | 14 ++++++-------- .../yarnregistry/YarnRegistryViewForProviders.java | 2 +- .../slider/providers/hbase/HBaseProviderService.java | 2 +- 7 files changed, 20 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-core/src/main/java/org/apache/slider/client/SliderClient.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java index 8052eb1..b5e0fa5 100644 --- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java +++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java @@ -34,8 +34,8 @@ import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.registry.client.api.RegistryConstants; -import org.apache.hadoop.yarn.registry.client.binding.zk.ZKPathDumper; -import org.apache.hadoop.yarn.registry.server.services.YarnRegistryService; +import org.apache.hadoop.yarn.registry.client.binding.ZKPathDumper; +import org.apache.hadoop.yarn.registry.client.draft1.RegistryWriterService; import org.apache.slider.api.ClusterDescription; import org.apache.slider.api.ClusterNode; import org.apache.slider.api.InternalKeys; @@ -166,7 +166,7 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe /** * The YARN registry service */ - private YarnRegistryService yarnRegistry; + private RegistryWriterService yarnRegistry; /** * Constructor @@ -2484,7 +2484,7 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe * @throws SliderException * @throws IOException */ - private synchronized YarnRegistryService maybeStartYarnRegistry() throws + private synchronized RegistryWriterService maybeStartYarnRegistry() throws SliderException, IOException { @@ -2498,7 +2498,7 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe * Get the YARN registry * @return the registry */ - public YarnRegistryService getYarnRegistry() throws + public RegistryWriterService getYarnRegistry() throws SliderException, IOException { return maybeStartYarnRegistry(); http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java index a614f39..e9cdad6 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java @@ -53,8 +53,8 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.ipc.YarnRPC; import org.apache.hadoop.yarn.registry.client.types.ServiceRecord; -import org.apache.hadoop.yarn.registry.server.services.YarnRegistryService; -import org.apache.hadoop.yarn.registry.client.types.RegistryTypeUtils; +import org.apache.hadoop.yarn.registry.client.draft1.RegistryWriterService; +import org.apache.hadoop.yarn.registry.client.binding.RegistryTypeUtils; import org.apache.hadoop.yarn.security.AMRMTokenIdentifier; import org.apache.hadoop.yarn.security.client.ClientToAMTokenSecretManager; import org.apache.hadoop.yarn.util.ConverterUtils; @@ -331,7 +331,7 @@ public class SliderAppMaster extends AbstractSliderLaunchedService * The YARN registry service */ @SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized") - private YarnRegistryService yarnRegistry; + private RegistryWriterService yarnRegistry; /** http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java index 7e0d963..9e9b29c 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java @@ -22,7 +22,7 @@ import com.sun.jersey.api.core.ResourceConfig; import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; import com.sun.jersey.spi.container.servlet.ServletContainer; import org.apache.curator.x.discovery.ServiceDiscovery; -import org.apache.hadoop.yarn.registry.server.services.YarnRegistryService; +import org.apache.hadoop.yarn.registry.client.draft1.RegistryWriterService; import org.apache.hadoop.yarn.webapp.Dispatcher; import org.apache.hadoop.yarn.webapp.GenericExceptionHandler; import org.apache.hadoop.yarn.webapp.WebApp; @@ -49,11 +49,11 @@ public class SliderAMWebApp extends WebApp { public static final String CLUSTER_SPEC = "/spec"; public final SliderRegistryService registry; - private final YarnRegistryService yarnRegistry; + private final RegistryWriterService yarnRegistry; public SliderAMWebApp(SliderRegistryService registry, - YarnRegistryService yarnRegistry) { + RegistryWriterService yarnRegistry) { this.yarnRegistry = yarnRegistry; Preconditions.checkArgument(registry != null, "registry null"); this.registry = registry; http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorService.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorService.java b/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorService.java index a86e2b0..983308f 100644 --- a/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorService.java +++ b/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorService.java @@ -24,7 +24,7 @@ import org.apache.curator.utils.ZKPaths; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.service.AbstractService; -import org.apache.hadoop.yarn.registry.client.binding.zk.ZKPathDumper; +import org.apache.hadoop.yarn.registry.client.binding.ZKPathDumper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java b/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java index 4b78d52..33d3508 100644 --- a/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java +++ b/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java @@ -22,7 +22,7 @@ package org.apache.slider.server.services.utility; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.registry.client.api.RegistryConstants; -import org.apache.hadoop.yarn.registry.server.services.YarnRegistryService; +import org.apache.hadoop.yarn.registry.client.draft1.RegistryWriterService; import org.apache.slider.common.SliderXmlConfKeys; import org.apache.slider.common.tools.SliderUtils; import org.apache.slider.core.exceptions.BadCommandArgumentsException; @@ -33,8 +33,6 @@ import org.apache.slider.server.services.registry.SliderRegistryService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.slider.common.SliderXmlConfKeys.REGISTRY_PATH; - /** * Base service for the standard slider client/server services */ @@ -116,17 +114,17 @@ public abstract class AbstractSliderLaunchedService extends * @param zkPath * @return */ - public YarnRegistryService startYarnRegistryService() + public RegistryWriterService startYarnRegistryService() throws BadConfigException { Configuration conf = getConfig(); // push back the slider registry entry if needed String quorum = lookupZKQuorum(); conf.set(RegistryConstants.REGISTRY_ZK_QUORUM, quorum); - YarnRegistryService yarnRegistryService = - new YarnRegistryService("YarnRegistry"); - deployChildService(yarnRegistryService); - return yarnRegistryService; + RegistryWriterService registryWriterService = + new RegistryWriterService("YarnRegistry"); + deployChildService(registryWriterService); + return registryWriterService; } /** http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-core/src/main/java/org/apache/slider/server/services/yarnregistry/YarnRegistryViewForProviders.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/services/yarnregistry/YarnRegistryViewForProviders.java b/slider-core/src/main/java/org/apache/slider/server/services/yarnregistry/YarnRegistryViewForProviders.java index efc1cf3..955c355 100644 --- a/slider-core/src/main/java/org/apache/slider/server/services/yarnregistry/YarnRegistryViewForProviders.java +++ b/slider-core/src/main/java/org/apache/slider/server/services/yarnregistry/YarnRegistryViewForProviders.java @@ -18,7 +18,7 @@ package org.apache.slider.server.services.yarnregistry; -import org.apache.hadoop.yarn.registry.client.api.RegistryWriter; +import org.apache.hadoop.yarn.registry.client.draft1.RegistryWriter; import org.apache.hadoop.yarn.registry.client.types.ServiceRecord; import java.io.IOException; http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4f5bf0a4/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java index 4d33400..631587a 100644 --- a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java +++ b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java @@ -22,7 +22,7 @@ package org.apache.slider.providers.hbase; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.yarn.api.records.Container; -import org.apache.hadoop.yarn.registry.client.api.RegistryWriter; +import org.apache.hadoop.yarn.registry.client.draft1.RegistryWriter; import org.apache.hadoop.yarn.registry.client.types.ServiceRecord; import org.apache.slider.api.InternalKeys; import org.apache.slider.common.SliderKeys;