fix for bug in seed list management (cause was bad class overloading, only visual effects!)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5265 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 603282bcf4
commit 7860d5d632

@ -308,7 +308,7 @@ public class Network {
prop.put(STR_TABLE_LIST + conCount + "_updatedBlog", 0);
prop.put(STR_TABLE_LIST + conCount + "_isCrawling", 0);
if (conCount >= maxCount) { break; }
if (sb.webIndex.seedDB.mySeed() != null && seed.hash.equals(sb.webIndex.seedDB.mySeed().hash)) {
if (sb.webIndex.seedDB != null && sb.webIndex.seedDB.mySeed() != null && seed.hash.equals(sb.webIndex.seedDB.mySeed().hash)) {
prop.put(STR_TABLE_LIST + conCount + "_dark", 2);
} else {
prop.put(STR_TABLE_LIST + conCount + "_dark", ((dark) ? 1 : 0) ); dark=!dark;

@ -184,7 +184,7 @@ public final class kelondroBLOBHeap implements kelondroBLOB {
* the number of BLOBs in the heap
* @return the number of BLOBs in the heap
*/
public int size() {
public synchronized int size() {
return this.index.size();
}
@ -193,7 +193,7 @@ public final class kelondroBLOBHeap implements kelondroBLOB {
* @param key
* @return true if the key exists, false othervise
*/
public boolean has(final byte[] key) {
public synchronized boolean has(final byte[] key) {
assert index != null;
assert index.row().primaryKeyLength == key.length;
@ -470,6 +470,7 @@ public final class kelondroBLOBHeap implements kelondroBLOB {
}
heap.remove("aaaaaaaaaaab".getBytes());
heap.remove("aaaaaaaaaaac".getBytes());
heap.put("aaaaaaaaaaaX".getBytes(), "WXYZ".getBytes());
heap.close();
} catch (final IOException e) {
e.printStackTrace();

@ -1,4 +1,4 @@
// kelondroObjects.java
// kelondroMap.java
// -----------------------
// (C) 29.01.2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 2004 as kelondroMap on http://www.anomic.de
@ -87,9 +87,9 @@ public class kelondroMap {
return bb.toString();
}
private static HashMap<String, String> string2map(final String s) throws IOException {
private static Map<String, String> string2map(final String s) throws IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(s.getBytes())));
final HashMap<String, String> map = new HashMap<String, String>();
final Map<String, String> map = new HashMap<String, String>();
String line;
int pos;
while ((line = br.readLine()) != null) { // very slow readLine????
@ -317,7 +317,7 @@ public class kelondroMap {
// make map
kelondroMap map = new kelondroMap(blob, 1024);
// put some values into the map
HashMap<String, String> m = new HashMap<String, String>();
Map<String, String> m = new HashMap<String, String>();
m.put("k", "000"); map.put("123", m);
m.put("k", "111"); map.put("456", m);
m.put("k", "222"); map.put("789", m);

@ -1,4 +1,4 @@
// kelondroMapObjects.java
// kelondroMapDataMining.java
// -----------------------
// (C) 29.01.2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 2004 as part of kelondroMap on http://www.anomic.de
@ -164,7 +164,7 @@ public class kelondroMapDataMining extends kelondroMap {
}
}
public synchronized void put(final String key, final HashMap<String, String> newMap) throws IOException {
public synchronized void put(final String key, final Map<String, String> newMap) throws IOException {
assert (key != null);
assert (key.length() > 0);
assert (newMap != null);

Loading…
Cancel
Save