[Mulgara-svn] r1761 - in trunk/src/jar: resolver-memory/java/org/mulgara/resolver/memory resolver-prefix/java/org/mulgara/resolver/prefix tuples-hybrid/java/org/mulgara/store/xa
pag at mulgara.org
pag at mulgara.org
Fri Jul 10 16:37:59 UTC 2009
Author: pag
Date: 2009-07-10 09:37:58 -0700 (Fri, 10 Jul 2009)
New Revision: 1761
Modified:
trunk/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolution.java
trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java
trunk/src/jar/tuples-hybrid/java/org/mulgara/store/xa/HybridTuples.java
Log:
Added the getRowExpectedCount method to supplant getRowUpperBound
Modified: trunk/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolution.java
===================================================================
--- trunk/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolution.java 2009-07-10 16:37:20 UTC (rev 1760)
+++ trunk/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolution.java 2009-07-10 16:37:58 UTC (rev 1761)
@@ -209,6 +209,10 @@
return getRowCount();
}
+ public long getRowExpectedCount() throws TuplesException {
+ return getRowCount();
+ }
+
public boolean hasNoDuplicates() throws TuplesException {
return false;
}
Modified: trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java
===================================================================
--- trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java 2009-07-10 16:37:20 UTC (rev 1760)
+++ trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java 2009-07-10 16:37:58 UTC (rev 1761)
@@ -316,12 +316,22 @@
* This method returns an upper bound on the number of rows which this instance contains.
*
* @return The upper bound of the number of rows that this instance contains.
- * @throws TuplesException EXCEPTION TO DO
+ * @throws TuplesException Error accessing the underlying data.
*/
public long getRowUpperBound() throws TuplesException {
return tuples.getRowUpperBound();
}
+ /**
+ * This method returns the expected count on the number of rows which this instance contains.
+ *
+ * @return The expected value of the number of rows that this instance contains.
+ * @throws TuplesException Error accessing the underlying data.
+ */
+ public long getRowExpectedCount() throws TuplesException {
+ return tuples.getRowExpectedCount();
+ }
+
/**
* Returns the number of variables (columns).
*
Modified: trunk/src/jar/tuples-hybrid/java/org/mulgara/store/xa/HybridTuples.java
===================================================================
--- trunk/src/jar/tuples-hybrid/java/org/mulgara/store/xa/HybridTuples.java 2009-07-10 16:37:20 UTC (rev 1760)
+++ trunk/src/jar/tuples-hybrid/java/org/mulgara/store/xa/HybridTuples.java 2009-07-10 16:37:58 UTC (rev 1761)
@@ -135,8 +135,8 @@
// Create a lookup up list of unique variables to their position in an
// index.
- HashSet uniqueVars = new HashSet();
- List uniqueVarIndex = new ArrayList();
+ HashSet<Variable> uniqueVars = new HashSet<Variable>();
+ List<Variable> uniqueVarIndex = new ArrayList<Variable>();
varLookupList = new int[vars.length];
int varIndex = -1;
for (int index = 0; index < vars.length; index++) {
@@ -299,7 +299,7 @@
}
- public List getOperands() {
+ public List<Tuples> getOperands() {
return Collections.singletonList(tuples);
}
@@ -395,14 +395,17 @@
}
- public long getRowUpperBound() throws TuplesException
- {
+ public long getRowUpperBound() throws TuplesException {
return getRowCount();
}
- public int getRowCardinality() throws TuplesException
- {
+ public long getRowExpectedCount() throws TuplesException {
+ return getRowCount();
+ }
+
+
+ public int getRowCardinality() throws TuplesException {
switch ((int)getRowCount()) {
case 0:
return Cursor.ZERO;
@@ -565,7 +568,7 @@
} else {
initialiseBlockFile();
- ArrayList tmpHeap = new ArrayList();
+ ArrayList<BlockCacheLine> tmpHeap = new ArrayList<BlockCacheLine>();
tmpHeap.add(new BlockCacheLine(blockFile, BLOCK_SIZE, buffer, size));
do {
@@ -575,7 +578,7 @@
}
} while (size == buffer.getLength());
- this.heapCache = (CacheLine[])tmpHeap.toArray(new CacheLine[0]);
+ this.heapCache = tmpHeap.toArray(new CacheLine[0]);
}
return this.heapCache.length;
@@ -640,9 +643,10 @@
/*
* Used for debugging cache.
*/
+ @SuppressWarnings("unused")
private void checkHeapIds(String marker) throws TuplesException {
- Set lines = new HashSet();
- Set dups = new HashSet();
+ Set<CacheLine> lines = new HashSet<CacheLine>();
+ Set<Integer> dups = new HashSet<Integer>();
for (int i = 0; i < heapCache.length; i++) {
if (lines.contains(heapCache[i])) {
@@ -689,6 +693,7 @@
}
}
+ @SuppressWarnings("unused")
private void dumpCacheStatus(String marker) {
StringBuffer buff = new StringBuffer(marker + ": CacheStatus: [");
for (int i = 0; i < heapCache.length; i++) {
@@ -698,6 +703,7 @@
logger.warn(buff.toString());
}
+ @SuppressWarnings("unused")
private void debugHeapStatus() {
if (heapCache[0].isEmpty()) {
logger.debug("Head is still empty after restoreHeap");
@@ -846,7 +852,7 @@
/**
* Copied from AbstractTuples
*/
- public Annotation getAnnotation(Class annotationClass) throws TuplesException {
+ public Annotation getAnnotation(Class<? extends Annotation> annotationClass) throws TuplesException {
return null;
}
}
More information about the Mulgara-svn
mailing list