From 172ae4c6e63be576376b32a68c8e8218f202fa22 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 27 Apr 2007 20:43:17 +0000
Subject: [PATCH] Add initial support for server-side sorting in OpenDS. This implementation will only work for indexed searches, and it operates by sorting the ID list before iterating through the entries to return them to the client.
---
opends/src/server/org/opends/server/backends/jeb/EntryIDSet.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/EntryIDSet.java b/opends/src/server/org/opends/server/backends/jeb/EntryIDSet.java
index f843c69..76ec3e1 100644
--- a/opends/src/server/org/opends/server/backends/jeb/EntryIDSet.java
+++ b/opends/src/server/org/opends/server/backends/jeb/EntryIDSet.java
@@ -612,4 +612,26 @@
}
}
+ /**
+ * Create an iterator over the set or an empty iterator
+ * if the set is not defined.
+ *
+ * @param begin The entry ID of the first entry to return in the list.
+ *
+ * @return An EntryID iterator.
+ */
+ public Iterator<EntryID> iterator(EntryID begin)
+ {
+ if (values == null)
+ {
+ // The set is not defined.
+ return new IDSetIterator(new long[0]);
+ }
+ else
+ {
+ // The set is defined.
+ return new IDSetIterator(values, begin);
+ }
+ }
+
}
--
Gitblit v1.10.0