some work on the intMap

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2186 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 56084e9edc
commit 8a18302e84

@ -313,7 +313,7 @@ public class kelondroCollection {
sort(keylen);
}
private void sort(int keylen) {
public void sort(int keylen) {
assert (this.order != null);
if (this.sortbound == this.chunkcount) return; // this is already sorted
//System.out.println("SORT");

@ -38,6 +38,13 @@ public class kelondroCollectionIntMap extends kelondroCollection {
this.setOrdering(kelondroNaturalOrder.naturalOrder);
}
public void addi(byte[] key, int i) {
kelondroRow.Entry indexentry = indexrow.newEntry();
indexentry.setCol(0, key);
indexentry.setColLongB256(1, i);
add(indexentry.bytes());
}
public int puti(byte[] key, int i) {
int index = -1;
synchronized (chunkcache) {

@ -42,9 +42,13 @@ public class kelondroFlexTable extends kelondroFlexWidthArray implements kelondr
for (int i = 0; i < indexArray.size(); i++) index.put(indexArray.get(i).getColBytes(0), new Integer(i));
indexArray.close();
*/
System.out.print("Loading " + path);
for (int i = 0; i < super.col[0].size(); i++) {
index.puti(super.col[0].get(i).getColBytes(0), i);
index.addi(super.col[0].get(i).getColBytes(0), i);
if ((i % 10000) == 0) System.out.print('.');
}
index.sort(super.row().width(0));
System.out.println(index.size() + " index entries initialized and sorted");
this.index.setOrdering(kelondroNaturalOrder.naturalOrder);
}

Loading…
Cancel
Save