|
@@ -452,6 +452,8 @@ public class HistoryFileManager extends AbstractService {
|
|
} catch (Throwable t) {
|
|
} catch (Throwable t) {
|
|
LOG.error("Error while trying to move a job to done", t);
|
|
LOG.error("Error while trying to move a job to done", t);
|
|
this.state = HistoryInfoState.MOVE_FAILED;
|
|
this.state = HistoryInfoState.MOVE_FAILED;
|
|
|
|
+ } finally {
|
|
|
|
+ notifyAll();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -485,12 +487,16 @@ public class HistoryFileManager extends AbstractService {
|
|
}
|
|
}
|
|
|
|
|
|
protected synchronized void delete() throws IOException {
|
|
protected synchronized void delete() throws IOException {
|
|
- if (LOG.isDebugEnabled()) {
|
|
|
|
- LOG.debug("deleting " + historyFile + " and " + confFile);
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("deleting " + historyFile + " and " + confFile);
|
|
|
|
+ }
|
|
|
|
+ state = HistoryInfoState.DELETED;
|
|
|
|
+ doneDirFc.delete(doneDirFc.makeQualified(historyFile), false);
|
|
|
|
+ doneDirFc.delete(doneDirFc.makeQualified(confFile), false);
|
|
|
|
+ } finally {
|
|
|
|
+ notifyAll();
|
|
}
|
|
}
|
|
- state = HistoryInfoState.DELETED;
|
|
|
|
- doneDirFc.delete(doneDirFc.makeQualified(historyFile), false);
|
|
|
|
- doneDirFc.delete(doneDirFc.makeQualified(confFile), false);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public JobIndexInfo getJobIndexInfo() {
|
|
public JobIndexInfo getJobIndexInfo() {
|
|
@@ -517,6 +523,17 @@ public class HistoryFileManager extends AbstractService {
|
|
jobIndexInfo.getNumMaps();
|
|
jobIndexInfo.getNumMaps();
|
|
return (maxTasksForLoadedJob > 0) && (totalTasks > maxTasksForLoadedJob);
|
|
return (maxTasksForLoadedJob > 0) && (totalTasks > maxTasksForLoadedJob);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public synchronized void waitUntilMoved() {
|
|
|
|
+ while (isMovePending() && !didMoveFail()) {
|
|
|
|
+ try {
|
|
|
|
+ wait();
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ LOG.warn("Waiting has been interrupted");
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private SerialNumberIndex serialNumberIndex = null;
|
|
private SerialNumberIndex serialNumberIndex = null;
|
|
@@ -956,6 +973,7 @@ public class HistoryFileManager extends AbstractService {
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("Scheduling move to done of " +found);
|
|
LOG.debug("Scheduling move to done of " +found);
|
|
}
|
|
}
|
|
|
|
+
|
|
moveToDoneExecutor.execute(new Runnable() {
|
|
moveToDoneExecutor.execute(new Runnable() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
@@ -1193,5 +1211,5 @@ public class HistoryFileManager extends AbstractService {
|
|
@VisibleForTesting
|
|
@VisibleForTesting
|
|
void setMaxHistoryAge(long newValue){
|
|
void setMaxHistoryAge(long newValue){
|
|
maxHistoryAge=newValue;
|
|
maxHistoryAge=newValue;
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|