| | |
| | | } |
| | | } |
| | | |
| | | // Increment the entry count. |
| | | id2entry.adjustRecordCount(txn, 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | id2cBuffered.flush(); |
| | | id2sBuffered.flush(); |
| | | |
| | | // Decrement the entry count. |
| | | id2entry.adjustRecordCount(txn, -getDeletedEntryCount()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public long getEntryCount() throws DatabaseException |
| | | { |
| | | return id2entry.getRecordCount(null); |
| | | return id2entry.getRecordCount(); |
| | | } |
| | | |
| | | /** |
| | |
| | | // DATABASE_READ/DATABASE_WRITE |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(operation); |
| | | if (status == OperationStatus.SUCCESS) |
| | | if(status != null) |
| | | { |
| | | builder.append(" (ok)"); |
| | | } |
| | | else |
| | | { |
| | | builder.append(" ("); |
| | | builder.append(status.toString()); |
| | | builder.append(")"); |
| | | if (status == OperationStatus.SUCCESS) |
| | | { |
| | | builder.append(" (ok)"); |
| | | } |
| | | else |
| | | { |
| | | builder.append(" ("); |
| | | builder.append(status.toString()); |
| | | builder.append(")"); |
| | | } |
| | | } |
| | | builder.append(" db="); |
| | | builder.append(database.getDatabaseName()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the count of key/data pairs in the database in a JE database. |
| | | * This is a simple wrapper around the JE Database.count method. |
| | | * @param database the JE database handle. |
| | | * @return The count of key/data pairs in the database. |
| | | * @throws DatabaseException If an error occurs in the JE operation. |
| | | */ |
| | | public static long count(Database database) throws DatabaseException |
| | | { |
| | | long count = database.count(); |
| | | assert debugAccess("count", DATABASE_READ, null, database, |
| | | null, null, null); |
| | | return count; |
| | | } |
| | | |
| | | /** |
| | | * Remove a database from disk. |
| | | * |
| | | * @param name The short database name, to which the entryContainer name will |