- changed index collection process: indexes are not first flushed to indexEntity,
but now collected directly from ram cache and assortments
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1489 6c8d7289-2bf4-0310-a012-ef5d649a1542
prop.put("result",(result==null)?("Successfully transferred "+indexes[0].size()+" words in "+((System.currentTimeMillis()-starttime)/1000)+" seconds"):result);
indexes[0]=null;
indexes=null;
prop.put("result",(result==null)?("Successfully transferred "+index.size()+" words in "+((System.currentTimeMillis()-starttime)/1000)+" seconds"):result);
deployThread("20_dhtdistribution","DHT Distribution","selection, transfer and deletion of index entries that are not searched on your peer, but on others",null,
@ -1353,7 +1353,12 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
@ -201,9 +196,8 @@ public final class plasmaWordIndexDistribution {
// collect index
StringstartPointHash=selectTransferStart();
log.logFine("Selected hash "+startPointHash+" as start point for index distribution, distance = "+yacyDHTAction.dhtDistance(yacyCore.seedDB.mySeed.hash,startPointHash));
log.logInfo("Index transfer of "+indexCount+" words ["+indexContainers[0].wordHash()+" .. "+indexContainers[indexContainers.length-1].wordHash()+"] to peer "+seeds[i].getName()+":"+seeds[i].hash+" in "+((System.currentTimeMillis()-start)/1000)
// deleting entity if there are no more entries left
// This could occure if there are unknownURLs in the entity
if(indexEntity.size()==0){
indexEntity.deleteComplete();
// remove all remaining; we have enough
while(urlIter.hasNext()){
indexEntry=(plasmaWordIndexEntry)urlIter.next();
urlIter.remove();
}
// use whats remaining
this.log.logFine("Selected partial index ("+indexContainer.size()+" from "+indexEntity.size()+" URLs, "+unknownURLEntries.size()+" not bound) for word "+indexContainer.wordHash());
// use whats left
this.log.logFine("Selected partial index ("+indexContainer.size()+" from "+this.wordIndex.indexSize(nexthash)+" URLs, "+notBoundCounter+" not bound) for word "+indexContainer.wordHash());
tmpContainers.add(indexContainer);
}catch(kelondroExceptione){
this.log.logSevere("plasmaWordIndexDistribution/2: deleted DB for word "+indexEntity.wordHash(),e);
indexEntity.deleteComplete();
}
indexEntity.close();// important: is not closed elswhere and cannot be deleted afterwards
indexEntity=null;
this.log.logSevere("plasmaWordIndexDistribution/2: deleted DB for word "+nexthash,e);
log.logFine("Deleted partial index ("+c+" URLs) for word "+indexContainers[i].wordHash()+"; "+this.wordIndex.indexSize(indexContainers[i].wordHash())+" entries left");
indexContainers[i]=null;
}
returnsuccess;
returncount;
}
/*
@ -706,7 +671,6 @@ public final class plasmaWordIndexDistribution {
}
}
}
}
publicclasstransferIndexThreadextendsThread{
@ -715,7 +679,6 @@ public final class plasmaWordIndexDistribution {
privatebooleanfinished=false;
privatebooleangzipBody4Transfer=false;
privateinttimeout4Transfer=60000;
privateintmaxOpenFiles4Transfer=800;
privateinttransferedEntryCount=0;
privateinttransferedEntityCount=0;
privateStringstatus="Running";
@ -734,7 +697,7 @@ public final class plasmaWordIndexDistribution {