more logs

This commit is contained in:
Fangjin Yang 2013-03-19 18:18:20 -07:00
parent 9cdfea31b2
commit 424e899760
2 changed files with 10 additions and 7 deletions

View File

@ -63,7 +63,7 @@ public class GracefulShutdownFirehose implements Firehose
final long end = segmentGranularity.increment(truncatedNow) + windowMillis; final long end = segmentGranularity.increment(truncatedNow) + windowMillis;
final Duration timeUntilShutdown = new Duration(System.currentTimeMillis(), end); final Duration timeUntilShutdown = new Duration(System.currentTimeMillis(), end);
log.info("Shutting down in %s", timeUntilShutdown); log.info("Shutting down in %s. Time at shutdown: ~%s", timeUntilShutdown, new DateTime(end));
ScheduledExecutors.scheduleWithFixedDelay( ScheduledExecutors.scheduleWithFixedDelay(
scheduledExecutor, scheduledExecutor,

View File

@ -308,23 +308,25 @@ public class RealtimePlumberSchool implements PlumberSchool
while (!sinks.isEmpty()) { while (!sinks.isEmpty()) {
try { try {
Duration retry = new Duration("PT60S");
log.info( log.info(
"Cannot shut down yet! Sinks for %s remain!", "Cannot shut down yet! Sinks for %s remain! Next retry in %s",
Joiner.on(", ").join( Joiner.on(", ").join(
Iterables.transform( Iterables.transform(
sinks.values(), sinks.values(),
new Function<Sink, DataSegment>() new Function<Sink, String>()
{ {
@Override @Override
public DataSegment apply(Sink input) public String apply(Sink input)
{ {
return input.getSegment(); return input.getSegment().getIdentifier();
} }
} }
) )
) ),
retry
); );
Thread.sleep(60000); Thread.sleep(retry.getMillis());
} }
catch (InterruptedException e) { catch (InterruptedException e) {
throw Throwables.propagate(e); throw Throwables.propagate(e);
@ -455,6 +457,7 @@ public class RealtimePlumberSchool implements PlumberSchool
try { try {
segmentAnnouncer.unannounceSegment(sink.getSegment()); segmentAnnouncer.unannounceSegment(sink.getSegment());
FileUtils.deleteDirectory(computePersistDir(schema, sink.getInterval())); FileUtils.deleteDirectory(computePersistDir(schema, sink.getInterval()));
log.info("Removing sinkKey %d for segment %s", sinkKey, sink.getSegment().getIdentifier());
sinks.remove(sinkKey); sinks.remove(sinkKey);
} }
catch (IOException e) { catch (IOException e) {