Skip to content

Commit

Permalink
disabled some (more) write caches
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2987 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Nov 20, 2006
1 parent 09bcc10 commit 10a4ab5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/dbtest.java
Expand Up @@ -175,7 +175,7 @@ public static void main(String[] args) {
kelondroRow testRow = new kelondroRow("byte[] key-" + keylength + ", byte[] dummy-" + keylength + ", value-" + valuelength);
if (dbe.equals("kelondroTree")) {
File tablefile = new File(tablename + ".kelondro.db");
table = new kelondroCache(new kelondroTree(tablefile, buffer / 2, preload, testRow), buffer / 2, true, true);
table = new kelondroCache(new kelondroTree(tablefile, buffer / 2, preload, testRow), buffer / 2, true, false);
}
if (dbe.equals("kelondroSplittedTree")) {
File tablepath = new File(tablename).getParentFile();
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/kelondro/kelondroMapTable.java
Expand Up @@ -91,7 +91,7 @@ public void declareTree(String tablename, kelondroRow rowdef, long buffersize /*
if (mTables.containsKey(tablename)) throw new RuntimeException("kelondroTables.declareTree: table '" + tablename + "' declared already in other context.");
if (tTables.containsKey(tablename)) throw new RuntimeException("kelondroTables.declareTree: table '" + tablename + "' declared twice.");
File tablefile = new File(tablesPath, "table." + tablename + ".tdb");
kelondroIndex Tree = new kelondroCache(kelondroTree.open(tablefile, buffersize / 2, preloadTime, rowdef), buffersize / 2, true, true);
kelondroIndex Tree = new kelondroCache(kelondroTree.open(tablefile, buffersize / 2, preloadTime, rowdef), buffersize / 2, true, false);
tTables.put(tablename, Tree);
}

Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/kelondro/kelondroRowSet.java
Expand Up @@ -341,12 +341,12 @@ public class rowIterator implements Iterator {
private int p, bound;

public rowIterator(boolean up, boolean rotating, byte[] firstKey) {
// see that all elements are sorted
shape();
this.up = up;
this.rot = rotating;
this.first = firstKey;
this.bound = sortBound;
// see that all elements are sorted
shape();
if (first == null) {
p = 0;
} else {
Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/plasma/plasmaWordIndexAssortment.java
Expand Up @@ -112,7 +112,7 @@ public plasmaWordIndexAssortment(File storagePath, kelondroRow payloadrow, int a
this.log = log;
// open assortment tree file
long start = System.currentTimeMillis();
assortments = new kelondroCache(kelondroTree.open(assortmentFile, bufferSize / 2, preloadTime, bufferStructure(assortmentLength)), bufferSize / 2, true, true);
assortments = new kelondroCache(kelondroTree.open(assortmentFile, bufferSize / 2, preloadTime, bufferStructure(assortmentLength)), bufferSize / 2, true, false);
long stop = System.currentTimeMillis();
if (log != null) log.logConfig("Opened Assortment, " +
assortments.size() + " entries, width " +
Expand Down Expand Up @@ -240,7 +240,7 @@ private void resetDatabase() {
assortmentFile.renameTo(backupFile);
log.logInfo("a back-up of the deleted assortment file is in " + backupFile.toString());
if (assortmentFile.exists()) assortmentFile.delete();
assortments = new kelondroCache(kelondroTree.open(assortmentFile, bufferSize / 2, preloadTime, bufferStructure(assortmentLength)), bufferSize / 2, true, true);
assortments = new kelondroCache(kelondroTree.open(assortmentFile, bufferSize / 2, preloadTime, bufferStructure(assortmentLength)), bufferSize / 2, true, false);
} catch (Exception e) {
// if this fails, delete the file
if (!(assortmentFile.delete())) throw new RuntimeException("cannot delete assortment database");
Expand Down

0 comments on commit 10a4ab5

Please sign in to comment.