class HiveMetricsHelper {

  public static Optional<Long> incrementCounter(String name) {
    try {
      Metrics metrics = MetricsFactory.getInstance();
      if (metrics != null) {
        return Optional.of(metrics.incrementCounter(name));
      }
    } catch (Exception e) {
      log.warn("Unable to increment counter {}", name, e);
    }
    return Optional.empty();
  }

  private  HiveMetricsHelper();

}