Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
commenting unused methods after making EventReceivers singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
Isuru Haththotuwa committed Dec 24, 2015
1 parent 933be1a commit 617258b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,12 @@ public class AutoscalerHealthStatEventReceiver {
private static final Log log = LogFactory.getLog(AutoscalerHealthStatEventReceiver.class);

private HealthStatEventReceiver healthStatEventReceiver;
<<<<<<< HEAD
private ExecutorService executorService;
=======
>>>>>>> d4b35c0... removing unused methods

public AutoscalerHealthStatEventReceiver() {
this.healthStatEventReceiver = HealthStatEventReceiver.getInstance();
addEventListeners();
}

<<<<<<< HEAD
// public void execute() {
// healthStatEventReceiver.setExecutorService(executorService);
// healthStatEventReceiver.execute();
//
// if (log.isInfoEnabled()) {
// log.info("Autoscaler health stat event receiver thread started");
// }
// }

=======
>>>>>>> d4b35c0... removing unused methods
private void addEventListeners() {
// Listen to health stat events that affect clusters
healthStatEventReceiver.addEventListener(new AverageLoadAverageEventListener() {
Expand Down Expand Up @@ -480,19 +464,4 @@ private Member getMemberByMemberId(String memberId) {
TopologyManager.releaseReadLock();
}
}
<<<<<<< HEAD

public void terminate() {
this.terminated = true;
}

public ExecutorService getExecutorService() {
return executorService;
}

public void setExecutorService(ExecutorService executorService) {
this.executorService = executorService;
}
=======
>>>>>>> d4b35c0... removing unused methods
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,47 +193,27 @@ private void executeCoordinatorTasks(ComponentContext componentContext)

private void initializeInitializerEventReceiver() {
initializerTopicReceiver = new StratosManagerInitializerTopicReceiver();
<<<<<<< HEAD
// initializerTopicReceiver.setExecutorService(executorService);
// initializerTopicReceiver.execute();
=======
>>>>>>> d4b35c0... removing unused methods
}

/**
* Initialize instance status event receiver
*/
private void initializeInstanceStatusEventReceiver() {
instanceStatusEventReceiver = new StratosManagerInstanceStatusEventReceiver();
<<<<<<< HEAD
// instanceStatusEventReceiver.setExecutorService(executorService);
// instanceStatusEventReceiver.execute();
=======
>>>>>>> d4b35c0... removing unused methods
}

/**
* Initialize topology event receiver
*/
private void initializeTopologyEventReceiver() {
topologyEventReceiver = new StratosManagerTopologyEventReceiver();
<<<<<<< HEAD
// topologyEventReceiver.setExecutorService(executorService);
// topologyEventReceiver.execute();
=======
>>>>>>> d4b35c0... removing unused methods
}

/**
* Initialize application event receiver
*/
private void initializeApplicationEventReceiver() {
applicationEventReceiver = new StratosManagerApplicationEventReceiver();
<<<<<<< HEAD
// applicationEventReceiver.setExecutorService(executorService);
// applicationEventReceiver.execute();
=======
>>>>>>> d4b35c0... removing unused methods
}

/**
Expand Down Expand Up @@ -348,34 +328,5 @@ protected void deactivate(ComponentContext context) {
// Close event publisher connections to message broker
EventPublisherPool.close(MessagingUtil.Topics.INSTANCE_NOTIFIER_TOPIC.getTopicName());
EventPublisherPool.close(MessagingUtil.Topics.TENANT_TOPIC.getTopicName());
<<<<<<< HEAD

shutdownExecutorService(THREAD_POOL_ID);
shutdownScheduledExecutorService(SCHEDULER_THREAD_POOL_ID);
}

private void shutdownExecutorService(String executorServiceId) {
ExecutorService executorService = StratosThreadPool.getExecutorService(executorServiceId, 1);
if (executorService != null) {
shutdownExecutorService(executorService);
}
}

private void shutdownScheduledExecutorService(String executorServiceId) {
ExecutorService executorService = StratosThreadPool.getScheduledExecutorService(executorServiceId, 1);
if (executorService != null) {
shutdownExecutorService(executorService);
}
}

private void shutdownExecutorService(ExecutorService executorService) {
try {
executorService.shutdownNow();
} catch (Exception e) {
log.warn("An error occurred while shutting down executor service", e);
}
}
=======
}
>>>>>>> d4b35c0... removing unused methods
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ public class InstanceStatusEventReceiver extends StratosEventReceiver {

private InstanceStatusEventReceiver() {
// TODO: make pool size configurable
<<<<<<< HEAD
this.executorService = StratosThreadPool.getExecutorService("topology-event-receiver", 100);
=======
this.executor = StratosThreadPool.getExecutorService("messaging-event-receiver", 35, 150);
>>>>>>> d4b35c0... removing unused methods
InstanceStatusEventMessageQueue messageQueue = new InstanceStatusEventMessageQueue();
this.messageDelegator = new InstanceStatusEventMessageDelegator(messageQueue);
this.messageListener = new InstanceStatusEventMessageListener(messageQueue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,4 @@ public void run() {
}
});
}

// public ExecutorService getExecutorService() {
// return executorService;
// }
//
// public void setExecutorService(ExecutorService executorService) {
// this.executorService = executorService;
// }
}

0 comments on commit 617258b

Please sign in to comment.