Limit the time Transmission.Chunks stay in the transmissionCloud by using a Map that iterates entires in insertion order.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6380 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 16 years ago
parent 92db7c5d07
commit e49e2d75fe

@ -29,8 +29,8 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.TreeMap;
import de.anomic.kelondro.order.Base64Order; import de.anomic.kelondro.order.Base64Order;
import de.anomic.kelondro.text.BufferedIndex; import de.anomic.kelondro.text.BufferedIndex;
@ -80,7 +80,7 @@ public class Dispatcher {
// a cloud is a cache for the objects that wait to be transmitted // a cloud is a cache for the objects that wait to be transmitted
// the String-key is the primary target as contained in the Entry // the String-key is the primary target as contained in the Entry
private TreeMap<byte[], Transmission.Chunk> transmissionCloud; private Map<byte[], Transmission.Chunk> transmissionCloud;
// the backend is used to store the remaining indexContainers in case that the object is closed // the backend is used to store the remaining indexContainers in case that the object is closed
private BufferedIndex<WordReference> backend; private BufferedIndex<WordReference> backend;
@ -104,7 +104,7 @@ public class Dispatcher {
final boolean gzipBody, final boolean gzipBody,
final int timeout final int timeout
) { ) {
this.transmissionCloud = new TreeMap<byte[], Transmission.Chunk>(Base64Order.enhancedCoder); this.transmissionCloud = new LinkedHashMap<byte[], Transmission.Chunk>();
this.backend = backend; this.backend = backend;
this.seeds = seeds; this.seeds = seeds;
this.log = new Log("INDEX-TRANSFER-DISPATCHER"); this.log = new Log("INDEX-TRANSFER-DISPATCHER");

Loading…
Cancel
Save