From 7690cb21d051728c5b72a99a2c1cc50f8e907f8e Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 14 Mar 2015 00:48:34 +0000
Subject: [PATCH] OPENDJ-1848: simplify DatabaseContainer and Storage APIs
---
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
index 55b75fa..002a33e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -29,6 +29,7 @@
import static org.opends.messages.JebMessages.*;
import static org.opends.server.util.StaticUtils.*;
+import java.io.Closeable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -85,7 +86,7 @@
* to its own key.
*/
class VLVIndex extends DatabaseContainer
- implements ConfigurationChangeListener<BackendVLVIndexCfg>
+ implements ConfigurationChangeListener<BackendVLVIndexCfg>, Closeable
{
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
@@ -113,6 +114,8 @@
private SearchFilter filter;
private SearchScope scope;
+ /** The storage associated with this index. */
+ private final Storage storage;
/**
* Create a new VLV vlvIndex object.
@@ -131,12 +134,13 @@
VLVIndex(BackendVLVIndexCfg config, State state, Storage storage, EntryContainer entryContainer, WriteableStorage txn)
throws StorageRuntimeException, ConfigException
{
- super(new TreeName(entryContainer.getDatabasePrefix(), "vlv." + config.getName()), storage);
+ super(new TreeName(entryContainer.getDatabasePrefix(), "vlv." + config.getName()));
this.config = config;
this.baseDN = config.getBaseDN();
this.scope = valueOf(config.getScope());
this.sortedSetCapacity = config.getMaxBlockSize();
+ this.storage = storage;
try
{
@@ -245,16 +249,9 @@
return bytes.toInt();
}
- /**
- * Close the VLV index.
- *
- * @throws StorageRuntimeException if a JE database error occurs while
- * closing the index.
- */
@Override
- public void close() throws StorageRuntimeException
+ public void close()
{
- super.close();
this.config.removeChangeListener(this);
}
--
Gitblit v1.10.0