// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestEvent.java
// public class RequestEvent implements Event {
// 
//     private final Request request;
// 
//     public RequestEvent(Request request) {
//        this.request = request;
//     }
// 
//     @Override
//     public long getTimestamp() {
//         return request.getTimestamp();
//     }
// 
//     public int getUserId() {
//         return request.getUserId();
//     }
// 
//     public int getClientIp() {
//         return request.getClientIp();
//     }
// 
//     public int getServerIp() {
//         return request.getServerIp();
//     }
// 
//     public OperationType getOperationType() {
//         return request.getOperationType();
//     }
// 
//     public Protocol getProtocol() {
//         return request.getProtocol();
//     }
// 
//     public int getResponseCode() {
//         return request.getResponseCode();
//     }
// 
//     public String getUri() {
//         return request.getUri();
//     }
// 
//     public int getRequestBytes() {
//         return request.getRequestBytes();
//     }
// 
//     public int getResponseBytes() {
//         return request.getResponseBytes();
//     }
// 
//     public long getHandshakeUsec() {
//         return request.getHandshakeUsec();
//     }
// 
//     public long getUsecToFirstByte() {
//         return request.getUsecToFirstByte();
//     }
// 
//     public long getUsecTotal() {
//         return request.getUsecTotal();
//     }
// 
//     public String getUserAgent() {
//         return request.getUserAgent();
//     }
// 
//     public String getLocale() {
//         return request.getLocale();
//     }
// 
//     public String getReferrer() {
//         return request.getReferrer();
//     }
// 
//     @Override
//     public String toString() {
//         return request.toString();
//     }
// 
// }
// 
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java
// public interface ConcurrentRollup<Input> extends Event {
// 
//     /**
//      * <p>Rollup method called as events are received by a stream for
//      * aggregation.</p>
//      *
//      * <p>Implementations of ConcurrentRollup should accept {@link Event}s, maintain
//      * the aggregations desired (sums, averages, histograms, and so on), and expose
//      * them for downstream {@link OutputListener}s to access as output. See the
//      * {@link ConcurrentRollup} documentation above for a sample implementation.</p>
//      *
//      * @param input An event received by a stream to be rolled up.
//      */
//     public abstract void rollup(Input input);
// 
//     public long getTimestamp();
// }
// 
// Path: src/main/java/com/cscotta/deschutes/api/OutputListener.java
// public interface OutputListener<Input> {
// 
//     public void update(List<Long> remove,
//                        Map<Long, Map<String, ConcurrentRollup<Input>>> insert);
// 
// }
// 
// Path: src/main/java/com/cscotta/deschutes/json/Json.java
// public class Json {
//     public final ObjectMapper objectMapper = new ObjectMapper();
// 
//     public Json() {
//         SimpleModule olapMods = new SimpleModule("olapMods", new Version(1,0,0,null));
//         olapMods.addSerializer(new HistogramSnapshotSerializer());
//         objectMapper.registerModule(olapMods);
//     }
// 
// }


import java.util.List;
import java.util.Map;
import com.cscotta.deschutes.example.requests.RequestEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cscotta.deschutes.api.ConcurrentRollup;
import com.cscotta.deschutes.api.OutputListener;
import com.cscotta.deschutes.json.Json;
import org.codehaus.jackson.map.ObjectMapper;
package com.cscotta.deschutes.json;




public class LoggedRollupListener implements OutputListener<RequestEvent> {

    private final ObjectMapper jackson = new Json().objectMapper;
    private static final Logger log = LoggerFactory.getLogger(LoggedRollupListener.class);

    @Override
    public void update(List<Long> remove, Map<Long, Map<String, ConcurrentRollup<RequestEvent>>> insert) {
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestEvent.java
// public class RequestEvent implements Event {
// 
//     private final Request request;
// 
//     public RequestEvent(Request request) {
//        this.request = request;
//     }
// 
//     @Override
//     public long getTimestamp() {
//         return request.getTimestamp();
//     }
// 
//     public int getUserId() {
//         return request.getUserId();
//     }
// 
//     public int getClientIp() {
//         return request.getClientIp();
//     }
// 
//     public int getServerIp() {
//         return request.getServerIp();
//     }
// 
//     public OperationType getOperationType() {
//         return request.getOperationType();
//     }
// 
//     public Protocol getProtocol() {
//         return request.getProtocol();
//     }
// 
//     public int getResponseCode() {
//         return request.getResponseCode();
//     }
// 
//     public String getUri() {
//         return request.getUri();
//     }
// 
//     public int getRequestBytes() {
//         return request.getRequestBytes();
//     }
// 
//     public int getResponseBytes() {
//         return request.getResponseBytes();
//     }
// 
//     public long getHandshakeUsec() {
//         return request.getHandshakeUsec();
//     }
// 
//     public long getUsecToFirstByte() {
//         return request.getUsecToFirstByte();
//     }
// 
//     public long getUsecTotal() {
//         return request.getUsecTotal();
//     }
// 
//     public String getUserAgent() {
//         return request.getUserAgent();
//     }
// 
//     public String getLocale() {
//         return request.getLocale();
//     }
// 
//     public String getReferrer() {
//         return request.getReferrer();
//     }
// 
//     @Override
//     public String toString() {
//         return request.toString();
//     }
// 
// }
// 
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java
// public interface ConcurrentRollup<Input> extends Event {
// 
//     /**
//      * <p>Rollup method called as events are received by a stream for
//      * aggregation.</p>
//      *
//      * <p>Implementations of ConcurrentRollup should accept {@link Event}s, maintain
//      * the aggregations desired (sums, averages, histograms, and so on), and expose
//      * them for downstream {@link OutputListener}s to access as output. See the
//      * {@link ConcurrentRollup} documentation above for a sample implementation.</p>
//      *
//      * @param input An event received by a stream to be rolled up.
//      */
//     public abstract void rollup(Input input);
// 
//     public long getTimestamp();
// }
// 
// Path: src/main/java/com/cscotta/deschutes/api/OutputListener.java
// public interface OutputListener<Input> {
// 
//     public void update(List<Long> remove,
//                        Map<Long, Map<String, ConcurrentRollup<Input>>> insert);
// 
// }
// 
// Path: src/main/java/com/cscotta/deschutes/json/Json.java
// public class Json {
//     public final ObjectMapper objectMapper = new ObjectMapper();
// 
//     public Json() {
//         SimpleModule olapMods = new SimpleModule("olapMods", new Version(1,0,0,null));
//         olapMods.addSerializer(new HistogramSnapshotSerializer());
//         objectMapper.registerModule(olapMods);
//     }
// 
// }


// Path: src/main/java/com/cscotta/deschutes/json/LoggedRollupListener.java
import java.util.List;
import java.util.Map;
import com.cscotta.deschutes.example.requests.RequestEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cscotta.deschutes.api.ConcurrentRollup;
import com.cscotta.deschutes.api.OutputListener;
import com.cscotta.deschutes.json.Json;
import org.codehaus.jackson.map.ObjectMapper;

package com.cscotta.deschutes.json;




public class LoggedRollupListener implements OutputListener<RequestEvent> {

    private final ObjectMapper jackson = new Json().objectMapper;
    private static final Logger log = LoggerFactory.getLogger(LoggedRollupListener.class);

    @Override
    public void update(List<Long> remove, Map<Long, Map<String, ConcurrentRollup<RequestEvent>>> insert) {
        try {