incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1207782 - in /incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore: Index.java Table.java TableStore.java
Date Tue, 29 Nov 2011 08:33:04 GMT
Author: kwright
Date: Tue Nov 29 08:33:03 2011
New Revision: 1207782

URL: http://svn.apache.org/viewvc?rev=1207782&view=rev
Log:
Reduce dereferences by maintaining both a long ID and a LongValue

Modified:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Index.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Table.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableStore.java

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Index.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Index.java?rev=1207782&r1=1207781&r2=1207782&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Index.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Index.java
Tue Nov 29 08:33:03 2011
@@ -57,6 +57,7 @@ public class Index implements WHIndex
   protected TableStore ts;
   protected Table table;
   protected LongValue indexID;
+  protected long indexIDValue;
   protected String[] columnNames;
   protected WHComparator[] comparators;
   protected boolean unique;
@@ -70,6 +71,7 @@ public class Index implements WHIndex
     this.ts = ts;
     this.table = table;
     this.indexID = indexID;
+    this.indexIDValue = indexID.getValue();
     this.columnNames = columnNames;
     this.unique = unique;
     this.comparators = new WHComparator[comparatorClasses.length];
@@ -82,7 +84,7 @@ public class Index implements WHIndex
     }
     catch (Exception e)
     {
-      throw new WHException("Error instantiating comparator class for index '"+new Long(indexID.getValue()).toString()+"':
"+e.getMessage(),e);
+      throw new WHException("Error instantiating comparator class for index '"+new Long(indexIDValue).toString()+"':
"+e.getMessage(),e);
     }
   }
   
@@ -146,6 +148,11 @@ public class Index implements WHIndex
     return indexID;
   }
   
+  protected long getIDValue()
+  {
+    return indexIDValue;
+  }
+  
   protected Table getTable()
   {
     return table;
@@ -167,7 +174,7 @@ public class Index implements WHIndex
     // The algorithm here simply involves finding the right spot and adding a new node at
that point.
     // We should also rebalance the tree at that point, but that's going to be implemented
in phase II.
     
-    addNodeInto(rowID,new IndexRootKey(indexID.getValue()));
+    addNodeInto(rowID,new IndexRootKey(indexIDValue));
   }
   
   /** Method to add a given node into a subtree where we start only with a parent key.
@@ -206,7 +213,7 @@ public class Index implements WHIndex
       {
         // Set the node in place
         setIndexParentChild(parentKey,columnName,rowID);
-        return new IndexNodeColumnKey(indexID.getValue(),rowID.getValue(),columnName);
+        return new IndexNodeColumnKey(indexIDValue,rowID.getValue(),columnName);
       }
 
       //if (hitSoFar.contains(currentRowID))
@@ -224,11 +231,11 @@ public class Index implements WHIndex
       {
       case WHComparator.RESULT_LESS:
         // Descend the lesser tree for this column.
-        parentKey = new IndexNodeLesserKey(indexID.getValue(),currentRowID.getValue(),columnName);
+        parentKey = new IndexNodeLesserKey(indexIDValue,currentRowID.getValue(),columnName);
         continue;
       case WHComparator.RESULT_GREATER:
         // Descend the greater tree for this column.
-        parentKey = new IndexNodeGreaterKey(indexID.getValue(),currentRowID.getValue(),columnName);
+        parentKey = new IndexNodeGreaterKey(indexIDValue,currentRowID.getValue(),columnName);
         continue;
       case WHComparator.RESULT_EQUALS:
         // Insert here!  into the chain if need be...
@@ -240,7 +247,7 @@ public class Index implements WHIndex
       if (unique && columnIndex +1 == columnNames.length)
       {
         // Unique constraint violation
-        throw new WHUniqueConstraintViolationException("Row "+new Long(rowID.getValue()).toString()+"
violates uniqueness constraint on index "+new Long(indexID.getValue()).toString());
+        throw new WHUniqueConstraintViolationException("Row "+new Long(rowID.getValue()).toString()+"
violates uniqueness constraint on index "+new Long(indexIDValue).toString());
       }
       
       // We keep a linked list of identical nodes.  We can insert into that chain at any
point.
@@ -261,7 +268,7 @@ public class Index implements WHIndex
       // Now, set the new ref.
       setIndexNodeEqualsNode(currentRowID,columnName,rowID);
       
-      return new IndexNodeColumnKey(indexID.getValue(),currentRowID.getValue(),columnName);
+      return new IndexNodeColumnKey(indexIDValue,currentRowID.getValue(),columnName);
     }
   }
   
@@ -395,7 +402,7 @@ public class Index implements WHIndex
   protected void remove()
     throws WHException
   {
-    deleteBtree(new IndexRootKey(indexID.getValue()),0);
+    deleteBtree(new IndexRootKey(indexIDValue),0);
   }
   
   /** Delete a single btree with specified column index.
@@ -417,11 +424,11 @@ public class Index implements WHIndex
     // First, unlink from the parent.
     deleteIndexParentChild(key,columnName);
     // Recursively clean up all child links.
-    deleteBtree(new IndexNodeEqualsKey(indexID.getValue(),child.getValue(),columnName),indexColumn);
-    deleteBtree(new IndexNodeLesserKey(indexID.getValue(),child.getValue(),columnName),indexColumn);
-    deleteBtree(new IndexNodeGreaterKey(indexID.getValue(),child.getValue(),columnName),indexColumn);
+    deleteBtree(new IndexNodeEqualsKey(indexIDValue,child.getValue(),columnName),indexColumn);
+    deleteBtree(new IndexNodeLesserKey(indexIDValue,child.getValue(),columnName),indexColumn);
+    deleteBtree(new IndexNodeGreaterKey(indexIDValue,child.getValue(),columnName),indexColumn);
     // Move on to next column
-    deleteBtree(new IndexNodeColumnKey(indexID.getValue(),child.getValue(),columnName),indexColumn+1);
+    deleteBtree(new IndexNodeColumnKey(indexIDValue,child.getValue(),columnName),indexColumn+1);
   }
   
   // Protected methods
@@ -432,7 +439,7 @@ public class Index implements WHIndex
   protected LongValue readIndexNodeColumnNode(LongValue rowID, String columnName)
     throws WHException
   {
-    return (LongValue)ts.get(new IndexNodeColumnKey(indexID.getValue(),rowID.getValue(),columnName));
+    return (LongValue)ts.get(new IndexNodeColumnKey(indexIDValue,rowID.getValue(),columnName));
   }
   
   /** Set next column's root node for an index node.
@@ -440,8 +447,8 @@ public class Index implements WHIndex
   protected void setIndexNodeColumnNode(LongValue rowID, String columnName, LongValue refRowID)
     throws WHException
   {
-    IndexNodeColumnKey key = new IndexNodeColumnKey(indexID.getValue(),rowID.getValue(),columnName);
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),refRowID.getValue(),columnName);
+    IndexNodeColumnKey key = new IndexNodeColumnKey(indexIDValue,rowID.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,refRowID.getValue(),columnName);
     ts.put(key,refRowID);
     ts.put(parentKey,key);
   }
@@ -451,11 +458,11 @@ public class Index implements WHIndex
   protected void deleteIndexNodeColumnNode(LongValue rowID, String columnName)
     throws WHException
   {
-    IndexNodeColumnKey key = new IndexNodeColumnKey(indexID.getValue(),rowID.getValue(),columnName);
+    IndexNodeColumnKey key = new IndexNodeColumnKey(indexIDValue,rowID.getValue(),columnName);
     LongValue childReference = (LongValue)ts.get(key);
     if (childReference == null)
       throw new WHConcurrencyException();
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),childReference.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,childReference.getValue(),columnName);
     ts.put(key,null);
     ts.put(parentKey,null);
   }
@@ -465,7 +472,7 @@ public class Index implements WHIndex
   protected LongValue readIndexNodeLesserNode(LongValue rowID, String columnName)
     throws WHException
   {
-    return (LongValue)ts.get(new IndexNodeLesserKey(indexID.getValue(),rowID.getValue(),columnName));
+    return (LongValue)ts.get(new IndexNodeLesserKey(indexIDValue,rowID.getValue(),columnName));
   }
 
   /** Set the lesser child reference for an index node.  Presumes that no such reference
already exists.
@@ -473,8 +480,8 @@ public class Index implements WHIndex
   protected void setIndexNodeLesserNode(LongValue rowID, String columnName, LongValue refRowID)
     throws WHException
   {
-    IndexNodeLesserKey key = new IndexNodeLesserKey(indexID.getValue(),rowID.getValue(),columnName);
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),refRowID.getValue(),columnName);
+    IndexNodeLesserKey key = new IndexNodeLesserKey(indexIDValue,rowID.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,refRowID.getValue(),columnName);
     ts.put(key,refRowID);
     ts.put(parentKey,key);
   }
@@ -484,11 +491,11 @@ public class Index implements WHIndex
   protected void deleteIndexNodeLesserNode(LongValue rowID, String columnName)
     throws WHException
   {
-    IndexNodeLesserKey key = new IndexNodeLesserKey(indexID.getValue(),rowID.getValue(),columnName);
+    IndexNodeLesserKey key = new IndexNodeLesserKey(indexIDValue,rowID.getValue(),columnName);
     LongValue childReference = (LongValue)ts.get(key);
     if (childReference == null)
       throw new WHConcurrencyException();
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),childReference.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,childReference.getValue(),columnName);
     ts.put(key,null);
     ts.put(parentKey,null);
   }
@@ -498,7 +505,7 @@ public class Index implements WHIndex
   protected LongValue readIndexNodeGreaterNode(LongValue rowID, String columnName)
     throws WHException
   {
-    return (LongValue)ts.get(new IndexNodeGreaterKey(indexID.getValue(),rowID.getValue(),columnName));
+    return (LongValue)ts.get(new IndexNodeGreaterKey(indexIDValue,rowID.getValue(),columnName));
   }
   
   /** Set the greater child reference for an index node.  Presumes that the reference is
currently empty.
@@ -506,8 +513,8 @@ public class Index implements WHIndex
   protected void setIndexNodeGreaterNode(LongValue rowID, String columnName, LongValue refRowID)
     throws WHException
   {
-    IndexNodeGreaterKey key = new IndexNodeGreaterKey(indexID.getValue(),rowID.getValue(),columnName);
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),refRowID.getValue(),columnName);
+    IndexNodeGreaterKey key = new IndexNodeGreaterKey(indexIDValue,rowID.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,refRowID.getValue(),columnName);
     ts.put(key,refRowID);
     ts.put(parentKey,key);
   }
@@ -517,11 +524,11 @@ public class Index implements WHIndex
   protected void deleteIndexNodeGreaterNode(LongValue rowID, String columnName)
     throws WHException
   {
-    IndexNodeGreaterKey key = new IndexNodeGreaterKey(indexID.getValue(),rowID.getValue(),columnName);
+    IndexNodeGreaterKey key = new IndexNodeGreaterKey(indexIDValue,rowID.getValue(),columnName);
     LongValue childReference = (LongValue)ts.get(key);
     if (childReference == null)
       throw new WHConcurrencyException();
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),childReference.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,childReference.getValue(),columnName);
     ts.put(key,null);
     ts.put(parentKey,null);
   }
@@ -531,7 +538,7 @@ public class Index implements WHIndex
   protected LongValue readIndexNodeEqualsNode(LongValue rowID, String columnName)
     throws WHException
   {
-    return (LongValue)ts.get(new IndexNodeEqualsKey(indexID.getValue(),rowID.getValue(),columnName));
+    return (LongValue)ts.get(new IndexNodeEqualsKey(indexIDValue,rowID.getValue(),columnName));
   }
   
   /** Set the equals child reference for an index node.  Presumes that a reference doesn't
yet exist.
@@ -539,8 +546,8 @@ public class Index implements WHIndex
   protected void setIndexNodeEqualsNode(LongValue rowID, String columnName, LongValue refRowID)
     throws WHException
   {
-    IndexNodeEqualsKey key = new IndexNodeEqualsKey(indexID.getValue(),rowID.getValue(),columnName);
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),refRowID.getValue(),columnName);
+    IndexNodeEqualsKey key = new IndexNodeEqualsKey(indexIDValue,rowID.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,refRowID.getValue(),columnName);
     ts.put(key,refRowID);
     ts.put(parentKey,key);
   }
@@ -550,11 +557,11 @@ public class Index implements WHIndex
   protected void deleteIndexNodeEqualsNode(LongValue rowID, String columnName)
     throws WHException
   {
-    IndexNodeEqualsKey key = new IndexNodeEqualsKey(indexID.getValue(),rowID.getValue(),columnName);
+    IndexNodeEqualsKey key = new IndexNodeEqualsKey(indexIDValue,rowID.getValue(),columnName);
     LongValue childReference = (LongValue)ts.get(key);
     if (childReference == null)
       throw new WHConcurrencyException();
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),childReference.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,childReference.getValue(),columnName);
     ts.put(key,null);
     ts.put(parentKey,null);
   }
@@ -564,7 +571,7 @@ public class Index implements WHIndex
   protected WHKey readIndexNodeParentKey(LongValue rowID, String columnName)
     throws WHException
   {
-    WHKey rval = (WHKey)ts.get(new IndexNodeParentKey(indexID.getValue(),rowID.getValue(),columnName));
+    WHKey rval = (WHKey)ts.get(new IndexNodeParentKey(indexIDValue,rowID.getValue(),columnName));
     if (rval == null)
       throw new WHConcurrencyException();
     return rval;
@@ -584,7 +591,7 @@ public class Index implements WHIndex
     throws WHException
   {
     ts.put(parentKey,rowID);
-    ts.put(new IndexNodeParentKey(indexID.getValue(),rowID.getValue(),columnName),parentKey);
+    ts.put(new IndexNodeParentKey(indexIDValue,rowID.getValue(),columnName),parentKey);
   }
   
   /** Remove an index parent's child node reference.  Presumes that this child exists.
@@ -597,7 +604,7 @@ public class Index implements WHIndex
     if (childNodeRef == null)
       throw new WHConcurrencyException();
     ts.put(parentKey,null);
-    ts.put(new IndexNodeParentKey(indexID.getValue(),childNodeRef.getValue(),columnName),null);
+    ts.put(new IndexNodeParentKey(indexIDValue,childNodeRef.getValue(),columnName),null);
   }
   
   /** Get the root pointer for an index.
@@ -605,7 +612,7 @@ public class Index implements WHIndex
   protected LongValue readIndexRootNode()
     throws WHException
   {
-    return (LongValue)ts.get(new IndexRootKey(indexID.getValue()));
+    return (LongValue)ts.get(new IndexRootKey(indexIDValue));
   }
   
   /** Set the root pointer for an index.  Presumes the root pointer does not currently exist.
@@ -613,8 +620,8 @@ public class Index implements WHIndex
   protected void setIndexRootNode(LongValue rootRowID, String columnName)
     throws WHException
   {
-    IndexRootKey key = new IndexRootKey(indexID.getValue());
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),rootRowID.getValue(),columnName);
+    IndexRootKey key = new IndexRootKey(indexIDValue);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,rootRowID.getValue(),columnName);
     ts.put(key,rootRowID);
     ts.put(parentKey,key);
   }
@@ -624,11 +631,11 @@ public class Index implements WHIndex
   protected void deleteIndexRootNode(String columnName)
     throws WHException
   {
-    IndexRootKey key = new IndexRootKey(indexID.getValue());
+    IndexRootKey key = new IndexRootKey(indexIDValue);
     LongValue childReference = (LongValue)ts.get(key);
     if (childReference == null)
       throw new WHConcurrencyException();
-    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexID.getValue(),childReference.getValue(),columnName);
+    IndexNodeParentKey parentKey = new IndexNodeParentKey(indexIDValue,childReference.getValue(),columnName);
     ts.put(key,null);
     ts.put(parentKey,null);
   }

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Table.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Table.java?rev=1207782&r1=1207781&r2=1207782&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Table.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/Table.java
Tue Nov 29 08:33:03 2011
@@ -29,6 +29,7 @@ public class Table implements WHTable
 {
   protected TableStore ts;
   protected LongValue tableID;
+  protected long tableIDValue;
   protected String[] columns;
   
   /** Constructor */
@@ -36,6 +37,7 @@ public class Table implements WHTable
   {
     this.ts = ts;
     this.tableID = tableID;
+    this.tableIDValue = tableID.getValue();
     this.columns = columns;
   }
   
@@ -146,6 +148,11 @@ public class Table implements WHTable
     return tableID;
   }
   
+  protected long getIDValue()
+  {
+    return tableIDValue;
+  }
+  
   /** Remove all rows.
   * WARNING: This effectively causes the entire table to have to fit into memory!
   * It is better to delete rows piecemeal in separate transactions.
@@ -165,36 +172,36 @@ public class Table implements WHTable
   {
     if (ts.randomDecision())
     {
-      TableTailKey tailKey = new TableTailKey(tableID.getValue());
+      TableTailKey tailKey = new TableTailKey(tableIDValue);
       LongValue tailValue = (LongValue)ts.get(tailKey);
       if (tailValue == null)
       {
         // First row.  Set the head.
-        ts.put(new TableHeadKey(tableID.getValue()),rowID);
+        ts.put(new TableHeadKey(tableIDValue),rowID);
       }
       else
       {
         // Set the next pointer for last row.
-        ts.put(new TableRowNextKey(tableID.getValue(),tailValue.getValue()),rowID);
-        ts.put(new TableRowPrevKey(tableID.getValue(),rowID.getValue()),tailValue);
+        ts.put(new TableRowNextKey(tableIDValue,tailValue.getValue()),rowID);
+        ts.put(new TableRowPrevKey(tableIDValue,rowID.getValue()),tailValue);
       }
       // Set the tail pointer to the new record
       ts.put(tailKey,rowID);
     }
     else
     {
-      TableHeadKey headKey = new TableHeadKey(tableID.getValue());
+      TableHeadKey headKey = new TableHeadKey(tableIDValue);
       LongValue headValue = (LongValue)ts.get(headKey);
       if (headValue == null)
       {
         // First row.  Set the tail.
-        ts.put(new TableTailKey(tableID.getValue()),rowID);
+        ts.put(new TableTailKey(tableIDValue),rowID);
       }
       else
       {
         // Set the prev pointer for first row.
-        ts.put(new TableRowPrevKey(tableID.getValue(),headValue.getValue()),rowID);
-        ts.put(new TableRowNextKey(tableID.getValue(),rowID.getValue()),headValue);
+        ts.put(new TableRowPrevKey(tableIDValue,headValue.getValue()),rowID);
+        ts.put(new TableRowNextKey(tableIDValue,rowID.getValue()),headValue);
       }
       // Set the tail pointer to the new record
       ts.put(headKey,rowID);
@@ -206,25 +213,25 @@ public class Table implements WHTable
   protected void removeTableRow(LongValue rowID)
     throws WHException
   {
-    LongValue prevValue = (LongValue)ts.get(new TableRowPrevKey(tableID.getValue(),rowID.getValue()));
-    LongValue nextValue = (LongValue)ts.get(new TableRowNextKey(tableID.getValue(),rowID.getValue()));
+    LongValue prevValue = (LongValue)ts.get(new TableRowPrevKey(tableIDValue,rowID.getValue()));
+    LongValue nextValue = (LongValue)ts.get(new TableRowNextKey(tableIDValue,rowID.getValue()));
     // Fix up the previous pointer reference
     if (prevValue == null)
     {
-      ts.put(new TableHeadKey(tableID.getValue()),nextValue);
+      ts.put(new TableHeadKey(tableIDValue),nextValue);
     }
     else
     {
-      ts.put(new TableRowNextKey(tableID.getValue(),prevValue.getValue()),nextValue);
+      ts.put(new TableRowNextKey(tableIDValue,prevValue.getValue()),nextValue);
     }
     // Fix up the next pointer reference
     if (nextValue == null)
     {
-      ts.put(new TableTailKey(tableID.getValue()),prevValue);
+      ts.put(new TableTailKey(tableIDValue),prevValue);
     }
     else
     {
-      ts.put(new TableRowPrevKey(tableID.getValue(),nextValue.getValue()),prevValue);
+      ts.put(new TableRowPrevKey(tableIDValue,nextValue.getValue()),prevValue);
     }
   }
   
@@ -233,7 +240,7 @@ public class Table implements WHTable
   protected void setTableColumnValue(LongValue rowID, String columnName, WHValue value)
     throws WHException
   {
-    ts.put(new TableColumnKey(tableID.getValue(),rowID.getValue(),columnName),value);
+    ts.put(new TableColumnKey(tableIDValue,rowID.getValue(),columnName),value);
   }
   
   /** Get a table column value.
@@ -241,7 +248,7 @@ public class Table implements WHTable
   protected WHValue getTableColumnValue(LongValue rowID, String columnName)
     throws WHException
   {
-    return ts.get(new TableColumnKey(tableID.getValue(),rowID.getValue(),columnName));
+    return ts.get(new TableColumnKey(tableIDValue,rowID.getValue(),columnName));
   }
 
   
@@ -250,7 +257,7 @@ public class Table implements WHTable
   protected LongValue readFirstTableRowID()
     throws WHException
   {
-    return (LongValue)ts.get(new TableHeadKey(tableID.getValue()));
+    return (LongValue)ts.get(new TableHeadKey(tableIDValue));
   }
   
   /** Reade the next table row ID.
@@ -259,7 +266,7 @@ public class Table implements WHTable
     throws WHException
   {
     // Read the row's next pointer
-    return (LongValue)ts.get(new TableRowNextKey(tableID.getValue(),currentRowID.getValue()));
+    return (LongValue)ts.get(new TableRowNextKey(tableIDValue,currentRowID.getValue()));
   }
   
 }
\ No newline at end of file

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableStore.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableStore.java?rev=1207782&r1=1207781&r2=1207782&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableStore.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableStore.java
Tue Nov 29 08:33:03 2011
@@ -156,10 +156,10 @@ public class TableStore implements WHTab
       throw new WHException("Index already exists");
     LongValue indexID = allocateNewGeneralID();
     setIndexName(indexID,name);
-    currentTransaction.put(new IndexKey(indexID.getValue()),new IndexValue(t.getID().getValue(),columnNames,comparatorClasses,unique));
+    currentTransaction.put(new IndexKey(indexID.getValue()),new IndexValue(t.getIDValue(),columnNames,comparatorClasses,unique));
     Index i = new Index(this,indexID,t,columnNames,comparatorClasses,unique);
     indexes.put(indexID,i);
-    TableIndexKey tik = new TableIndexKey(t.getID().getValue());
+    TableIndexKey tik = new TableIndexKey(t.getIDValue());
     LongArray tiv = (LongArray)currentTransaction.get(tik);
     if (tiv == null)
       throw new WHConcurrencyException();
@@ -345,8 +345,8 @@ public class TableStore implements WHTab
     // Delete the keys that belong to the table, and clean up cached values
     tables.remove(t.getID());
     indexesPerTable.remove(t.getID());
-    currentTransaction.put(new TableIndexKey(t.getID().getValue()),null);
-    currentTransaction.put(new TableRowIDFactoryKey(t.getID().getValue()),null);
+    currentTransaction.put(new TableIndexKey(t.getIDValue()),null);
+    currentTransaction.put(new TableRowIDFactoryKey(t.getIDValue()),null);
     removeTableName(t.getID());
   }
   
@@ -364,16 +364,16 @@ public class TableStore implements WHTab
     int k = 0;
     for (int j = 0 ; j < indexList.length ; j++)
     {
-      if (indexList[j].getID().getValue() != i.getID().getValue())
+      if (indexList[j].getIDValue() != i.getIDValue())
       {
-        newIndexList[k++] = indexList[j].getID().getValue();
+        newIndexList[k++] = indexList[j].getIDValue();
         if (k == newIndexList.length)
           break;
       }
     }
     if (k != newIndexList.length)
       throw new WHConcurrencyException();
-    currentTransaction.put(new TableIndexKey(t.getID().getValue()),new LongArray(newIndexList));
+    currentTransaction.put(new TableIndexKey(t.getIDValue()),new LongArray(newIndexList));
     indexesPerTable.remove(t.getID());
 
     i.remove();



Mime
View raw message