/*
 * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package io.siddhi.core.query.selector;

import io.siddhi.core.config.SiddhiQueryContext;
import io.siddhi.core.event.ComplexEvent;
import io.siddhi.core.event.ComplexEventChunk;
import io.siddhi.core.event.state.populater.StateEventPopulator;
import io.siddhi.query.api.execution.query.selection.Selector;
import org.apache.log4j.Logger;

/**
 * Processor implementation representing selector portion of the Siddhi query after table optimisation
 */
public class OptimisedJoinQuerySelector extends QuerySelector {

    private static final Logger log = Logger.getLogger(OptimisedJoinQuerySelector.class);
    private StateEventPopulator eventPopulatorForOptimisedLookup;

    public OptimisedJoinQuerySelector(String id, Selector selector, boolean currentOn, boolean expiredOn,
                                      SiddhiQueryContext siddhiQueryContext) {
        super(id, selector, currentOn, expiredOn, siddhiQueryContext);
    }

    public void processOptimisedQueryEvents(ComplexEventChunk complexEventChunk) {
        if (log.isTraceEnabled()) {
            log.trace("event is processed by selector '" + id + "', "  + complexEventChunk);
        }

        ComplexEventChunk outputComplexEventChunk = processEventChunk(complexEventChunk);

        if (outputComplexEventChunk != null) {
            outputRateLimiter.process(outputComplexEventChunk);
        }
    }

    private ComplexEventChunk processEventChunk(ComplexEventChunk complexEventChunk) {
        complexEventChunk.reset();
        synchronized (this) {
            while (complexEventChunk.hasNext()) {
                ComplexEvent event = complexEventChunk.next();
                eventPopulatorForOptimisedLookup.populateStateEvent(event);
            }
        }
        complexEventChunk.reset();
        if (complexEventChunk.hasNext()) {
            return complexEventChunk;
        }
        return null;
    }

    public void setEventPopulatorForOptimisedLookup(StateEventPopulator eventPopulatorForOptimisedLookup) {
        this.eventPopulatorForOptimisedLookup = eventPopulatorForOptimisedLookup;
    }

}

@@ -976,40 +976,8 @@
 tor;
-%0Aimport org.apache.log4j.Logger;
 %0A%0A/*
@@ -1154,98 +1154,8 @@
  %7B%0A%0A
-    private static final Logger log = Logger.getLogger(OptimisedJoinQuerySelector.class);%0A
     
@@ -1472,32 +1472,32 @@
 ontext);%0A    %7D%0A%0A
+
     public void 
@@ -1566,147 +1566,8 @@
 k) %7B
-%0A        if (log.isTraceEnabled()) %7B%0A            log.trace(%22event is processed by selector '%22 + id + %22', %22  + complexEventChunk);%0A        %7D
 %0A%0A  

Remove trace log