[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/lava/gzz/storm IndexedPool.java Pointer.java
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/lava/gzz/storm IndexedPool.java Pointer.java |
Date: |
Mon, 30 Dec 2002 08:16:20 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/12/30 08:16:20
Modified files:
lava/gzz/storm : IndexedPool.java Pointer.java
Log message:
Make leaner and meaner :)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/storm/IndexedPool.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/storm/Pointer.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gzz/lava/gzz/storm/IndexedPool.java
diff -u gzz/lava/gzz/storm/IndexedPool.java:1.6
gzz/lava/gzz/storm/IndexedPool.java:1.7
--- gzz/lava/gzz/storm/IndexedPool.java:1.6 Sat Dec 28 21:01:41 2002
+++ gzz/lava/gzz/storm/IndexedPool.java Mon Dec 30 08:16:20 2002
@@ -41,34 +41,45 @@
*/
public interface IndexedPool extends StormPool {
- interface Index {
- Object get(Object key);
+ final class Mapping {
+ public final byte[] key, value;
+ public Mapping(byte[] k, byte[] v) { key=k; value=v; }
}
interface DB {
+ /** Collect <code>IndexedPool.Mappings</code>s
+ * with the given key from this DB.
+ */
Collector get(byte[] key);
}
- interface Indexer {
- /**
+ interface IndexType {
+ /**
* @return The set of <code>IndexedPool.Mapping</code>s
* this index wants to extract from this block.
*/
- Set index(Block b);
+ Set process(Block b);
- /** Set the <code>DB</code> object this <code>Indexer</code>'s
- * associated <code>Index</code> object will use for lookups.
+ /** A factory method for the public interface
+ * of this type of index.
+ * This is the object that <code>IndexedPool.getIndex()</code>
+ * returns, i.e. the object that clients of the pool
+ * use to retrieve the data in the index.
+ * The actual interface isn't in any way constrained
+ * by Storm, because different indexes will want to
+ * provide very different interfaces; therefore, we simply
+ * return an <code>Object</code> that has to be cast
+ * to the desired interface first.
*/
- void setDB(DB db);
+ Object createIndex(DB db);
- Index getIndex();
String getIndexTypeURI();
}
/** Get the Index object for a given IndexType.
- * Equivalent to <code>(Index)getIndices().get(type)</code>.
+ * Equivalent to <code>getIndices().get(type)</code>.
*/
- Index getIndex(String typeURI);
+ Object getIndex(String typeURI);
/** Return a mapping from index type URIs
* to <code>Index</code> objects. This map
@@ -83,9 +94,4 @@
* </pre>
*/
Pointer getPointer(String uri);
-
- public final class Mapping {
- public final byte[] key, value;
- public Mapping(byte[] k, byte[] v) { key=k; value=v; }
- }
}
Index: gzz/lava/gzz/storm/Pointer.java
diff -u gzz/lava/gzz/storm/Pointer.java:1.3 gzz/lava/gzz/storm/Pointer.java:1.4
--- gzz/lava/gzz/storm/Pointer.java:1.3 Sat Dec 28 21:01:41 2002
+++ gzz/lava/gzz/storm/Pointer.java Mon Dec 30 08:16:20 2002
@@ -74,7 +74,7 @@
* You generally don't want to use this interface, even though you can;
* it is much more convenient to call
<code>IndexedPool.getPointer()</code>.
*/
- interface PointerIndex extends IndexedPool.Index {
+ interface PointerIndex {
Pointer getPointer(String uri);
}
}
- [Gzz-commits] gzz/lava/gzz/storm IndexedPool.java Pointer.java,
Benja Fallenstein <=