<commit_before>package org.opennms.netmgt.queued;

import java.util.Set;

import org.opennms.netmgt.capsd.EventUtils;
import org.opennms.netmgt.daemon.AbstractServiceDaemon;
import org.opennms.netmgt.eventd.EventIpcManager;
import org.opennms.netmgt.eventd.EventListener;
import org.opennms.netmgt.rrd.RrdStrategy;
import org.opennms.netmgt.xml.event.Event;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

public class Queued extends AbstractServiceDaemon implements EventListener {
    
    private EventIpcManager m_eventMgr; 
    private RrdStrategy m_rrdStrategy;

    public Queued() {
        super("Queued");
    }
    
    public void setEventIpcManager(EventIpcManager eventMgr) {
        m_eventMgr = eventMgr;
    }
    
    public void setRrdStrategy(RrdStrategy rrdStrategy) {
        m_rrdStrategy = rrdStrategy;
    }
    
    
    @Override
    protected void onInit() {
        Assert.state(m_eventMgr != null, "setEventIpcManager must be set");
        Assert.state(m_rrdStrategy != null, "rrdStrategy must be set");
        
        m_eventMgr.addEventListener(this, "uei.opennms.org/internal/promoteQueueData");
    }

    public void onEvent(Event e) {
        String fileList = EventUtils.getParm(e, "filesToPromote");
        Set<String> files = StringUtils.commaDelimitedListToSet(fileList);
        
        m_rrdStrategy.promoteEnqueuedFiles(files);
    }

}<commit_msg>Add logging messages for file promotion<commit_after>package org.opennms.netmgt.queued;

import java.util.Set;

import org.opennms.netmgt.capsd.EventUtils;
import org.opennms.netmgt.daemon.AbstractServiceDaemon;
import org.opennms.netmgt.eventd.EventIpcManager;
import org.opennms.netmgt.eventd.EventListener;
import org.opennms.netmgt.rrd.RrdStrategy;
import org.opennms.netmgt.xml.event.Event;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

public class Queued extends AbstractServiceDaemon implements EventListener {
    
    private EventIpcManager m_eventMgr; 
    private RrdStrategy m_rrdStrategy;

    public Queued() {
        super("Queued");
    }
    
    public void setEventIpcManager(EventIpcManager eventMgr) {
        m_eventMgr = eventMgr;
    }
    
    public void setRrdStrategy(RrdStrategy rrdStrategy) {
        m_rrdStrategy = rrdStrategy;
    }
    
    
    @Override
    protected void onInit() {
        Assert.state(m_eventMgr != null, "setEventIpcManager must be set");
        Assert.state(m_rrdStrategy != null, "rrdStrategy must be set");
        
        m_eventMgr.addEventListener(this, "uei.opennms.org/internal/promoteQueueData");
    }

    public void onEvent(Event e) {
        String fileList = EventUtils.getParm(e, "filesToPromote");
        Set<String> files = StringUtils.commaDelimitedListToSet(fileList);

        logFilePromotion(files);
        
        m_rrdStrategy.promoteEnqueuedFiles(files);
    }
    
    private void logFilePromotion(Set<String> files) {
        if (!log().isDebugEnabled()) {
            return;
        }
        
        for(String file : files) {
            debugf("Promoting file: %s", file);
        }
    }

    private void debugf(String format, Object... args) {
        if (log().isDebugEnabled()) {
            log().debug(String.format(format, args));
        }
    }

}
{'fraction_non_alphanumeric': 0.09666766736715701, 'fraction_numerical': 0.0, 'mean_word_length': 3.149439601494396, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6648157', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1067, 'n_words': 186}