From ead416fd200146255cc99752d62349471da2bbaa Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Fri, 30 Jul 2010 13:34:25 +0000
Subject: [PATCH] Implements disk space monitoring for the JEB backend, import and rebuild operations. When low disk space is threshold is reached, the operation will abort and close the environment cleanly. All indexes will be left in the "untrusted" state so the user knows the DB is invalid. It will also print the appropriate message depending on which import phase when the threshold is reached: * phase 1 failure: import append + replace required to continue. * phase 2 failure: rebuildAll required to continue.
---
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Suffix.java | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Suffix.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Suffix.java
index 077987e..c357f84 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Suffix.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Suffix.java
@@ -276,33 +276,36 @@
/**
- * Sets all of the indexes, vlvIndexes, id2children and id2subtree indexes to
- * trusted.
+ * Sets the trusted status of all of the indexes, vlvIndexes, id2children
+ * and id2subtree indexes.
+ *
+ * @param trusted True if the indexes should be trusted or false
+ * otherwise.
*
* @throws DatabaseException If an error occurred setting the indexes to
* trusted.
*/
- public void setIndexesTrusted() throws DatabaseException
+ public void setIndexesTrusted(boolean trusted) throws DatabaseException
{
- entryContainer.getID2Children().setTrusted(null,true);
- entryContainer.getID2Subtree().setTrusted(null, true);
+ entryContainer.getID2Children().setTrusted(null,trusted);
+ entryContainer.getID2Subtree().setTrusted(null, trusted);
for(AttributeIndex attributeIndex :
entryContainer.getAttributeIndexes()) {
Index index;
if((index = attributeIndex.getEqualityIndex()) != null) {
- index.setTrusted(null, true);
+ index.setTrusted(null, trusted);
}
if((index=attributeIndex.getPresenceIndex()) != null) {
- index.setTrusted(null, true);
+ index.setTrusted(null, trusted);
}
if((index=attributeIndex.getSubstringIndex()) != null) {
- index.setTrusted(null, true);
+ index.setTrusted(null, trusted);
}
if((index=attributeIndex.getOrderingIndex()) != null) {
- index.setTrusted(null, true);
+ index.setTrusted(null, trusted);
}
if((index=attributeIndex.getApproximateIndex()) != null) {
- index.setTrusted(null, true);
+ index.setTrusted(null, trusted);
}
Map<String,Collection<Index>> exIndexes =
attributeIndex.getExtensibleIndexes();
@@ -312,20 +315,20 @@
get(EXTENSIBLE_INDEXER_ID_SUBSTRING);
if(subIndexes != null) {
for(Index subIndex : subIndexes) {
- subIndex.setTrusted(null, true);
+ subIndex.setTrusted(null, trusted);
}
}
Collection<Index> sharedIndexes = attributeIndex.
getExtensibleIndexes().get(EXTENSIBLE_INDEXER_ID_SHARED);
if(sharedIndexes !=null) {
for(Index sharedIndex : sharedIndexes) {
- sharedIndex.setTrusted(null, true);
+ sharedIndex.setTrusted(null, trusted);
}
}
}
}
for(VLVIndex vlvIdx : entryContainer.getVLVIndexes()) {
- vlvIdx.setTrusted(null, true);
+ vlvIdx.setTrusted(null, trusted);
}
}
--
Gitblit v1.10.0