Ryan Persaud created STORM-2509:
-----------------------------------

             Summary: Writers in AbstractHDFSBolt are not closed/rotated when 
evicted from WritersMap
                 Key: STORM-2509
                 URL: https://issues.apache.org/jira/browse/STORM-2509
             Project: Apache Storm
          Issue Type: Bug
          Components: storm-hdfs
    Affects Versions: 1.1.0
            Reporter: Ryan Persaud
            Priority: Minor


When the eldest entry in the WritersMap in the AbstractHDFSBolt gets removed 
due to the number of writers exceeding maxWriters (see below), the writer is 
not closed and rotation actions are not executed (doRotationAndRemoveWriter is 
not called).

static class WritersMap extends LinkedHashMap<String, AbstractHDFSWriter> {
    final long maxWriters;

    public WritersMap(long maxWriters) {
        super((int)maxWriters, 0.75f, true);
        this.maxWriters = maxWriters;
    }

    @Override
    protected boolean removeEldestEntry(Map.Entry<String, AbstractHDFSWriter> 
eldest) {
        return this.size() > this.maxWriters;
    }
}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to