more logging

This commit is contained in:
Fangjin Yang 2013-03-01 16:53:49 -08:00
parent 360c6a1df1
commit 53021c2e35
4 changed files with 11 additions and 5 deletions

View File

@ -414,8 +414,9 @@ public class RemoteTaskRunner implements TaskRunner
@Override
public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
{
try {
log.info("Event[%s]: %s", event.getType(), event.getData().getPath());
if (event.getType().equals(PathChildrenCacheEvent.Type.CHILD_ADDED) ||
event.getType().equals(PathChildrenCacheEvent.Type.CHILD_UPDATED)) {
final String taskId = ZKPaths.getNodeFromPath(event.getData().getPath());

View File

@ -100,6 +100,7 @@ public class TaskMasterLifecycle
leaderLifecycle.addManagedInstance(taskRunner);
Initialization.makeServiceDiscoveryClient(curator, serviceDiscoveryConfig, leaderLifecycle);
leaderLifecycle.addManagedInstance(taskConsumer);
leaderLifecycle.addManagedInstance(scheduler);
leading = true;

View File

@ -71,6 +71,8 @@ public class ResourceManagementScheduler
return;
}
log.info("Started Resource Management Scheduler");
ScheduledExecutors.scheduleAtFixedRate(
exec,
config.getProvisionResourcesDuration(),
@ -79,6 +81,7 @@ public class ResourceManagementScheduler
@Override
public void run()
{
log.info("Running resource management strategy");
resourceManagementStrategy.doProvision(
taskRunner.getPendingTasks(),
taskRunner.getWorkers()
@ -123,6 +126,7 @@ public class ResourceManagementScheduler
if (!started) {
return;
}
log.info("Stopping Resource Management Scheduler");
exec.shutdown();
started = false;
}

View File

@ -115,22 +115,22 @@
<dependency>
<groupId>com.netflix.curator</groupId>
<artifactId>curator-client</artifactId>
<version>1.2.2</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.netflix.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>1.2.2</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.netflix.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>1.2.2</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.netflix.curator</groupId>
<artifactId>curator-x-discovery</artifactId>
<version>1.2.2</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.netflix.curator</groupId>