// Path: java/src/main/java/monasca/persister/repository/RepoException.java
// public class RepoException extends Exception {
// 
//   public RepoException() {
// 
//     super();
//   }
// 
//   public RepoException(String message) {
// 
//     super(message);
//   }
// 
//   public RepoException(String message, Throwable cause) {
// 
//     super(message, cause);
//   }
// 
//   public RepoException(Throwable cause) {
// 
//     super(cause);
//   }
// 
//   protected RepoException(String message, Throwable cause, boolean enableSuppression,
//                           boolean writableStackTrace) {
// 
//     super(message, cause, enableSuppression, writableStackTrace);
//   }
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import monasca.common.model.event.AlarmStateTransitionedEvent;
import monasca.persister.configuration.PipelineConfig;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.codahale.metrics.Counter;
import com.fasterxml.jackson.databind.DeserializationFeature;
import io.dropwizard.setup.Environment;
import monasca.persister.repository.Repo;
import monasca.persister.repository.RepoException;
      logger.error("[{}]: failed to deserialize message {}", this.threadId, msg, e);

      return 0;
    }

    logger.debug("[{}]: [{}:{}] {}",
                 this.threadId,
                 this.getBatchCount(),
                 this.getMsgCount(),
                 alarmStateTransitionedEvent);

    this.alarmRepo.addToBatch(alarmStateTransitionedEvent, this.threadId);

    this.alarmStateTransitionCounter.inc();

    return 1;
  }

  @Override
  protected void initObjectMapper() {

    this.objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);

    this.objectMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);

    this.objectMapper.enable(DeserializationFeature.UNWRAP_ROOT_VALUE);

  }

  @Override
// Path: java/src/main/java/monasca/persister/repository/RepoException.java
// public class RepoException extends Exception {
// 
//   public RepoException() {
// 
//     super();
//   }
// 
//   public RepoException(String message) {
// 
//     super(message);
//   }
// 
//   public RepoException(String message, Throwable cause) {
// 
//     super(message, cause);
//   }
// 
//   public RepoException(Throwable cause) {
// 
//     super(cause);
//   }
// 
//   protected RepoException(String message, Throwable cause, boolean enableSuppression,
//                           boolean writableStackTrace) {
// 
//     super(message, cause, enableSuppression, writableStackTrace);
//   }
// }


// Path: java/src/main/java/monasca/persister/pipeline/event/AlarmStateTransitionHandler.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import monasca.common.model.event.AlarmStateTransitionedEvent;
import monasca.persister.configuration.PipelineConfig;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.codahale.metrics.Counter;
import com.fasterxml.jackson.databind.DeserializationFeature;
import io.dropwizard.setup.Environment;
import monasca.persister.repository.Repo;
import monasca.persister.repository.RepoException;

      logger.error("[{}]: failed to deserialize message {}", this.threadId, msg, e);

      return 0;
    }

    logger.debug("[{}]: [{}:{}] {}",
                 this.threadId,
                 this.getBatchCount(),
                 this.getMsgCount(),
                 alarmStateTransitionedEvent);

    this.alarmRepo.addToBatch(alarmStateTransitionedEvent, this.threadId);

    this.alarmStateTransitionCounter.inc();

    return 1;
  }

  @Override
  protected void initObjectMapper() {

    this.objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);

    this.objectMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);

    this.objectMapper.enable(DeserializationFeature.UNWRAP_ROOT_VALUE);

  }

  @Override
  protected int flushRepository() throws RepoException {