fixed wrong implemented row iterator in kelomdroFlexSplitTables

this has no effect, until now this iterator was only used on
the Index Administration page.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3464 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent a1fb8358b2
commit 909d7a8ae9

@ -116,14 +116,13 @@
</tr> </tr>
</table> </table>
</form> </form>
#(keyhashsimilar)# #(keyhashsimilar)#::Sequential List of Word-Hashes:<br />
::Sequential List of Word-Hashes:<br />#{rows}# #{rows}#
#{cols}# #{cols}#
<a href="/IndexControl_p.html?keyhash=#[wordHash]#&amp;keyhashsearch=1" class="tt">#[wordHash]#</a>#{/cols}#<br /> <a href="/IndexControl_p.html?keyhash=#[wordHash]#&amp;keyhashsearch=1" class="tt">#[wordHash]#</a>#{/cols}#<br />
#{/rows}# #{/rows}#
#(/keyhashsimilar)# #(/keyhashsimilar)#
#(urlhashsimilar)# #(urlhashsimilar)#::Sequential List of URL-Hashes:<br />
::Sequential List of URL-Hashes:<br />
#{rows}# #{rows}#
#{cols}#<a href="/IndexControl_p.html?urlhash=#[urlHash]#&amp;urlhashsearch=1" class="tt">#[urlHash]#</a> #{/cols}#<br /> #{cols}#<a href="/IndexControl_p.html?urlhash=#[urlHash]#&amp;urlhashsearch=1" class="tt">#[urlHash]#</a> #{/cols}#<br />
#{/rows}# #{/rows}#

@ -31,6 +31,7 @@ import java.io.IOException;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -40,7 +41,7 @@ public class kelondroFlexSplitTable implements kelondroIndex {
// this is a set of kelondroFlex tables // this is a set of kelondroFlex tables
// the set is divided into FlexTables with different entry date // the set is divided into FlexTables with different entry date
private HashMap tables; private HashMap tables; // a map from a date string to a kelondroIndex object
private kelondroRow rowdef; private kelondroRow rowdef;
private File path; private File path;
private String tablename; private String tablename;
@ -270,47 +271,14 @@ public class kelondroFlexSplitTable implements kelondroIndex {
} }
public synchronized kelondroCloneableIterator rows(boolean up, byte[] firstKey) throws IOException { public synchronized kelondroCloneableIterator rows(boolean up, byte[] firstKey) throws IOException {
return new rowIter(); HashSet set = new HashSet();
} Iterator i = tables.values().iterator();
while (i.hasNext()) {
public class rowIter implements kelondroCloneableIterator { set.add(((kelondroIndex) i.next()).rows(up, firstKey));
Iterator t, tt;
public rowIter() {
t = tables.values().iterator();
tt = null;
}
public Object clone(Object modifier) {
return new rowIter();
}
public boolean hasNext() {
return ((t.hasNext()) || ((tt != null) && (tt.hasNext())));
}
public Object next() {
if ((tt == null) || (!(tt.hasNext()))) {
try {
tt = ((kelondroIndex) t.next()).rows(true, null);
} catch (IOException e) {
return null;
}
}
if (tt.hasNext()) {
return tt.next();
} else {
return this.next(); // t is empty, try next table
}
}
public void remove() {
if (tt != null) tt.remove();
} }
return kelondroMergeIterator.cascade(set, rowdef.objectOrder, kelondroMergeIterator.simpleMerge, up);
} }
public final int cacheObjectChunkSize() { public final int cacheObjectChunkSize() {
// dummy method // dummy method
return -1; return -1;

@ -146,7 +146,7 @@ public class kelondroMergeIterator implements kelondroCloneableIterator {
throw new java.lang.UnsupportedOperationException("merge does not support remove"); throw new java.lang.UnsupportedOperationException("merge does not support remove");
} }
public static Iterator cascade(Set /*of*/ iterators, Comparator c, Method merger, boolean up) { public static kelondroCloneableIterator cascade(Set /*of*/ iterators, Comparator c, Method merger, boolean up) {
// this extends the ability to combine two iterators // this extends the ability to combine two iterators
// to the abiliy of combining a set of iterators // to the abiliy of combining a set of iterators
if (iterators == null) return null; if (iterators == null) return null;

Loading…
Cancel
Save