mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

abobrov
09.48.2007 4166c20ed1817f2792c6c4a6d12b810c7c256b72
opends/src/server/org/opends/server/extensions/FIFOEntryCache.java
@@ -55,6 +55,7 @@
import org.opends.server.types.Entry;
import org.opends.server.types.InitializationException;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.Attribute;
import org.opends.server.util.ServerConstants;
import org.opends.messages.MessageBuilder;
@@ -231,10 +232,14 @@
    CacheEntry e = dnMap.get(entryDN);
    if (e == null)
    {
      // Indicate cache miss.
      cacheMisses.set(cacheMisses.incrementAndGet());
      return null;
    }
    else
    {
      // Indicate cache hit.
      cacheHits.set(cacheHits.incrementAndGet());
      return e.getEntry();
    }
  }
@@ -990,6 +995,35 @@
  /**
   * {@inheritDoc}
   */
  public ArrayList<Attribute> getMonitorData()
  {
    ArrayList<Attribute> attrs = new ArrayList<Attribute>();
    try {
      attrs = EntryCacheCommon.getGenericMonitorData(
        new Long(cacheHits.longValue()),
        new Long(cacheMisses.longValue()),
        null,
        new Long(maxAllowedMemory),
        new Long(dnMap.size()),
        (((maxEntries != Integer.MAX_VALUE) &&
          (maxEntries != Long.MAX_VALUE)) ?
           new Long(maxEntries) : new Long(0))
        );
    } catch (Exception e) {
      if (debugEnabled()) {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return attrs;
  }
  /**
   * Return a verbose string representation of the current cache maps.
   * This is useful primary for debugging and diagnostic purposes such
   * as in the entry cache unit tests.