You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ji...@apache.org on 2012/10/14 22:15:11 UTC
svn commit: r1398126 - in /incubator/ambari/branches/AMBARI-666: ./
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/
ambari-server/src/main/java/org/apache/ambari/server/controller/
ambari-server/src/test/java/org/apache/ambari/serve...
Author: jitendra
Date: Sun Oct 14 20:15:10 2012
New Revision: 1398126
URL: http://svn.apache.org/viewvc?rev=1398126&view=rev
Log:
AMBARI-860. Remove code that adds fake stages for testing.
Modified:
incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1398126&r1=1398125&r2=1398126&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Sun Oct 14 20:15:10 2012
@@ -12,6 +12,8 @@ AMBARI-666 branch (unreleased changes)
NEW FEATURES
+ AMBARI-860. Remove code that adds fake stages for testing. (jitendra)
+
AMBARI-856. Add cluster heatmap. (yusaku)
AMBARI-855. Create the skeleton for a custom data adapter in Ambari Web.
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java?rev=1398126&r1=1398125&r2=1398126&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java Sun Oct 14 20:15:10 2012
@@ -76,8 +76,8 @@ class ActionScheduler implements Runnabl
public void run() {
while (shouldRun) {
try {
- doWork();
Thread.sleep(sleepTime);
+ doWork();
} catch (InterruptedException ex) {
LOG.warn("Scheduler thread is interrupted going to stop", ex);
shouldRun = false;
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java?rev=1398126&r1=1398125&r2=1398126&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java Sun Oct 14 20:15:10 2012
@@ -226,9 +226,10 @@ public class AmbariServer {
manager.start();
LOG.info("********* Started ActionManager **********");
- RequestInjectorForTest testInjector = new RequestInjectorForTest(controller, clusters);
- Thread testInjectorThread = new Thread(testInjector);
- testInjectorThread.start();
+//TODO: Remove this code when APIs are ready for testing.
+// RequestInjectorForTest testInjector = new RequestInjectorForTest(controller, clusters);
+// Thread testInjectorThread = new Thread(testInjector);
+// testInjectorThread.start();
server.join();
LOG.info("Joined the Server");
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java?rev=1398126&r1=1398125&r2=1398126&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java Sun Oct 14 20:15:10 2012
@@ -69,18 +69,18 @@ public class TestActionScheduler {
//Keep large number of attempts so that the task is not expired finally
//Small action timeout to test rescheduling
- ActionScheduler scheduler = new ActionScheduler(1000, 100, db, aq, fsm, 10000);
+ ActionScheduler scheduler = new ActionScheduler(100, 100, db, aq, fsm, 10000);
// Start the thread
scheduler.start();
- Thread.sleep(1000);
+ Thread.sleep(200);
List<AgentCommand> ac = aq.dequeueAll(hostname);
assertEquals(1, ac.size());
assertTrue(ac.get(0) instanceof ExecutionCommand);
assertEquals("1-977", ((ExecutionCommand) (ac.get(0))).getCommandId());
//The action status has not changed, it should be queued again.
- Thread.sleep(1000);
+ Thread.sleep(200);
ac = aq.dequeueAll(hostname);
assertEquals(1, ac.size());
assertTrue(ac.get(0) instanceof ExecutionCommand);
@@ -91,7 +91,7 @@ public class TestActionScheduler {
ac = aq.dequeueAll(hostname);
//Wait for sometime, it shouldn't be scheduled this time.
- Thread.sleep(1000);
+ Thread.sleep(200);
ac = aq.dequeueAll(hostname);
assertEquals(0, ac.size());
}