Author: stevel Date: Thu May 8 17:09:42 2014 New Revision: 1593334 URL: http://svn.apache.org/r1593334 Log: SLIDER-35 providers to publish registry information -start to build a specific interface to access the registry, one that hides curator at work
Added: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/core/registry/info/RegistryNaming.java - copied, changed from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryNaming.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryDiscoveryContext.java - copied, changed from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryDiscoveryContext.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryRestResources.java - copied, changed from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryRestResources.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryServiceConstants.java - copied, changed from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryConsts.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryViewForProviders.java (with props) incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/SliderRegistryService.java (with props) Removed: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryConsts.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryDiscoveryContext.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryNaming.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryRestResources.java Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/client/SliderClient.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/PublishedArtifacts.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/RestPaths.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorHelper.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryBinderService.java incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestLocalRegistry.groovy incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy incubator/slider/trunk/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/client/SliderClient.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/client/SliderClient.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/client/SliderClient.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/client/SliderClient.java Thu May 8 17:09:42 2014 @@ -100,6 +100,7 @@ import org.apache.slider.server.appmaste import org.apache.slider.server.appmaster.rpc.RpcBinder; import org.apache.slider.server.services.curator.CuratorServiceInstance; import org.apache.slider.server.services.curator.RegistryBinderService; +import org.apache.slider.server.services.registry.SliderRegistryService; import org.apache.slider.server.services.utility.AbstractSliderLaunchedService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -143,7 +144,7 @@ public class SliderClient extends Abstra private SliderYarnClientImpl yarnClient; private YARNRegistryClient YARNRegistryClient; private AggregateConf launchedInstanceDefinition; - private RegistryBinderService<ServiceInstanceData> registry; + private SliderRegistryService registry; /** * Constructor @@ -2151,7 +2152,7 @@ public class SliderClient extends Abstra * @throws SliderException * @throws IOException */ - private synchronized RegistryBinderService<ServiceInstanceData> maybeStartRegistry() throws + private synchronized SliderRegistryService maybeStartRegistry() throws SliderException, IOException { @@ -2170,7 +2171,7 @@ public class SliderClient extends Abstra */ @VisibleForTesting - public RegistryBinderService<ServiceInstanceData> getRegistry() throws + public SliderRegistryService getRegistry() throws SliderException, IOException { return maybeStartRegistry(); Copied: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/core/registry/info/RegistryNaming.java (from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryNaming.java) URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/core/registry/info/RegistryNaming.java?p2=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/core/registry/info/RegistryNaming.java&p1=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryNaming.java&r1=1593203&r2=1593334&rev=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryNaming.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/core/registry/info/RegistryNaming.java Thu May 8 17:09:42 2014 @@ -16,12 +16,18 @@ * limitations under the License. */ -package org.apache.slider.server.services.curator; +package org.apache.slider.core.registry.info; import java.util.Locale; +/** + * Logic for greating names from registry entries; lets the policy be changed + * later + */ public class RegistryNaming { + public static String SLIDER_INSTANCE_NAME_FORMAT = "%s-%s"; + public static String createRegistryServiceType(String instanceName, String userName, String serviceName) { @@ -33,7 +39,7 @@ public class RegistryNaming { String serviceName, int appId) { return String.format(Locale.ENGLISH, - RegistryConsts.SLIDER_INSTANCE_NAME_FORMAT, userName, + SLIDER_INSTANCE_NAME_FORMAT, userName, instanceName, serviceName, appId); Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java Thu May 8 17:09:42 2014 @@ -32,6 +32,7 @@ import org.apache.slider.core.registry.i import org.apache.slider.server.appmaster.state.StateAccessForProviders; import org.apache.slider.server.appmaster.web.rest.agent.AgentRestOperations; import org.apache.slider.server.services.curator.RegistryBinderService; +import org.apache.slider.server.services.registry.RegistryViewForProviders; import org.apache.slider.server.services.utility.ForkedProcessService; import org.apache.slider.server.services.utility.Parent; import org.apache.slider.server.services.utility.SequenceService; @@ -53,17 +54,17 @@ import java.util.Map; * upstream */ public abstract class AbstractProviderService - extends SequenceService - implements - ProviderCore, + extends SequenceService + implements + ProviderCore, SliderKeys, - ProviderService { + ProviderService { private static final Logger log = LoggerFactory.getLogger(AbstractProviderService.class); protected AggregateConf instanceDefinition; protected StateAccessForProviders stateAccessor; protected AgentRestOperations restOps; - protected RegistryBinderService<ServiceInstanceData> registry; + protected RegistryViewForProviders registry; public AbstractProviderService(String name) { super(name); @@ -84,7 +85,7 @@ public abstract class AbstractProviderSe @Override public void bind(StateAccessForProviders stateAccessor, - RegistryBinderService<ServiceInstanceData> registry) { + RegistryViewForProviders registry) { this.stateAccessor = stateAccessor; this.registry = registry; } Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java Thu May 8 17:09:42 2014 @@ -34,6 +34,7 @@ import org.apache.slider.core.registry.i import org.apache.slider.server.appmaster.state.StateAccessForProviders; import org.apache.slider.server.appmaster.web.rest.agent.AgentRestOperations; import org.apache.slider.server.services.curator.RegistryBinderService; +import org.apache.slider.server.services.registry.RegistryViewForProviders; import org.apache.slider.server.services.utility.EventCallback; import java.io.File; @@ -140,7 +141,7 @@ public interface ProviderService extends * @param registry */ void bind(StateAccessForProviders stateAccessor, - RegistryBinderService<ServiceInstanceData> registry); + RegistryViewForProviders registry); /** * Returns the agent rest operations interface. Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java Thu May 8 17:09:42 2014 @@ -38,6 +38,7 @@ import org.apache.slider.core.exceptions import org.apache.slider.core.exceptions.SliderException; import org.apache.slider.core.launch.CommandLineBuilder; import org.apache.slider.core.launch.ContainerLauncher; +import org.apache.slider.core.registry.info.RegisteredEndpoint; import org.apache.slider.core.registry.info.ServiceInstanceData; import org.apache.slider.providers.AbstractProviderService; import org.apache.slider.providers.ProviderCore; @@ -56,7 +57,6 @@ import org.apache.slider.server.appmaste import org.apache.slider.server.appmaster.web.rest.agent.RegistrationResponse; import org.apache.slider.server.appmaster.web.rest.agent.RegistrationStatus; import org.apache.slider.server.appmaster.web.rest.agent.StatusCommand; -import org.apache.slider.server.services.curator.CuratorServiceInstance; import org.apache.slider.server.services.utility.EventCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -77,12 +77,6 @@ import java.util.Map; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicInteger; -import static org.apache.slider.core.registry.info.RegistryFields.DESCRIPTION; -import static org.apache.slider.core.registry.info.RegistryFields.ENDPOINTS; -import static org.apache.slider.core.registry.info.RegistryFields.EXTERNAL_VIEW; -import static org.apache.slider.core.registry.info.RegistryFields.PROTOCOL; -import static org.apache.slider.core.registry.info.RegistryFields.VALUE; - /** This class implements the server-side aspects of an agent deployment */ public class AgentProviderService extends AbstractProviderService implements ProviderCore, @@ -619,18 +613,18 @@ public class AgentProviderService extend private void buildEndpointDetails(Map<String, URL> details) { try { - List<CuratorServiceInstance<ServiceInstanceData>> services = - registry.listInstances(SliderKeys.APP_TYPE); - assert services.size() == 1; - CuratorServiceInstance<ServiceInstanceData> service = services.get(0); - Map payload = (Map) service.getPayload(); - Map<String, Map<String, String>> endpoints = - (Map) ((Map) payload.get(EXTERNAL_VIEW)).get(ENDPOINTS); - for (Map.Entry<String, Map<String, String>> endpoint : endpoints.entrySet()) { - if ("http".equals(endpoint.getValue().get(PROTOCOL))) { - URL url = new URL(endpoint.getValue().get(VALUE)); - details.put(endpoint.getValue().get(DESCRIPTION), - url); + List<ServiceInstanceData> services = + registry.listInstancesByType(SliderKeys.APP_TYPE); + assert services.size() >= 1; + ServiceInstanceData payload = services.get(0); + Map<String, RegisteredEndpoint> endpointMap = + payload.externalView.endpoints; + for (Map.Entry<String, RegisteredEndpoint> endpoint : endpointMap + .entrySet()) { + RegisteredEndpoint val = endpoint.getValue(); + if ("http".equals(val.protocol)) { + URL url = new URL(val.value); + details.put(val.description, url); } } } catch (IOException e) { Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/PublishedArtifacts.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/PublishedArtifacts.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/PublishedArtifacts.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/PublishedArtifacts.java Thu May 8 17:09:42 2014 @@ -27,4 +27,5 @@ public interface PublishedArtifacts { String CORE_SITE_CONFIG = "core-site"; String HDFS_SITE_CONFIG = "hdfs-site"; String YARN_SITE_CONFIG = "yarn-site"; + String LOG4J = "log4j"; } Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java Thu May 8 17:09:42 2014 @@ -80,6 +80,7 @@ import org.apache.slider.core.exceptions import org.apache.slider.core.exceptions.SliderException; import org.apache.slider.core.exceptions.SliderInternalStateException; import org.apache.slider.core.exceptions.TriggerClusterTeardownException; +import org.apache.slider.core.main.LauncherExitCodes; import org.apache.slider.core.main.RunService; import org.apache.slider.core.main.ServiceLauncher; import org.apache.slider.core.persist.ConfTreeSerDeser; @@ -108,9 +109,9 @@ import org.apache.slider.server.appmaste import org.apache.slider.server.appmaster.web.SliderAmIpFilter; import org.apache.slider.server.appmaster.web.WebAppApi; import org.apache.slider.server.appmaster.web.WebAppApiImpl; -import org.apache.slider.server.services.curator.RegistryBinderService; -import org.apache.slider.server.services.curator.RegistryConsts; -import org.apache.slider.server.services.curator.RegistryNaming; +import org.apache.slider.server.appmaster.web.rest.RestPaths; +import org.apache.slider.core.registry.info.RegistryNaming; +import org.apache.slider.server.services.registry.SliderRegistryService; import org.apache.slider.server.services.utility.AbstractSliderLaunchedService; import org.apache.slider.server.services.utility.EventCallback; import org.apache.slider.server.services.utility.RpcService; @@ -131,6 +132,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; @@ -145,15 +147,15 @@ import static org.apache.slider.server.a */ public class SliderAppMaster extends AbstractSliderLaunchedService implements AMRMClientAsync.CallbackHandler, - NMClientAsync.CallbackHandler, - RunService, + NMClientAsync.CallbackHandler, + RunService, SliderExitCodes, SliderKeys, SliderClusterProtocol, - ServiceStateChangeListener, - RoleKeys, - EventCallback, - ContainerStartOperation { + ServiceStateChangeListener, + RoleKeys, + EventCallback, + ContainerStartOperation { protected static final Logger log = LoggerFactory.getLogger(SliderAppMaster.class); @@ -262,7 +264,7 @@ public class SliderAppMaster extends Abs */ private ProviderService providerService; - private RegistryBinderService<ServiceInstanceData> registry; + private SliderRegistryService registry; /** * Record of the max no. of cores allowed in this cluster @@ -348,7 +350,7 @@ public class SliderAppMaster extends Abs /** * pick up the args from the service launcher - * @param config + * @param config configuration * @param args argument list */ @Override // RunService @@ -381,10 +383,10 @@ public class SliderAppMaster extends Abs //choose the action String action = serviceArgs.getAction(); List<String> actionArgs = serviceArgs.getActionArgs(); - int exitCode = EXIT_SUCCESS; + int exitCode; if (action.equals(SliderActions.ACTION_HELP)) { log.info(getName() + serviceArgs.usage()); - exitCode = SliderExitCodes.EXIT_USAGE; + exitCode = LauncherExitCodes.EXIT_USAGE; } else if (action.equals(SliderActions.ACTION_CREATE)) { exitCode = createAndRunCluster(actionArgs.get(0)); } else { @@ -563,12 +565,13 @@ public class SliderAppMaster extends Abs // Start up the WebApp and track the URL for it webApp = new SliderAMWebApp(registry); WebApps.$for(SliderAMWebApp.BASE_PATH, WebAppApi.class, - new WebAppApiImpl(this, appState, providerService), "ws") + new WebAppApiImpl(this, appState, providerService), + RestPaths.WS_CONTEXT) .with(serviceConf) .start(webApp); appMasterTrackingUrl = "http://" + appMasterHostname + ":" + webApp.port(); WebAppService<SliderAMWebApp> webAppService = - new WebAppService<SliderAMWebApp>("slider", webApp); + new WebAppService<>("slider", webApp); webAppService.init(conf); webAppService.start(); @@ -639,7 +642,7 @@ public class SliderAppMaster extends Abs // build up environment variables that the AM wants set in every container // irrespective of provider and role. - envVars = new HashMap<String, String>(); + envVars = new HashMap<>(); if (hadoop_user_name != null) { envVars.put(HADOOP_USER_NAME, hadoop_user_name); } @@ -732,7 +735,8 @@ public class SliderAppMaster extends Abs new PublishedConfiguration( "HDFS site settings", ConfigHelper.loadFromResource("hdfs-site.xml"))); - + + ServiceInstanceData instanceData = new ServiceInstanceData(); instanceData.id = registryId; instanceData.serviceType = appServiceType; @@ -756,7 +760,7 @@ public class SliderAppMaster extends Abs externalView.endpoints.put( CustomRegistryConstants.REGISTRY_REST_API, new RegisteredEndpoint( - new URL(amWeb, RegistryConsts.REGISTRY_RESOURCE_PATH), + new URL(amWeb, RestPaths.SLIDER_PATH_REGISTRY), "Registry Web Service" ) ); @@ -791,11 +795,11 @@ public class SliderAppMaster extends Abs ); - registry.register( - appServiceType, - registryId, - amWeb, - instanceData); + registry.registerSelf( + appServiceType, + registryId, + amWeb, + instanceData); } /** @@ -931,9 +935,7 @@ public class SliderAppMaster extends Abs try { log.info("Unregistering AM status={} message={}", appStatus, appMessage); asyncRMClient.unregisterApplicationMaster(appStatus, appMessage, null); - } catch (YarnException e) { - log.info("Failed to unregister application: " + e, e); - } catch (IOException e) { + } catch (YarnException | IOException e) { log.info("Failed to unregister application: " + e, e); } } @@ -991,8 +993,8 @@ public class SliderAppMaster extends Abs @Override //AMRMClientAsync public void onContainersAllocated(List<Container> allocatedContainers) { LOG_YARN.info("onContainersAllocated({})", allocatedContainers.size()); - List<ContainerAssignment> assignments = new ArrayList<ContainerAssignment>(); - List<AbstractRMOperation> operations = new ArrayList<AbstractRMOperation>(); + List<ContainerAssignment> assignments = new ArrayList<>(); + List<AbstractRMOperation> operations = new ArrayList<>(); //app state makes all the decisions appState.onContainersAllocated(allocatedContainers, assignments, operations); @@ -1309,7 +1311,7 @@ public class SliderAppMaster extends Abs RoleInstance instance = appState.getLiveInstanceByContainerID(containerID); List<AbstractRMOperation> opsList = - new LinkedList<AbstractRMOperation>(); + new LinkedList<>(); ContainerReleaseOperation release = new ContainerReleaseOperation(instance.getId()); opsList.add(release); @@ -1351,15 +1353,15 @@ public class SliderAppMaster extends Abs /** * Launch the provider service * - * @param cd - * @param confDir + * @param instanceDefinition definition of the service + * @param confDir directory of config data * @throws IOException * @throws SliderException */ protected synchronized void launchProviderService(AggregateConf instanceDefinition, File confDir) throws IOException, SliderException { - Map<String, String> env = new HashMap<String, String>(); + Map<String, String> env = new HashMap<>(); boolean execStarted = providerService.exec(instanceDefinition, confDir, env, this); if (execStarted) { providerService.registerServiceListener(this); @@ -1409,8 +1411,6 @@ public class SliderAppMaster extends Abs AMUtils.mapProcessExitCodeToYarnExitCode(exitCode); boolean shouldTriggerFailure = !amCompletionFlag.get() && (AMUtils.isMappedExitAFailure(mappedProcessExitCode)); - - if (shouldTriggerFailure) { //this wasn't expected: the process finished early @@ -1556,7 +1556,7 @@ public class SliderAppMaster extends Abs //turn the args to a list List<String> argsList = Arrays.asList(args); //create a new list, as the ArrayList type doesn't push() on an insert - List<String> extendedArgs = new ArrayList<String>(argsList); + List<String> extendedArgs = new ArrayList<>(argsList); //insert the service name extendedArgs.add(0, SERVICE_CLASSNAME); //now have the service launcher do its work Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAMWebApp.java Thu May 8 17:09:42 2014 @@ -32,8 +32,9 @@ import org.apache.slider.server.appmaste import org.apache.slider.server.appmaster.web.rest.SliderJacksonJaxbJsonProvider; import org.apache.slider.server.services.curator.CuratorHelper; import org.apache.slider.server.services.curator.RegistryBinderService; -import org.apache.slider.server.services.curator.RegistryDiscoveryContext; -import org.apache.slider.server.services.curator.RegistryRestResources; +import org.apache.slider.server.services.registry.RegistryDiscoveryContext; +import org.apache.slider.server.services.registry.RegistryRestResources; +import org.apache.slider.server.services.registry.SliderRegistryService; import java.util.HashMap; import java.util.Map; @@ -48,9 +49,9 @@ public class SliderAMWebApp extends WebA public static final String CONTAINER_STATS = "/stats"; public static final String CLUSTER_SPEC = "/spec"; - public final RegistryBinderService<ServiceInstanceData> registry; + public final SliderRegistryService registry; - public SliderAMWebApp(RegistryBinderService<ServiceInstanceData> registry) { + public SliderAMWebApp(SliderRegistryService registry) { Preconditions.checkNotNull(registry); this.registry = registry; } Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/RestPaths.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/RestPaths.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/RestPaths.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/RestPaths.java Thu May 8 17:09:42 2014 @@ -23,7 +23,8 @@ package org.apache.slider.server.appmast */ public class RestPaths { - public static final String WS_CONTEXT_ROOT = "/ws"; + public static final String WS_CONTEXT = "ws"; + public static final String WS_CONTEXT_ROOT = "/" + WS_CONTEXT; public static final String SLIDER_CONTEXT_ROOT = WS_CONTEXT_ROOT +"/v1/slider"; public static final String SLIDER_SUBPATH_MANAGEMENT = "/mgmt"; public static final String SLIDER_SUBPATH_AGENTS = "/agents"; Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorHelper.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorHelper.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorHelper.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/CuratorHelper.java Thu May 8 17:09:42 2014 @@ -29,6 +29,9 @@ import org.apache.curator.x.discovery.st import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.slider.core.registry.info.ServiceInstanceData; +import org.apache.slider.server.services.registry.RegistryServiceConstants; +import org.apache.slider.server.services.registry.RegistryDiscoveryContext; +import org.apache.slider.server.services.registry.SliderRegistryService; /** * This class creates a curator -but does not start or close it. That @@ -98,13 +101,13 @@ public class CuratorHelper extends Confi * @param discoveryBuilder builder to create the discovery from */ - public RegistryBinderService<ServiceInstanceData> createRegistryBinderService( - String basePath, - ServiceDiscoveryBuilder<ServiceInstanceData> discoveryBuilder) { + public SliderRegistryService createRegistryBinderService( + String basePath, + ServiceDiscoveryBuilder<ServiceInstanceData> discoveryBuilder) { discoveryBuilder.basePath(basePath); - return new RegistryBinderService<ServiceInstanceData>(curator, - basePath, - discoveryBuilder.build()); + return new SliderRegistryService(curator, + basePath, + discoveryBuilder.build()); } @@ -113,12 +116,12 @@ public class CuratorHelper extends Confi * @param basePath base path * @return the binder service */ - public RegistryBinderService<ServiceInstanceData> createRegistryBinderService( + public SliderRegistryService createRegistryBinderService( String basePath) { ServiceDiscoveryBuilder<ServiceInstanceData> discoveryBuilder = createDiscoveryBuilder(); //registry will start curator as well as the binder, in the correct order - RegistryBinderService<ServiceInstanceData> registryBinderService = + SliderRegistryService registryBinderService = createRegistryBinderService(basePath, discoveryBuilder); return registryBinderService; } @@ -128,7 +131,7 @@ public class CuratorHelper extends Confi Preconditions.checkNotNull(discovery); return new RegistryDiscoveryContext(discovery, new RandomStrategy<ServiceInstanceData>(), - RegistryConsts.INSTANCE_REFRESH_MS, + RegistryServiceConstants.INSTANCE_REFRESH_MS, ServiceInstanceData.class); } Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryBinderService.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryBinderService.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryBinderService.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryBinderService.java Thu May 8 17:09:42 2014 @@ -28,6 +28,7 @@ import org.apache.curator.x.discovery.Se import org.apache.curator.x.discovery.UriSpec; import org.apache.slider.core.exceptions.BadClusterStateException; import org.apache.slider.core.persist.JsonSerDeser; +import org.apache.slider.server.services.registry.RegistryViewForProviders; import org.apache.zookeeper.KeeperException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,11 +53,10 @@ public class RegistryBinderService<Paylo private final ServiceDiscovery<Payload> discovery; private final Map<String, ServiceInstance<Payload>> entries = - new HashMap<String, ServiceInstance<Payload>>(); + new HashMap<>(); JsonSerDeser<CuratorServiceInstance<Payload>> deser = - new JsonSerDeser<CuratorServiceInstance<Payload>>( - CuratorServiceInstance.class); + new JsonSerDeser<>(CuratorServiceInstance.class); /** * Create an instance @@ -206,8 +206,7 @@ public class RegistryBinderService<Paylo try { List<String> instanceIDs = instanceIDs(name); List<CuratorServiceInstance<Payload>> instances = - new ArrayList<CuratorServiceInstance<Payload>>( - instanceIDs.size()); + new ArrayList<>(instanceIDs.size()); for (String instanceID : instanceIDs) { CuratorServiceInstance<Payload> instance = queryForInstance(name, instanceID); @@ -231,6 +230,5 @@ public class RegistryBinderService<Paylo throw new IOException(e); } } - - + } Copied: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryDiscoveryContext.java (from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryDiscoveryContext.java) URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryDiscoveryContext.java?p2=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryDiscoveryContext.java&p1=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryDiscoveryContext.java&r1=1593203&r2=1593334&rev=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryDiscoveryContext.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryDiscoveryContext.java Thu May 8 17:09:42 2014 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.slider.server.services.curator; +package org.apache.slider.server.services.registry; import org.apache.curator.x.discovery.ProviderStrategy; import org.apache.curator.x.discovery.ServiceDiscovery; Copied: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryRestResources.java (from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryRestResources.java) URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryRestResources.java?p2=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryRestResources.java&p1=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryRestResources.java&r1=1593203&r2=1593334&rev=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryRestResources.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryRestResources.java Thu May 8 17:09:42 2014 @@ -16,13 +16,17 @@ * limitations under the License. */ -package org.apache.slider.server.services.curator; +package org.apache.slider.server.services.registry; import com.google.inject.Singleton; import org.apache.curator.x.discovery.ServiceInstance; import org.apache.curator.x.discovery.server.rest.DiscoveryContext; import org.apache.curator.x.discovery.server.rest.DiscoveryResource; import org.apache.slider.core.registry.info.ServiceInstanceData; +import org.apache.slider.server.appmaster.web.rest.RestPaths; +import org.apache.slider.server.services.curator.CuratorServiceInstance; +import org.apache.slider.server.services.curator.CuratorServiceInstances; +import org.apache.slider.server.services.curator.RegistryBinderService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,16 +47,16 @@ import java.util.List; import java.util.Random; @Singleton -@Path(RegistryConsts.REGISTRY_RESOURCE_PATH) +@Path(RestPaths.SLIDER_PATH_REGISTRY) public class RegistryRestResources extends DiscoveryResource<ServiceInstanceData> { protected static final Logger log = LoggerFactory.getLogger(RegistryRestResources.class); - private final RegistryBinderService<ServiceInstanceData> registry; + private final SliderRegistryService registry; private DiscoveryContext<ServiceInstanceData> context; private Random randomizer = new Random(); public RegistryRestResources(@Context DiscoveryContext<ServiceInstanceData> context, - RegistryBinderService<ServiceInstanceData> registry) { + SliderRegistryService registry) { super(context); this.context = context; this.registry = registry; Copied: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryServiceConstants.java (from r1593203, incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryConsts.java) URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryServiceConstants.java?p2=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryServiceConstants.java&p1=incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryConsts.java&r1=1593203&r2=1593334&rev=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/curator/RegistryConsts.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryServiceConstants.java Thu May 8 17:09:42 2014 @@ -16,10 +16,11 @@ * limitations under the License. */ -package org.apache.slider.server.services.curator; +package org.apache.slider.server.services.registry; -public class RegistryConsts { - public static final String REGISTRY_RESOURCE_PATH = "/ws/registry"; +/** + * These constants are unique to the slider registry service itself + */ +public class RegistryServiceConstants { public static final int INSTANCE_REFRESH_MS = 1000; - public static String SLIDER_INSTANCE_NAME_FORMAT = "%s-%s"; } Added: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryViewForProviders.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryViewForProviders.java?rev=1593334&view=auto ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryViewForProviders.java (added) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryViewForProviders.java Thu May 8 17:09:42 2014 @@ -0,0 +1,32 @@ +/* + * 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.slider.server.services.registry; + +import org.apache.slider.core.registry.info.ServiceInstanceData; + +import java.io.IOException; +import java.util.List; + +/** + * This offers restricted access to the registry for providers + */ +public interface RegistryViewForProviders { + List<ServiceInstanceData> listInstancesByType(String serviceType) throws + IOException; +} Propchange: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/RegistryViewForProviders.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/SliderRegistryService.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/SliderRegistryService.java?rev=1593334&view=auto ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/SliderRegistryService.java (added) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/SliderRegistryService.java Thu May 8 17:09:42 2014 @@ -0,0 +1,94 @@ +/* + * 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.slider.server.services.registry; + +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.x.discovery.ServiceDiscovery; +import org.apache.curator.x.discovery.ServiceInstance; +import org.apache.slider.core.registry.info.ServiceInstanceData; +import org.apache.slider.server.services.curator.CuratorServiceInstance; +import org.apache.slider.server.services.curator.RegistryBinderService; + +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +/** + * This is the registry service, which tries to hide exactly how the + * registry is implemented + */ + +public class SliderRegistryService + extends RegistryBinderService<ServiceInstanceData> + implements RegistryViewForProviders { + + private ServiceInstanceData selfRegistration; + + public SliderRegistryService(CuratorFramework curator, + String basePath, + ServiceDiscovery<ServiceInstanceData> discovery) { + super(curator, basePath, discovery); + } + + + @Override + public List<ServiceInstanceData> listInstancesByType(String serviceType) throws + IOException { + List<CuratorServiceInstance<ServiceInstanceData>> services = + listInstances(serviceType); + List<ServiceInstanceData> payloads = new ArrayList<>(services.size()); + for (CuratorServiceInstance<ServiceInstanceData> instance : services) { + payloads.add(instance.payload); + } + return payloads; + } + + public ServiceInstanceData getSelfRegistration() { + return selfRegistration; + } + + private void setSelfRegistration(ServiceInstanceData selfRegistration) { + this.selfRegistration = selfRegistration; + } + + /** + * register an instance -only valid once the service is started. + * This sets the selfRegistration field + * @param id ID -must be unique + * @param name name + * @param url URL + * @param payload payload (may be null) + * @return the instance + * @throws IOException on registration problems + */ + public void registerSelf(String name, + String id, + URL url, + ServiceInstanceData instanceData) throws IOException { + try { + register(name, id, url, instanceData); + setSelfRegistration(instanceData); + } catch (IOException e) { + throw e; + } catch (Exception e) { + throw new IOException(e); + } + } +} Propchange: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/registry/SliderRegistryService.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java (original) +++ incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/server/services/utility/AbstractSliderLaunchedService.java Thu May 8 17:09:42 2014 @@ -23,10 +23,9 @@ import org.apache.hadoop.yarn.conf.YarnC import org.apache.slider.common.SliderXmlConfKeys; import org.apache.slider.common.tools.SliderUtils; import org.apache.slider.core.exceptions.BadConfigException; -import org.apache.slider.core.registry.info.ServiceInstanceData; import org.apache.slider.core.registry.zk.ZookeeperUtils; import org.apache.slider.server.services.curator.CuratorHelper; -import org.apache.slider.server.services.curator.RegistryBinderService; +import org.apache.slider.server.services.registry.SliderRegistryService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +51,7 @@ public abstract class AbstractSliderLaun * @return the instance * @throws BadConfigException */ - protected RegistryBinderService<ServiceInstanceData> startRegistrationService() + protected SliderRegistryService startRegistrationService() throws BadConfigException { String registryQuorum = lookupZKQuorum(); @@ -83,15 +82,15 @@ public abstract class AbstractSliderLaun * @param zkPath * @return */ - public RegistryBinderService<ServiceInstanceData> startRegistrationService( + public SliderRegistryService startRegistrationService( String zkConnection, String zkPath) { CuratorHelper curatorHelper = new CuratorHelper(getConfig(), zkConnection); //registry will start curator as well as the binder, in the correct order - RegistryBinderService<ServiceInstanceData> registryBinderService = + SliderRegistryService registryBinderService = curatorHelper.createRegistryBinderService(zkPath); - boolean started = deployChildService(registryBinderService); + deployChildService(registryBinderService); return registryBinderService; } Modified: incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy (original) +++ incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy Thu May 8 17:09:42 2014 @@ -32,6 +32,7 @@ import org.apache.slider.core.main.Servi import org.apache.slider.core.registry.info.ServiceInstanceData import org.apache.slider.server.services.curator.CuratorServiceInstance import org.apache.slider.server.services.curator.RegistryBinderService +import org.apache.slider.server.services.registry.SliderRegistryService import org.junit.Test @CompileStatic @@ -96,7 +97,7 @@ class TestStandaloneAgentAM extends Age //switch to the ZK-based registry describe "service registry names" - RegistryBinderService<ServiceInstanceData> registry = client.registry + SliderRegistryService registry = client.registry def names = registry.queryForNames(); dumpRegistryNames(names) describe "service registry instance IDs" Modified: incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy (original) +++ incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy Thu May 8 17:09:42 2014 @@ -39,6 +39,7 @@ import org.apache.slider.server.appmaste import org.apache.slider.server.appmaster.web.rest.RestPaths import org.apache.slider.server.services.curator.CuratorServiceInstance import org.apache.slider.server.services.curator.RegistryBinderService +import org.apache.slider.server.services.registry.SliderRegistryService import org.junit.Test /** @@ -111,7 +112,7 @@ class TestStandaloneRegistryAM extends A //switch to the ZK-based registry describe "service registry names" - RegistryBinderService<ServiceInstanceData> registry = client.registry + SliderRegistryService registry = client.registry def names = registry.queryForNames(); dumpRegistryNames(names) Modified: incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestLocalRegistry.groovy URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestLocalRegistry.groovy?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestLocalRegistry.groovy (original) +++ incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestLocalRegistry.groovy Thu May 8 17:09:42 2014 @@ -24,7 +24,7 @@ import org.apache.slider.core.registry.i import org.apache.slider.core.registry.retrieve.RegistryRetriever import org.apache.slider.server.services.curator.CuratorHelper import org.apache.slider.server.services.curator.RegistryBinderService -import org.apache.slider.server.services.curator.RegistryNaming +import org.apache.slider.core.registry.info.RegistryNaming import org.apache.slider.test.MicroZKCluster import org.apache.slider.test.SliderTestUtils import org.junit.After Modified: incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy (original) +++ incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy Thu May 8 17:09:42 2014 @@ -35,7 +35,7 @@ import org.apache.slider.providers.agent import org.apache.slider.server.appmaster.web.rest.RestPaths import org.apache.slider.server.services.curator.CuratorServiceInstance import org.apache.slider.server.services.curator.CuratorServiceInstances -import org.apache.slider.server.services.curator.RegistryNaming +import org.apache.slider.core.registry.info.RegistryNaming import org.junit.Test import javax.ws.rs.core.MediaType Modified: incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy (original) +++ incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy Thu May 8 17:09:42 2014 @@ -38,6 +38,8 @@ import org.apache.slider.providers.Provi import org.apache.slider.server.appmaster.state.StateAccessForProviders import org.apache.slider.server.appmaster.web.rest.agent.* import org.apache.slider.server.services.curator.RegistryBinderService +import org.apache.slider.server.services.registry.RegistryViewForProviders +import org.apache.slider.server.services.registry.SliderRegistryService import org.apache.slider.server.services.utility.EventCallback class MockProviderService implements ProviderService { @@ -195,11 +197,11 @@ class MockProviderService implements Pro @Override void bind( StateAccessForProviders stateAccessor, - RegistryBinderService<ServiceInstanceData> registry) { + RegistryViewForProviders registry) { } - @Override + @Override AgentRestOperations getAgentRestOperations() { return new AgentRestOperations() { @Override Modified: incubator/slider/trunk/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy URL: http://svn.apache.org/viewvc/incubator/slider/trunk/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy?rev=1593334&r1=1593333&r2=1593334&view=diff ============================================================================== --- incubator/slider/trunk/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy (original) +++ incubator/slider/trunk/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy Thu May 8 17:09:42 2014 @@ -27,6 +27,7 @@ import org.apache.slider.core.main.Servi import org.apache.slider.core.registry.info.ServiceInstanceData import org.apache.slider.server.services.curator.CuratorServiceInstance import org.apache.slider.server.services.curator.RegistryBinderService +import org.apache.slider.server.services.registry.SliderRegistryService import org.junit.Test @CompileStatic @@ -81,7 +82,7 @@ class TestTwoLiveClusters extends HBaseM // registry instances def names = client.listRegistryNames(clustername) describe "service registry names" - RegistryBinderService<ServiceInstanceData> registry = cluster2Client.registry + SliderRegistryService registry = cluster2Client.registry def names = registry.queryForNames(); dumpRegistryNames(names)