SLIDER-149 in sync w/ YARN-913
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/2a288228 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/2a288228 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/2a288228 Branch: refs/heads/develop Commit: 2a28822839d339780a3bebdf33ef136a3cd13adf Parents: dbd1d3d Author: Steve Loughran <[email protected]> Authored: Tue Sep 23 14:54:01 2014 +0100 Committer: Steve Loughran <[email protected]> Committed: Tue Sep 23 14:54:01 2014 +0100 ---------------------------------------------------------------------- .../src/main/java/org/apache/slider/client/SliderClient.java | 2 +- .../java/org/apache/slider/core/persist/JsonSerDeser.java | 8 ++++---- .../services/yarnregistry/YarnRegistryViewForProviders.java | 4 ++-- .../agent/standalone/TestStandaloneYarnRegistryAM.groovy | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/2a288228/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 93050a5..3e0b111 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 @@ -2447,7 +2447,7 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe BindingUtils.serviceclassPath(BindingUtils.currentUser(), serviceType); RegistryPathStatus[] listDir; - listDir = operations.listDir(serviceclassPath); + listDir = operations.list(serviceclassPath); if (listDir.length == 0) { throw new PathNotFoundException("records under " + serviceclassPath); http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/2a288228/slider-core/src/main/java/org/apache/slider/core/persist/JsonSerDeser.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/core/persist/JsonSerDeser.java b/slider-core/src/main/java/org/apache/slider/core/persist/JsonSerDeser.java index ab165b1..37526be 100644 --- a/slider-core/src/main/java/org/apache/slider/core/persist/JsonSerDeser.java +++ b/slider-core/src/main/java/org/apache/slider/core/persist/JsonSerDeser.java @@ -51,14 +51,14 @@ public class JsonSerDeser<T> { private static final Logger log = LoggerFactory.getLogger(JsonSerDeser.class); private static final String UTF_8 = "UTF-8"; - private final Class classType; + private final Class<T> classType; private final ObjectMapper mapper; /** * Create an instance bound to a specific type * @param classType */ - public JsonSerDeser(Class classType) { + public JsonSerDeser(Class<T> classType) { this.classType = classType; this.mapper = new ObjectMapper(); mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -74,7 +74,7 @@ public class JsonSerDeser<T> { public T fromJson(String json) throws IOException, JsonParseException, JsonMappingException { try { - return (T) (mapper.readValue(json, classType)); + return mapper.readValue(json, classType); } catch (IOException e) { log.error("Exception while parsing json : " + e + "\n" + json, e); throw e; @@ -91,7 +91,7 @@ public class JsonSerDeser<T> { public T fromFile(File jsonFile) throws IOException, JsonParseException, JsonMappingException { try { - return (T) (mapper.readValue(jsonFile, classType)); + return mapper.readValue(jsonFile, classType); } catch (IOException e) { log.error("Exception while parsing json file {}: {}", jsonFile, e); throw e; http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/2a288228/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 fc7ec2a..65ae420 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 @@ -87,7 +87,7 @@ public class YarnRegistryViewForProviders { ServiceRecord record) throws IOException { String path = BindingUtils.componentPath( user, serviceClass, serviceName, componentName); - registryOperations.mkdir(RegistryPathUtils.parentOf(path), true); + registryOperations.mknode(RegistryPathUtils.parentOf(path), true); registryOperations.create(path, record, CreateFlags.OVERWRITE); } @@ -108,7 +108,7 @@ public class YarnRegistryViewForProviders { String path = BindingUtils.servicePath( username, serviceClass, serviceName); - registryOperations.mkdir(RegistryPathUtils.parentOf(path), true); + registryOperations.mknode(RegistryPathUtils.parentOf(path), true); registryOperations.create(path, record, CreateFlags.OVERWRITE); } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/2a288228/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy index c7291a8..e88fbe8 100644 --- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy @@ -140,14 +140,14 @@ class TestStandaloneYarnRegistryAM extends AgentMiniClusterTestBase { def registryService = client.registryOperations def self = currentUser() - RegistryPathStatus[] serviceTypes = registryService.listDir(userPath(self)) + RegistryPathStatus[] serviceTypes = registryService.list(userPath(self)) dumpArray(serviceTypes) def recordsPath = serviceclassPath(self, SliderKeys.APP_TYPE) Map < String, ServiceRecord > recordMap = RecordOperations.extractServiceRecords( registryService, - registryService.listDir(recordsPath)) + registryService.list(recordsPath)) def serviceRecords = recordMap.values(); dumpCollection(serviceRecords) assert serviceRecords.size() == 1
