| | |
| | | * Verify the backend. |
| | | * |
| | | * @param rootContainer The root container that holds the entries to verify. |
| | | * @param statEntry Optional statistics entry. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | * @throws JebException If an error occurs in the JE backend. |
| | | */ |
| | | public void verifyBackend(RootContainer rootContainer) throws |
| | | public void verifyBackend(RootContainer rootContainer, Entry statEntry) throws |
| | | DatabaseException, JebException |
| | | { |
| | | |
| | |
| | | rate = 1000f*keyCount / totalTime; |
| | | } |
| | | |
| | | addStatEntry(statEntry, "verify-error-count", |
| | | String.valueOf(errorCount)); |
| | | addStatEntry(statEntry, "verify-key-count", |
| | | String.valueOf(keyCount)); |
| | | if (cleanMode) |
| | | { |
| | | int msgID = MSGID_JEB_VERIFY_CLEAN_FINAL_STATUS; |
| | |
| | | message = getMessage(msgID, multiReferenceCount); |
| | | logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE, |
| | | message, msgID); |
| | | addStatEntry(statEntry, "verify-multiple-reference-count", |
| | | String.valueOf(multiReferenceCount)); |
| | | |
| | | msgID = MSGID_JEB_VERIFY_ENTRY_LIMIT_EXCEEDED_COUNT; |
| | | message = getMessage(msgID, entryLimitExceededCount); |
| | | logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE, |
| | | message, msgID); |
| | | addStatEntry(statEntry, "verify-entry-limit-exceeded-count", |
| | | String.valueOf(entryLimitExceededCount)); |
| | | |
| | | msgID = MSGID_JEB_VERIFY_AVERAGE_REFERENCE_COUNT; |
| | | message = getMessage(msgID, averageEntryReferences); |
| | | logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE, |
| | | message, msgID); |
| | | addStatEntry(statEntry, "verify-average-reference-count", |
| | | String.valueOf(averageEntryReferences)); |
| | | |
| | | msgID = MSGID_JEB_VERIFY_MAX_REFERENCE_COUNT; |
| | | message = getMessage(msgID, maxEntryPerValue); |
| | | logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE, |
| | | message, msgID); |
| | | addStatEntry(statEntry, "verify-max-reference-count", |
| | | String.valueOf(maxEntryPerValue)); |
| | | } |
| | | } |
| | | else |
| | |
| | | totalTime/1000, rate); |
| | | logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE, |
| | | message, msgID); |
| | | |
| | | //TODO add entry-limit-stats to the statEntry |
| | | if (entryLimitMap.size() > 0) |
| | | { |
| | | msgID = MSGID_JEB_VERIFY_ENTRY_LIMIT_STATS_HEADER; |
| | |
| | | previousTime = latestTime; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Adds an attribute of type t and value v to the statEntry, only if the |
| | | * statEntry is not null. |
| | | * @param statEntry passed in from backentryImpl.verifyBackend. |
| | | * @param t String to be used as the attribute type. |
| | | * @param v String to be used as the attribute value. |
| | | */ |
| | | private void addStatEntry(Entry statEntry, String t, String v) |
| | | { |
| | | if (statEntry != null) |
| | | { |
| | | Attribute a = new Attribute(t, v); |
| | | statEntry.addAttribute(a, null); |
| | | } |
| | | } |
| | | } |