From a3bfd668aa98c13911c81f829f1e620a5f713022 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 10 Dec 2007 02:40:16 +0000 Subject: [PATCH] opening of array files at startup time, not when first time the web index is accessed this speeds up the first search after startup git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4263 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroCollectionIndex.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroCollectionIndex.java b/source/de/anomic/kelondro/kelondroCollectionIndex.java index 524d7460e..b1c90035c 100644 --- a/source/de/anomic/kelondro/kelondroCollectionIndex.java +++ b/source/de/anomic/kelondro/kelondroCollectionIndex.java @@ -130,12 +130,13 @@ public class kelondroCollectionIndex { // open array files this.arrays = new HashMap(); // all entries will be dynamically created with getArray() - if (((fileIndexGeneration) || (ramIndexGeneration))) { + if ((fileIndexGeneration) || (ramIndexGeneration)) { serverLog.logFine("STARTUP", "STARTED INITIALIZATION OF NEW COLLECTION INDEX. THIS WILL TAKE SOME TIME"); - openAllArrayFiles(((fileIndexGeneration) || (ramIndexGeneration)), indexOrder); + } else { + if (index == null) index = openIndexFile(path, filenameStub, indexOrder, preloadTime, loadfactor, rowdef); + serverLog.logFine("STARTUP", "OPENING COLLECTION INDEX"); } - - // open/create index table + openAllArrayFiles(((fileIndexGeneration) || (ramIndexGeneration)), indexOrder); if (index == null) index = openIndexFile(path, filenameStub, indexOrder, preloadTime, loadfactor, rowdef); }