Empty object returned by the asProperties method of class StormSetting


(Hibernatexj) #1

Hi ,
The code of asProperties method of class StormSettings in elasticsearch-hadoop-2.2.0 seems has bug (Please see the following code), I guest the purpose of this method is copy the items in Map cfg to temporary object props and returned it. so in this loop , the code "props.entrySet()" should be replaced as "cfg.entrySet()" . now this method always return empty collection.
---------------- CODE -----------------------
@Override
public Properties asProperties() {
Properties props = new Properties();

    if (cfg != null) {
        for (Entry<Object, Object> entry : props.entrySet()) {
            if (entry.getKey() instanceof String) {
                props.put(entry.getKey().toString(), entry.getValue().toString());
            }
        }
    }
    return props;
}

(Costin Leau) #2

Thanks.

Raised an issue for it:


and pushed a fix in master.

Cheers,


(system) #3