You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/05/15 15:01:28 UTC
svn commit: r1594905 - in /incubator/slider/trunk:
slider-core/src/main/java/org/apache/slider/client/SliderClient.java
slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy
src/site/markdown/manpage.md
Author: stevel
Date: Thu May 15 13:01:28 2014
New Revision: 1594905
URL: http://svn.apache.org/r1594905
Log:
SLIDER-5 CLI to list and retrieve service bindings & configs -requests for missing conf files are mapped to BadCommandArguments exception and exit code
Modified:
incubator/slider/trunk/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
incubator/slider/trunk/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy
incubator/slider/trunk/src/site/markdown/manpage.md
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=1594905&r1=1594904&r2=1594905&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 15 13:01:28 2014
@@ -1963,7 +1963,9 @@ public class SliderClient extends Abstra
actionRegistryGetConfig(registryArgs);
outputConfig(publishedConfiguration, registryArgs);
} catch (FileNotFoundException e) {
-// TODO
+ //there's no configuration here, so raise an error
+ throw new BadCommandArgumentsException(e, "Unknown configuration \"%s\"",
+ registryArgs.getConf);
}
} else {
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=1594905&r1=1594904&r2=1594905&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 15 13:01:28 2014
@@ -28,6 +28,7 @@ import org.apache.slider.api.ClusterNode
import org.apache.slider.client.SliderClient
import org.apache.slider.common.SliderKeys
import org.apache.slider.common.params.ActionRegistryArgs
+import org.apache.slider.core.exceptions.BadCommandArgumentsException
import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
import org.apache.slider.core.main.ServiceLauncher
import org.apache.slider.core.persist.JsonSerDeser
@@ -325,8 +326,15 @@ class TestStandaloneRegistryAM extends A
assert new File(outputDir, yarn_site_config + ".xml").exists()
describe registryArgs.toString()
- registryArgs.getConf = "undefined-file"
- client.actionRegistry(registryArgs)
+
+ def unknownFilename = "undefined-file"
+ registryArgs.getConf = unknownFilename
+ try {
+ client.actionRegistry(registryArgs)
+ fail("attempt to retrieve the file $unknownFilename succeeded")
+ } catch (BadCommandArgumentsException expected) {
+ assert expected.toString().contains(unknownFilename)
+ }
describe "freeze cluster"
Modified: incubator/slider/trunk/src/site/markdown/manpage.md
URL: http://svn.apache.org/viewvc/incubator/slider/trunk/src/site/markdown/manpage.md?rev=1594905&r1=1594904&r2=1594905&view=diff
==============================================================================
--- incubator/slider/trunk/src/site/markdown/manpage.md (original)
+++ incubator/slider/trunk/src/site/markdown/manpage.md Thu May 15 13:01:28 2014
@@ -345,7 +345,10 @@ Example
### `registry (--list | --listconf | --getconf <conf>) [--name <name>] [--servicetype <servicetype>] [--verbose]`
-List registered application instances visible to the user.
+List registered application instances visible to the user. This is slightly
+different from the `slider list` command in that it does not make use of the
+YARN application list. Instead it communicates with Zookeeper -and works
+with any applications which has registered itself with the "service registry"
The `--name <name>` option names the registry entry to work with. For slider applications,
this is the application instance