summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-05-01 20:41:50 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-05-01 20:41:50 +0000
commit02907e327a657b6038d1eeec898bc42caa3b5ce3 (patch)
tree8c81647206869eec0dbefe153ecd59056673e09f /src/main/java
parent8fb89b4dcf778e8673ce5c031796328d0dd917d6 (diff)
Add index repair method.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java6
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java
index fb55433..6409da7 100644
--- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java
+++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java
@@ -605,7 +605,7 @@ class IndexedStorage<S extends Storable> implements Storage<S>, StorageAccess<S>
// Doesn't completely remove the index, but it should free up space.
double desiredSpeed = mRepository.getIndexRepairThrottle();
- Throttle throttle = desiredSpeed < 1.0 ? new Throttle(POPULATE_THROTTLE_WINDOW) : null;
+ Throttle throttle = desiredSpeed < 1.0 ? new Throttle(BUILD_THROTTLE_WINDOW) : null;
if (throttle == null) {
indexEntryStorage.truncate();
@@ -624,7 +624,7 @@ class IndexedStorage<S extends Storable> implements Storage<S>, StorageAccess<S>
final long savedTotal = totalDropped;
boolean anyFailure = false;
try {
- while (count++ < POPULATE_BATCH_SIZE && cursor.hasNext()) {
+ while (count++ < BUILD_BATCH_SIZE && cursor.hasNext()) {
if (cursor.next().tryDelete()) {
totalDropped++;
} else {
@@ -650,7 +650,7 @@ class IndexedStorage<S extends Storable> implements Storage<S>, StorageAccess<S>
}
try {
- throttle.throttle(desiredSpeed, POPULATE_THROTTLE_SLEEP_PRECISION);
+ throttle.throttle(desiredSpeed, BUILD_THROTTLE_SLEEP_PRECISION);
} catch (InterruptedException e) {
throw new RepositoryException("Index removal interrupted");
}
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java b/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java
index 5806529..c667dde 100644
--- a/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java
+++ b/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java
@@ -29,7 +29,6 @@ import com.amazon.carbonado.CorruptEncodingException;
import com.amazon.carbonado.Cursor;
import com.amazon.carbonado.FetchException;
import com.amazon.carbonado.IsolationLevel;
-import com.amazon.carbonado.OptimisticLockException;
import com.amazon.carbonado.PersistException;
import com.amazon.carbonado.Query;
import com.amazon.carbonado.Repository;
@@ -388,7 +387,6 @@ class ManagedIndex<S extends Storable> implements IndexEntryAccessor<S> {
txn = repo.enterTopTransaction(IsolationLevel.READ_COMMITTED);
try {
-
for (Object obj : buffer) {
Storable indexEntry = (Storable) obj;
if (indexEntry.tryInsert()) {