You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@twill.apache.org by ch...@apache.org on 2016/12/14 04:06:28 UTC
[1/2] twill git commit: Remove unnecessary methods to get the root
log level
Repository: twill
Updated Branches:
refs/heads/branch-0.9.0 [created] 960784bb2
Remove unnecessary methods to get the root log level
This closes #20 on Github.
Signed-off-by: Terence Yim <ch...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/twill/repo
Commit: http://git-wip-us.apache.org/repos/asf/twill/commit/b1998cc6
Tree: http://git-wip-us.apache.org/repos/asf/twill/tree/b1998cc6
Diff: http://git-wip-us.apache.org/repos/asf/twill/diff/b1998cc6
Branch: refs/heads/branch-0.9.0
Commit: b1998cc6b26dcdf9efa58fccc55f3b6a20c98777
Parents: 13885f1
Author: yaojiefeng <ya...@cask.co>
Authored: Tue Dec 13 18:58:36 2016 -0800
Committer: Terence Yim <ch...@apache.org>
Committed: Tue Dec 13 20:05:01 2016 -0800
----------------------------------------------------------------------
.../main/java/org/apache/twill/internal/ServiceMain.java | 4 ++--
.../twill/internal/container/TwillContainerMain.java | 11 ++---------
.../org/apache/twill/yarn/LogLevelChangeTestRun.java | 9 +++------
3 files changed, 7 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/twill/blob/b1998cc6/twill-yarn/src/main/java/org/apache/twill/internal/ServiceMain.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/main/java/org/apache/twill/internal/ServiceMain.java b/twill-yarn/src/main/java/org/apache/twill/internal/ServiceMain.java
index 7e858ec..5065d07 100644
--- a/twill-yarn/src/main/java/org/apache/twill/internal/ServiceMain.java
+++ b/twill-yarn/src/main/java/org/apache/twill/internal/ServiceMain.java
@@ -233,12 +233,12 @@ public abstract class ServiceMain {
}
/**
- * Override to return the right log level for the service.
+ * Return the right log level for the service.
*
* @param logger the {@link Logger} instance of the service context.
* @return String of log level based on {@code slf4j} log levels.
*/
- protected String getLoggerLevel(Logger logger) {
+ private String getLoggerLevel(Logger logger) {
if (logger instanceof ch.qos.logback.classic.Logger) {
return ((ch.qos.logback.classic.Logger) logger).getLevel().toString();
}
http://git-wip-us.apache.org/repos/asf/twill/blob/b1998cc6/twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerMain.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerMain.java b/twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerMain.java
index 807e50f..1f8d689 100644
--- a/twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerMain.java
+++ b/twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerMain.java
@@ -65,8 +65,6 @@ public final class TwillContainerMain extends ServiceMain {
private static final Logger LOG = LoggerFactory.getLogger(TwillContainerMain.class);
- private final Map<String, String> logLevels = new HashMap<>();
-
/**
* Main method for launching a {@link TwillContainerService} which runs
* a {@link org.apache.twill.api.TwillRunnable}.
@@ -89,6 +87,7 @@ public final class TwillContainerMain extends ServiceMain {
Map<String, String> defaultLogLevels = twillRuntimeSpec.getLogLevels().get(runnableName);
Map<String, String> dynamicLogLevels = loadLogLevels().get(runnableName);
+ Map<String, String> logLevels = new HashMap<>();
logLevels.putAll(defaultLogLevels);
if (dynamicLogLevels != null) {
logLevels.putAll(dynamicLogLevels);
@@ -98,7 +97,7 @@ public final class TwillContainerMain extends ServiceMain {
ZKDiscoveryService discoveryService = new ZKDiscoveryService(zkClientService);
ZKClient appRunZkClient = getAppRunZKClient(zkClientService, appRunId);
-
+
TwillRunnableSpecification runnableSpec =
twillRuntimeSpec.getTwillSpecification().getRunnables().get(runnableName).getRunnableSpecification();
ContainerInfo containerInfo = new EnvContainerInfo();
@@ -127,12 +126,6 @@ public final class TwillContainerMain extends ServiceMain {
);
}
- @Override
- protected String getLoggerLevel(Logger logger) {
- String logLevel = logLevels.get(Logger.ROOT_LOGGER_NAME);
- return logLevel == null ? super.getLoggerLevel(logger) : logLevel;
- }
-
private static void loadSecureStore() throws IOException {
if (!UserGroupInformation.isSecurityEnabled()) {
return;
http://git-wip-us.apache.org/repos/asf/twill/blob/b1998cc6/twill-yarn/src/test/java/org/apache/twill/yarn/LogLevelChangeTestRun.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/test/java/org/apache/twill/yarn/LogLevelChangeTestRun.java b/twill-yarn/src/test/java/org/apache/twill/yarn/LogLevelChangeTestRun.java
index 94b4125..6df6d11 100644
--- a/twill-yarn/src/test/java/org/apache/twill/yarn/LogLevelChangeTestRun.java
+++ b/twill-yarn/src/test/java/org/apache/twill/yarn/LogLevelChangeTestRun.java
@@ -102,9 +102,6 @@ public class LogLevelChangeTestRun extends BaseYarnTest {
public void run() {
this.runThread = Thread.currentThread();
- // check if the initial log level is DEBUG
- Assert.assertTrue(LOG.isDebugEnabled() && !LOG.isTraceEnabled());
-
int i = 0;
while (!Thread.interrupted()) {
if (i == 0 && !LOG.isDebugEnabled()) {
@@ -223,15 +220,15 @@ public class LogLevelChangeTestRun extends BaseYarnTest {
waitForLogLevel(controller, LogLevelTestRunnable.class.getSimpleName(),
20L, TimeUnit.SECONDS, LogEntry.Level.WARN, result);
- // change the log level of LogLevelTestSecondRunnable to DEBUG and change instances of it to test if the log level
+ // change the log level of LogLevelTestSecondRunnable to INFO and change instances of it to test if the log level
// request get applied to container started up later
- logLevelSecondRunnable = ImmutableMap.of(Logger.ROOT_LOGGER_NAME, LogEntry.Level.DEBUG, "test",
+ logLevelSecondRunnable = ImmutableMap.of(Logger.ROOT_LOGGER_NAME, LogEntry.Level.INFO, "test",
LogEntry.Level.WARN);
controller.updateLogLevels(LogLevelTestSecondRunnable.class.getSimpleName(), logLevelSecondRunnable).get();
controller.changeInstances(LogLevelTestSecondRunnable.class.getSimpleName(), 2).get();
TimeUnit.SECONDS.sleep(5);
waitForLogLevel(controller, LogLevelTestSecondRunnable.class.getSimpleName(), 20L, TimeUnit.SECONDS,
- LogEntry.Level.DEBUG, logLevelSecondRunnable);
+ LogEntry.Level.INFO, logLevelSecondRunnable);
// reset the log levels back to default.
controller.resetLogLevels().get();
[2/2] twill git commit: Prepare for releasing 0.9.0
Posted by ch...@apache.org.
Prepare for releasing 0.9.0
Project: http://git-wip-us.apache.org/repos/asf/twill/repo
Commit: http://git-wip-us.apache.org/repos/asf/twill/commit/960784bb
Tree: http://git-wip-us.apache.org/repos/asf/twill/tree/960784bb
Diff: http://git-wip-us.apache.org/repos/asf/twill/diff/960784bb
Branch: refs/heads/branch-0.9.0
Commit: 960784bb2f8b4ecda37b95eaf662aa53acfc2ca1
Parents: b1998cc
Author: Terence Yim <ch...@apache.org>
Authored: Tue Dec 13 20:06:07 2016 -0800
Committer: Terence Yim <ch...@apache.org>
Committed: Tue Dec 13 20:06:07 2016 -0800
----------------------------------------------------------------------
pom.xml | 2 +-
twill-api/pom.xml | 2 +-
twill-common/pom.xml | 2 +-
twill-core/pom.xml | 2 +-
twill-discovery-api/pom.xml | 2 +-
twill-discovery-core/pom.xml | 2 +-
twill-examples/echo/pom.xml | 2 +-
twill-examples/pom.xml | 2 +-
twill-examples/yarn/pom.xml | 2 +-
twill-ext/pom.xml | 2 +-
twill-java8-test/pom.xml | 2 +-
twill-yarn/pom.xml | 2 +-
twill-zookeeper/pom.xml | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 77154b6..1e981f0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
<groupId>org.apache.twill</groupId>
<artifactId>twill-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
<packaging>pom</packaging>
<name>Apache Twill</name>
<url>http://twill.apache.org</url>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-api/pom.xml
----------------------------------------------------------------------
diff --git a/twill-api/pom.xml b/twill-api/pom.xml
index f981bae..c22ebee 100644
--- a/twill-api/pom.xml
+++ b/twill-api/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.twill</groupId>
<artifactId>twill-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<artifactId>twill-api</artifactId>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-common/pom.xml
----------------------------------------------------------------------
diff --git a/twill-common/pom.xml b/twill-common/pom.xml
index a29ea75..da75490 100644
--- a/twill-common/pom.xml
+++ b/twill-common/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-core/pom.xml
----------------------------------------------------------------------
diff --git a/twill-core/pom.xml b/twill-core/pom.xml
index 93327e2..7958e78 100644
--- a/twill-core/pom.xml
+++ b/twill-core/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-discovery-api/pom.xml
----------------------------------------------------------------------
diff --git a/twill-discovery-api/pom.xml b/twill-discovery-api/pom.xml
index 3d4dcbd..1725169 100644
--- a/twill-discovery-api/pom.xml
+++ b/twill-discovery-api/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-discovery-core/pom.xml
----------------------------------------------------------------------
diff --git a/twill-discovery-core/pom.xml b/twill-discovery-core/pom.xml
index 859ec0a..36e460d 100644
--- a/twill-discovery-core/pom.xml
+++ b/twill-discovery-core/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-examples/echo/pom.xml
----------------------------------------------------------------------
diff --git a/twill-examples/echo/pom.xml b/twill-examples/echo/pom.xml
index 87d3d55..b6cf7cd 100644
--- a/twill-examples/echo/pom.xml
+++ b/twill-examples/echo/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
<parent>
<artifactId>twill-examples</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<name>Apache Twill examples: Echo</name>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-examples/pom.xml
----------------------------------------------------------------------
diff --git a/twill-examples/pom.xml b/twill-examples/pom.xml
index 90c8dcd..3944502 100644
--- a/twill-examples/pom.xml
+++ b/twill-examples/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
<parent>
<groupId>org.apache.twill</groupId>
<artifactId>twill-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<artifactId>twill-examples</artifactId>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-examples/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/twill-examples/yarn/pom.xml b/twill-examples/yarn/pom.xml
index b19e4d2..62810fe 100644
--- a/twill-examples/yarn/pom.xml
+++ b/twill-examples/yarn/pom.xml
@@ -24,7 +24,7 @@ limitations under the License.
<parent>
<artifactId>twill-examples</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<name>Apache Twill examples: YARN</name>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-ext/pom.xml
----------------------------------------------------------------------
diff --git a/twill-ext/pom.xml b/twill-ext/pom.xml
index a5265b1..e98f9c6 100644
--- a/twill-ext/pom.xml
+++ b/twill-ext/pom.xml
@@ -22,7 +22,7 @@ limitations under the License.
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-java8-test/pom.xml
----------------------------------------------------------------------
diff --git a/twill-java8-test/pom.xml b/twill-java8-test/pom.xml
index a47ddcc..7a1db81 100644
--- a/twill-java8-test/pom.xml
+++ b/twill-java8-test/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.twill</groupId>
<artifactId>twill-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<artifactId>twill-java8-test</artifactId>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-yarn/pom.xml
----------------------------------------------------------------------
diff --git a/twill-yarn/pom.xml b/twill-yarn/pom.xml
index 5039617..2b7c55e 100644
--- a/twill-yarn/pom.xml
+++ b/twill-yarn/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/twill/blob/960784bb/twill-zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/twill-zookeeper/pom.xml b/twill-zookeeper/pom.xml
index d264a44..4682604 100644
--- a/twill-zookeeper/pom.xml
+++ b/twill-zookeeper/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>twill-parent</artifactId>
<groupId>org.apache.twill</groupId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>