Skip to content

Commit

Permalink
update fix which was created multiple active coord
Browse files Browse the repository at this point in the history
  • Loading branch information
Shwetha GS committed Mar 28, 2013
1 parent 2d0289e commit 290b17c
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -171,6 +171,7 @@ private boolean isBundleInState(Entity entity, BundleStatus status)
private BundleJob findBundle(Entity entity, String cluster) private BundleJob findBundle(Entity entity, String cluster)
throws IvoryException { throws IvoryException {
String stPath = EntityUtil.getStagingPath(entity); String stPath = EntityUtil.getStagingPath(entity);
LOG.info("Staging path for entity " + stPath);
List<BundleJob> bundles = findBundles(entity, cluster); List<BundleJob> bundles = findBundles(entity, cluster);
for (BundleJob job : bundles) { for (BundleJob job : bundles) {
if (job.getAppPath().endsWith(stPath)) { if (job.getAppPath().endsWith(stPath)) {
Expand All @@ -190,8 +191,10 @@ private List<BundleJob> findBundles(Entity entity, String cluster)
if (jobs != null) { if (jobs != null) {
List<BundleJob> filteredJobs = new ArrayList<BundleJob>(); List<BundleJob> filteredJobs = new ArrayList<BundleJob>();
for(BundleJob job : jobs) for(BundleJob job : jobs)
if(job.getStatus() != Job.Status.KILLED || job.getEndTime() == null) if(job.getStatus() != Job.Status.KILLED || job.getEndTime() == null) {
filteredJobs.add(job); filteredJobs.add(job);
LOG.debug("Found bundle " + job.getId());
}
return filteredJobs; return filteredJobs;
} }
return new ArrayList<BundleJob>(); return new ArrayList<BundleJob>();
Expand All @@ -204,7 +207,6 @@ private Map<String, List<BundleJob>> findBundles(Entity entity)
throws IvoryException { throws IvoryException {
Set<String> clusters = EntityUtil.getClustersDefinedInColos(entity); Set<String> clusters = EntityUtil.getClustersDefinedInColos(entity);
Map<String, List<BundleJob>> jobMap = new HashMap<String, List<BundleJob>>(); Map<String, List<BundleJob>> jobMap = new HashMap<String, List<BundleJob>>();

for (String cluster : clusters) { for (String cluster : clusters) {
jobMap.put(cluster, findBundles(entity, cluster)); jobMap.put(cluster, findBundles(entity, cluster));
} }
Expand Down Expand Up @@ -885,6 +887,7 @@ private void updateCoords(String cluster, String bundleId, int concurrency,


private void suspend(String cluster, BundleJob bundle) private void suspend(String cluster, BundleJob bundle)
throws IvoryException { throws IvoryException {
bundle = getBundleInfo(cluster, bundle.getId());
for (CoordinatorJob coord : bundle.getCoordinators()) { for (CoordinatorJob coord : bundle.getCoordinators()) {
suspend(cluster, coord.getId()); suspend(cluster, coord.getId());
} }
Expand Down

0 comments on commit 290b17c

Please sign in to comment.