mirror of https://github.com/apache/druid.git
address cr
This commit is contained in:
parent
b313601a3b
commit
2aab2a0cd9
|
@ -38,7 +38,7 @@ public class SegmentLoaderConfig
|
|||
private boolean deleteOnRemove = true;
|
||||
|
||||
@JsonProperty("dropSegmentDelayMillis")
|
||||
private int dropSegmentDelayMillis = 0;
|
||||
private int dropSegmentDelayMillis = 5 * 60 * 1000; // 5 mins
|
||||
|
||||
@JsonProperty
|
||||
private File infoDir = null;
|
||||
|
|
|
@ -233,7 +233,7 @@ public class ZkCoordinator extends BaseZkCoordinator
|
|||
|
||||
|
||||
@Override
|
||||
public void removeSegment(final DataSegment segment, DataSegmentChangeCallback callback)
|
||||
public void removeSegment(final DataSegment segment, final DataSegmentChangeCallback callback)
|
||||
{
|
||||
try {
|
||||
File segmentInfoCacheFile = new File(config.getInfoDir(), segment.getIdentifier());
|
||||
|
@ -243,6 +243,7 @@ public class ZkCoordinator extends BaseZkCoordinator
|
|||
|
||||
announcer.unannounceSegment(segment);
|
||||
|
||||
log.info("Completely removing [%s] in [%,d] millis", segment.getIdentifier(), config.getDropSegmentDelayMillis());
|
||||
exec.schedule(
|
||||
new Runnable()
|
||||
{
|
||||
|
@ -253,6 +254,9 @@ public class ZkCoordinator extends BaseZkCoordinator
|
|||
serverManager.dropSegment(segment);
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.makeAlert(e, "Failed to remove segment! Possible resource leak!")
|
||||
.addData("segment", segment)
|
||||
.emit();
|
||||
throw Throwables.propagate(e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue