| | |
| | | * "tie-breaker" and ensures that keys correspond to one and only one entry. This ensures that all |
| | | * database updates can be performed using lock-free operations. |
| | | */ |
| | | class VLVIndex extends DatabaseContainer implements ConfigurationChangeListener<BackendVLVIndexCfg>, Closeable |
| | | class VLVIndex extends AbstractDatabaseContainer implements ConfigurationChangeListener<BackendVLVIndexCfg>, Closeable |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | void open(final WriteableTransaction txn) throws StorageRuntimeException |
| | | void doOpen(final WriteableTransaction txn) throws StorageRuntimeException |
| | | { |
| | | super.open(txn); |
| | | count.set((int) txn.getRecordCount(getName())); |
| | | } |
| | | |
| | |
| | | { |
| | | if (shouldInclude(entry)) |
| | | { |
| | | buffer.getBufferedVLVIndexValues(this).addValues(encodeVLVKey(entry, entryID.longValue())); |
| | | buffer.put(this, encodeVLVKey(entry, entryID.longValue())); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (shouldInclude(entry)) |
| | | { |
| | | buffer.getBufferedVLVIndexValues(this).deleteValues(encodeVLVKey(entry, entryID.longValue())); |
| | | buffer.remove(this, encodeVLVKey(entry, entryID.longValue())); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | builder.append(separator); |
| | | } |
| | | |
| | | void closeAndDelete(WriteableTransaction txn) |
| | | { |
| | | close(); |
| | | delete(txn); |
| | | state.deleteRecord(txn, getName()); |
| | | } |
| | | } |