static void logDebugMessageWithCounter(Logger logger, AtomicInteger atomicInteger, String debugMessage, int maxCount) {
    if (atomicInteger.getAndIncrement() == 0) {
      // only log the message once every maxCount attempts
      logger.debug(debugMessage);
    } else {
      // if we've hit maxCount attempts, reset the counter
      atomicInteger.compareAndSet(maxCount, 0);
    }
  }
Utility class to hold static convenience methods for
the LogSearch integration layer
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/Utils.java