Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

added an optimization option to HandleSet mass data storage structure

Michael Peter Christen191fd3d7e73a
diff --git a/source/net/yacy/cora/storage/HandleSet.java b/source/net/yacy/cora/storage/HandleSet.java
index 0eb4009de..f29702086 100644
--- a/source/net/yacy/cora/storage/HandleSet.java
+++ b/source/net/yacy/cora/storage/HandleSet.java
@@ -36,6 +36,7 @@ public interface HandleSet extends Iterable<byte[]>, Cloneable, Serializable {
public byte[] export();
+ public void optimize();
/**
* write a dump of the set to a file. All entries are written in order
diff --git a/source/net/yacy/kelondro/index/RowHandleSet.java b/source/net/yacy/kelondro/index/RowHandleSet.java
index 49b5038ce..0f2155a97 100644
--- a/source/net/yacy/kelondro/index/RowHandleSet.java
+++ b/source/net/yacy/kelondro/index/RowHandleSet.java
@@ -89,6 +89,11 @@ public final class RowHandleSet implements HandleSet, Iterable<byte[]>, Cloneabl
return this.index.exportCollection();
}
+ @Override
+ public void optimize() {
+ this.index.sort();
+ }
+
/**
* initialize a HandleSet with the content of a dump
* @param keylength