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

abobrov
01.13.2008 ef115a28201f5ce47f6bbfaeb0596a6875594a0d
- [Issue 2772] Report preload status
Log database cache preload status, progress and completion reports.
2 files modified
61 ■■■■■ changed files
opends/src/messages/messages/jeb.properties 14 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/jeb/RootContainer.java 47 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/jeb.properties
@@ -130,8 +130,22 @@
 because an entry with that name already exists
MILD_ERR_JEB_NEW_SUPERIOR_NO_SUCH_OBJECT_54=The entry cannot be moved because \
 the new parent entry '%s' does not exist
NOTICE_JEB_CACHE_PRELOAD_STARTED_55=The database cache preload for backend %s \
 has started
NOTICE_JEB_CACHE_DB_PRELOADED_56=The database cache preload for database %s \
 is complete
NOTICE_JEB_CACHE_PRELOAD_INTERRUPTED_BY_TIME_57=The database cache preload for \
 backend %s has been interrupted while preloading database %s due to time limit
NOTICE_JEB_CACHE_PRELOAD_INTERRUPTED_BY_SIZE_58=The database cache preload for \
 backend %s has been interrupted while preloading database %s due to size limit
NOTICE_JEB_CACHE_PRELOAD_INTERRUPTED_UNKNOWN_59=The database cache preload for \
 backend %s has been interrupted while preloading database %s
NOTICE_JEB_CACHE_PRELOAD_DONE_60=The database cache preload for backend %s \
 is complete
NOTICE_JEB_CACHE_SIZE_AFTER_PRELOAD_61=The database cache is %d MB after \
 pre-loading
SEVERE_ERR_JEB_CACHE_PRELOAD_62=An error occurred while preloading the \
 database cache for backend %s:  %s
SEVERE_ERR_JEB_BACKUP_CANNOT_GET_MAC_63=An error occurred while attempting to \
 obtain the %s MAC provider to create the signed hash for the backup:  %s
SEVERE_ERR_JEB_BACKUP_CANNOT_GET_DIGEST_64=An error occurred while attempting \
opends/src/server/org/opends/server/backends/jeb/RootContainer.java
@@ -402,12 +402,18 @@
      // is filled.
      try
      {
        long timeEnd = System.currentTimeMillis() + timeLimit;
        // Configure preload of Leaf Nodes (LNs) containing the data values.
        PreloadConfig preloadConfig = new PreloadConfig();
        preloadConfig.setLoadLNs(true);
        Message message =
            NOTE_JEB_CACHE_PRELOAD_STARTED.get(backend.getBackendID());
        logError(message);
        boolean isInterrupted = false;
        long timeEnd = System.currentTimeMillis() + timeLimit;
        for (DatabaseContainer db : dbList)
        {
          // Calculate the remaining time.
@@ -427,17 +433,44 @@
          }
          // Stop if the cache is full or the time limit has been exceeded.
          if (preloadStats.getStatus() != PreloadStatus.SUCCESS)
          PreloadStatus preloadStatus = preloadStats.getStatus();
          if (preloadStatus != PreloadStatus.SUCCESS)
          {
            if (preloadStatus == PreloadStatus.EXCEEDED_TIME) {
              message =
                NOTE_JEB_CACHE_PRELOAD_INTERRUPTED_BY_TIME.get(
                backend.getBackendID(), db.getName());
              logError(message);
            } else if (preloadStatus == PreloadStatus.FILLED_CACHE) {
              message =
                NOTE_JEB_CACHE_PRELOAD_INTERRUPTED_BY_SIZE.get(
                backend.getBackendID(), db.getName());
              logError(message);
            } else {
              message =
                NOTE_JEB_CACHE_PRELOAD_INTERRUPTED_UNKNOWN.get(
                backend.getBackendID(), db.getName());
              logError(message);
            }
            isInterrupted = true;
            break;
          }
          message = NOTE_JEB_CACHE_DB_PRELOADED.get(db.getName());
          logError(message);
        }
        if (!isInterrupted) {
          message = NOTE_JEB_CACHE_PRELOAD_DONE.get(backend.getBackendID());
          logError(message);
        }
        // Log an informational message about the size of the cache.
        EnvironmentStats stats = env.getStats(new StatsConfig());
        long total = stats.getCacheTotalBytes();
        Message message =
        message =
            NOTE_JEB_CACHE_SIZE_AFTER_PRELOAD.get(total / (1024 * 1024));
        logError(message);
      }
@@ -447,6 +480,12 @@
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
          ERR_JEB_CACHE_PRELOAD.get(backend.getBackendID(),
          (e.getCause() != null ? e.getCause().getMessage() :
            stackTraceToSingleLineString(e)));
        logError(message);
      }
    }
  }