- fix for bug in svn 6669

- cleanup

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6670 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent d378ca4604
commit 2bc36de336

@ -532,11 +532,13 @@ public final class yacySeedDB implements AlternativeDomainNames {
if ((this.mySeed != null) && (hash.equals(mySeed.hash))) return mySeed; if ((this.mySeed != null) && (hash.equals(mySeed.hash))) return mySeed;
ConcurrentHashMap<String, String> entry = new ConcurrentHashMap<String, String>(); ConcurrentHashMap<String, String> entry = new ConcurrentHashMap<String, String>();
try { try {
entry.putAll(database.get(hash)); Map<String, String> map = database.get(hash);
if (map == null) return null;
entry.putAll(map);
} catch (final IOException e) { } catch (final IOException e) {
entry = null; Log.logException(e);
return null;
} }
if (entry == null) return null;
return new yacySeed(hash, entry); return new yacySeed(hash, entry);
} }

@ -602,22 +602,6 @@ public class HeapReader {
} }
} }
/* the old code:
private Map.Entry<byte[], byte[]> next0() {
try {
while (true) {
int len = is.readInt();
byte[] key = new byte[this.keylen];
if (is.read(key) < key.length) return null;
byte[] payload = new byte[len - this.keylen];
if (is.read(payload) < payload.length) return null;
if (key[0] == 0) continue; // this is an empty gap
return new entry(key, payload);
}
}
*/
public Map.Entry<byte[], byte[]> next() { public Map.Entry<byte[], byte[]> next() {
final Map.Entry<byte[], byte[]> n = this.nextEntry; final Map.Entry<byte[], byte[]> n = this.nextEntry;
this.nextEntry = next0(); this.nextEntry = next0();

@ -191,18 +191,12 @@ public class MapDataMining extends MapHeap {
assert (key != null); assert (key != null);
assert (key.length() > 0); assert (key.length() > 0);
assert (newMap != null); assert (newMap != null);
// super.put(key, newMap); // moved down for solving yacy-bar-values - needed to be before the other stuff?
//
// // update sortCluster
// if (sortClusterMap != null) updateSortCluster(key, newMap);
// update elementCount // update elementCount
if ((longaccfields != null) || (doubleaccfields != null)) { if ((longaccfields != null) || (doubleaccfields != null)) {
final Map<String, String> oldMap = super.get(key, false); final Map<String, String> oldMap = super.get(key, false);
if (oldMap != null) { if (oldMap != null) {
// element exists, update acc // element exists, update acc
// if ((longaccfields != null) || (doubleaccfields != null)) updateAcc(oldMap, false); // we already checked this - don't we?
updateAcc(oldMap, false); updateAcc(oldMap, false);
} }

@ -307,36 +307,6 @@ public class BDecoder {
return null; return null;
} }
} }
/*
public static BObject parse(InputStream is) {
if (is.available() < 1) return null;
char ch = (char) is.read();
if ((ch >= '0') && (ch <= '9')) {
StringBuilder s = new StringBuilder();
s.append(ch);
while ((ch = (char) is.read()) != ':') s.append(ch);
int len = Integer.parseInt(s.toString());
byte[] b = new byte[len];
is.read(b);
return new BStringObject(new String(b));
} else if (ch == 'l') {
pos++;
return new BListObject(readList());
} else if (ch == 'd') {
pos++;
return new BDictionaryObject(convertToMap(readList()));
} else if (ch == 'i') {
pos++;
int end = pos;
while (b[end] != 'e') ++end;
BIntegerObject io = new BIntegerObject(Long.parseLong(new String(b, pos, end - pos)));
pos = end + 1;
return io;
} else {
return null;
}
}
*/
public static void print(BObject bo, int t) { public static void print(BObject bo, int t) {
for (int i = 0; i < t; i++) System.out.print(" "); for (int i = 0; i < t; i++) System.out.print(" ");

Loading…
Cancel
Save