update fix

This commit is contained in:
Fangjin Yang 2013-04-12 22:12:22 -07:00
parent a24274029f
commit bacb1e5520
1 changed files with 6 additions and 7 deletions

View File

@ -118,12 +118,6 @@ public class RealtimeIndexTask extends AbstractTask
@Override @Override
public TaskStatus run(final TaskToolbox toolbox) throws Exception public TaskStatus run(final TaskToolbox toolbox) throws Exception
{ {
synchronized (lock) {
if (shutdown) {
return TaskStatus.success(getId());
}
}
if (this.plumber != null) { if (this.plumber != null) {
throw new IllegalStateException("WTF?!? run with non-null plumber??!"); throw new IllegalStateException("WTF?!? run with non-null plumber??!");
} }
@ -139,7 +133,12 @@ public class RealtimeIndexTask extends AbstractTask
final FireDepartmentMetrics metrics = new FireDepartmentMetrics(); final FireDepartmentMetrics metrics = new FireDepartmentMetrics();
final Period intermediatePersistPeriod = fireDepartmentConfig.getIntermediatePersistPeriod(); final Period intermediatePersistPeriod = fireDepartmentConfig.getIntermediatePersistPeriod();
firehose = new GracefulShutdownFirehose(firehoseFactory.connect(), segmentGranularity, windowPeriod); synchronized (lock) {
if (shutdown) {
return TaskStatus.success(getId());
}
firehose = new GracefulShutdownFirehose(firehoseFactory.connect(), segmentGranularity, windowPeriod);
}
// TODO -- Take PlumberSchool in constructor (although that will need jackson injectables for stuff like // TODO -- Take PlumberSchool in constructor (although that will need jackson injectables for stuff like
// TODO -- the ServerView, which seems kind of odd?) // TODO -- the ServerView, which seems kind of odd?)