manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1203618 - in /incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog: interfaces/ tablestore/
Date Fri, 18 Nov 2011 12:05:40 GMT
Author: kwright
Date: Fri Nov 18 12:05:39 2011
New Revision: 1203618

URL: http://svn.apache.org/viewvc?rev=1203618&view=rev
Log:
Use longs instead of ints for row identifiers.  That way we won't need to reuse identifiers.

Modified:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryRelationship.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/TableRelationship.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessor.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHColumnDescription.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryResult.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationship.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
    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/interfaces/FilterRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
Fri Nov 18 12:05:39 2011
@@ -40,11 +40,11 @@ public class FilterRelationship implemen
     return relationshipToFilter.getColumnNames();
   }
   
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException
   {
-    return relationshipToFilter.getValue(rowNumber,columnName);
+    return relationshipToFilter.getValue(rowID,columnName);
   }
 
   /** Get the row accessor.  This determines
@@ -59,10 +59,10 @@ public class FilterRelationship implemen
   
   /** Override this method to control filtering.
   */
-  protected boolean include(int rowNumber)
+  protected boolean include(long rowID)
     throws WHException
   {
-    return filterer.include(this,rowNumber);
+    return filterer.include(this,rowID);
   }
   
   /** Accessor class that performs generic filtering.
@@ -70,7 +70,7 @@ public class FilterRelationship implemen
   protected class FilterAccessor implements WHAccessor
   {
     protected WHAccessor baseAccessor;
-    protected int nextRow = -1;
+    protected long nextRow = -1L;
     
     public FilterAccessor()
       throws WHException
@@ -83,39 +83,39 @@ public class FilterRelationship implemen
     public boolean hasNext()
       throws WHException
     {
-      if (nextRow == -1)
+      if (nextRow == -1L)
       {
 	// Locate the next row, or bump into the end.
 	nextRow = findNextRow();
-	if (nextRow == -1)
+	if (nextRow == -1L)
 	  return false;
       }
       return true;
     }
     
-    /** Read the next matching relationship row number,
+    /** Read the next matching relationship row ID,
     */
-    public int getNext()
+    public long getNext()
       throws WHException
     {
-      if (nextRow == -1)
+      if (nextRow == -1L)
 	nextRow = findNextRow();
-      int rval = nextRow;
-      nextRow = -1;
+      long rval = nextRow;
+      nextRow = -1L;
       return rval;
     }
 
     /** Find the next (filtered) row */
-    protected int findNextRow()
+    protected long findNextRow()
       throws WHException
     {
       while (baseAccessor.hasNext())
       {
-	int theRow = baseAccessor.getNext();
+	long theRow = baseAccessor.getNext();
 	if (include(theRow))
 	  return theRow;
       }
-      return -1;
+      return -1L;
     }
   }
   

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java
Fri Nov 18 12:05:39 2011
@@ -35,8 +35,8 @@ public class JoinRelationship implements
     return null;
   }
 
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException
   {
     // MHL

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryRelationship.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryRelationship.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryRelationship.java
Fri Nov 18 12:05:39 2011
@@ -38,11 +38,11 @@ public class QueryRelationship implement
     return queryResult.getColumnNames();
   }
   
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException
   {
-    return queryResult.getValue(rowNumber, columnName);
+    return queryResult.getValue(rowID, columnName);
   }
 
   /** Get the row accessor.  This determines

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
Fri Nov 18 12:05:39 2011
@@ -42,10 +42,10 @@ public class SubqueryFilter implements W
   
   /** Check if a row should be filtered or not.
   */
-  public boolean include(WHRelationship relationship, int rowNumber)
+  public boolean include(WHRelationship relationship, long rowID)
     throws WHException
   {
-    WHAccessor accessor = builder.createAccessor(relationship,rowNumber);
+    WHAccessor accessor = builder.createAccessor(relationship,rowID);
     return accessor.hasNext() == isExists;
   }
 

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/TableRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/TableRelationship.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/TableRelationship.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/TableRelationship.java
Fri Nov 18 12:05:39 2011
@@ -38,11 +38,11 @@ public class TableRelationship implement
     return table.getColumnNames();
   }
   
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException
   {
-    return table.getValue(rowNumber,columnName);
+    return table.getValue(rowID,columnName);
   }
   
   /** Get the row accessor.  This determines

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessor.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessor.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessor.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessor.java
Fri Nov 18 12:05:39 2011
@@ -29,8 +29,8 @@ public interface WHAccessor
   public boolean hasNext()
     throws WHException;
   
-  /** Read the next matching relationship row number,
+  /** Read the next matching relationship row ID,
   */
-  public int getNext()
+  public long getNext()
     throws WHException;
 }

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java
Fri Nov 18 12:05:39 2011
@@ -28,7 +28,7 @@ public interface WHAccessorBuilder
   * relationship.
   */
   public WHAccessor createAccessor(WHRelationship relationship,
-    int rowNumber)
+    long rowID)
     throws WHException;
   
 }
\ No newline at end of file

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHColumnDescription.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHColumnDescription.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHColumnDescription.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHColumnDescription.java
Fri Nov 18 12:05:39 2011
@@ -35,7 +35,7 @@ public interface WHColumnDescription
   /** Feed a row to the column calculator.
   *@return a non-null value if there is a result, or null if no result yet.
   */
-  public WHValue appendRowValue(WHRelationship relationship, int rowNumber)
+  public WHValue appendRowValue(WHRelationship relationship, long rowID)
     throws WHException;
   
   /** End, obtaining the current aggregate value, if any.  Also resets in preparation for
calculation

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
Fri Nov 18 12:05:39 2011
@@ -25,7 +25,7 @@ public interface WHFilter
 {
   /** Check if a row should be filtered or not.
   */
-  public boolean include(WHRelationship relationship, int rowNumber)
+  public boolean include(WHRelationship relationship, long rowID)
     throws WHException;
   
 }

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryResult.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryResult.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryResult.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryResult.java
Fri Nov 18 12:05:39 2011
@@ -31,6 +31,6 @@ public interface WHQueryResult
     throws WHException;
   
   /** Get a value for the result. */
-  public WHValue getValue(int rowNumber, String columnName)
+  public WHValue getValue(long rowID, String columnName)
     throws WHException;
 }

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationship.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationship.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationship.java
Fri Nov 18 12:05:39 2011
@@ -29,8 +29,8 @@ public interface WHRelationship
   public String[] getColumnNames()
     throws WHException;
   
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException;
 
   /** Get the row accessor.  This determines

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java?rev=1203618&r1=1203617&r2=1203618&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
Fri Nov 18 12:05:39 2011
@@ -30,11 +30,6 @@ public interface WHTable
   public String[] getColumnNames()
     throws WHException;
   
-  /** Compact the table.
-  */
-  public void compact()
-    throws WHException;
-  
   /** Insert a row */
   public void insertRow(String[] columns, WHValue[] values)
     throws WHException;
@@ -48,21 +43,12 @@ public interface WHTable
   public void deleteRows(WHAccessor accessor, WHFilter filter)
     throws WHException;
   
-  // Below this point is the 'non-public' part of the API, which may eventually be moved
into implementation classes.
-  
-  /** Get the row count */
-  public int getRowCount()
-    throws WHException;
-  
-  /** Get the max row number, plus one */
-  public int getMaxRowNumber()
-    throws WHException;
-    
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException;
 
   /** Build an accessor that simply scans all the rows in the table */
-  public WHAccessor buildAccessor();
+  public WHAccessor buildAccessor()
+    throws WHException;
 
 }
\ No newline at end of file

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=1203618&r1=1203617&r2=1203618&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
Fri Nov 18 12:05:39 2011
@@ -85,7 +85,7 @@ public class Index implements WHIndex
   
   /** Add a new row to the index.
   */
-  public void addNewRow(int rowNumber)
+  public void addNewRow(long rowID)
     throws WHException
   {
     // MHL
@@ -93,7 +93,7 @@ public class Index implements WHIndex
   
   /** Remove a row from the index.  The row must currently exist.
   */
-  public void deleteRow(int rowNumber)
+  public void deleteRow(long rowID)
     throws WHException
   {
     // MHL

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=1203618&r1=1203617&r2=1203618&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
Fri Nov 18 12:05:39 2011
@@ -75,26 +75,8 @@ public class Table implements WHTable
     // MHL
   }
   
-  // Below this point is the 'non-public' part of the API, which may eventually be moved
into implementation classes.
-  
-  /** Get the row count */
-  public int getRowCount()
-    throws WHException
-  {
-    // MHL
-    return -1;
-  }
-  
-  /** Get the max row number, plus one */
-  public int getMaxRowNumber()
-    throws WHException
-  {
-    // MHL
-    return -1;
-  }
-    
-  /** Get the data for a given row # and column. */
-  public WHValue getValue(int rowNumber, String columnName)
+  /** Get the data for a given row and column. */
+  public WHValue getValue(long rowID, String columnName)
     throws WHException
   {
     // MHL
@@ -103,6 +85,7 @@ public class Table implements WHTable
 
   /** Build an accessor that simply scans all the rows in the table */
   public WHAccessor buildAccessor()
+    throws WHException
   {
     // MHL
     return null;
@@ -118,18 +101,18 @@ public class Table implements WHTable
   
   /** Delete a specified table row from all indexes attached to the table.
   */
-  protected void deleteRowFromIndexes(int rowNumber)
+  protected void deleteRowFromIndexes(long rowID)
     throws WHException
   {
-    ts.deleteIndexRow(tableName,rowNumber);
+    ts.deleteIndexRow(tableName,rowID);
   }
   
   /** Add a specified table row to all indexes attached to the table.
   */
-  protected void addRowToIndexes(int rowNumber)
+  protected void addRowToIndexes(long rowID)
     throws WHException
   {
-    ts.addIndexRow(tableName,rowNumber);
+    ts.addIndexRow(tableName,rowID);
   }
   
 }
\ 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=1203618&r1=1203617&r2=1203618&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
Fri Nov 18 12:05:39 2011
@@ -109,7 +109,7 @@ public class TableStore implements WHTab
     TableIndexValue tiv = new TableIndexValue(new String[0]);
     currentTransaction.put(tik,tiv);
     TableRowIDFactoryKey tlk = new TableRowIDFactoryKey(name);
-    currentTransaction.put(tlk,new IntegerValue(0));
+    currentTransaction.put(tlk,new LongValue(0L));
     return t;
   }
   
@@ -165,7 +165,7 @@ public class TableStore implements WHTab
     currentTransaction.put(tik,tiv);
     indexesPerTable.remove(t.getName());
     IndexNodeIDFactoryKey tlk = new IndexNodeIDFactoryKey(name);
-    currentTransaction.put(tlk,new IntegerValue(0));
+    currentTransaction.put(tlk,new LongValue(0L));
     return i;
   }
     
@@ -195,25 +195,25 @@ public class TableStore implements WHTab
   
   /** Delete a table row from all the indexes that are based on a table.
   */
-  public void deleteIndexRow(String tableName, int rowNumber)
+  public void deleteIndexRow(String tableName, long rowID)
     throws WHException
   {
     Index[] indexes = findIndexes(tableName);
     for (int i = 0 ; i < indexes.length ; i++)
     {
-      indexes[i].deleteRow(rowNumber);
+      indexes[i].deleteRow(rowID);
     }
   }
   
   /** Add a table row to all the indexes that are based on a table.
   */
-  public void addIndexRow(String tableName, int rowNumber)
+  public void addIndexRow(String tableName, long rowID)
     throws WHException
   {
     Index[] indexes = findIndexes(tableName);
     for (int i = 0 ; i < indexes.length ; i++)
     {
-      indexes[i].addNewRow(rowNumber);
+      indexes[i].addNewRow(rowID);
     }
   }
   
@@ -225,31 +225,31 @@ public class TableStore implements WHTab
   // otherwise the same row numbers can be allocated by two threads inadvertently.  The added
complexity
   // must therefore be worth it, and so far I'm not sure that is the case.
   
-  /** Allocate the next table row number.
+  /** Allocate the next table row ID.
   */
-  public int allocateNewTableRow(String tableName)
+  public long allocateNewTableRow(String tableName)
     throws WHException
   {
     TableRowIDFactoryKey tlk = new TableRowIDFactoryKey(tableName);
-    IntegerValue tlv = (IntegerValue)currentTransaction.get(tlk);
+    LongValue tlv = (LongValue)currentTransaction.get(tlk);
     if (tlv == null)
       throw new WHDeadlockException();
-    int rval = tlv.getValue();
-    currentTransaction.put(tlk,new IntegerValue(rval+1));
+    long rval = tlv.getValue();
+    currentTransaction.put(tlk,new LongValue(rval+1L));
     return rval;
   }
   
   /** Allocate the next index node number.
   */
-  public int allocateNextIndexNode(String indexName)
+  public long allocateNextIndexNode(String indexName)
     throws WHException
   {
     IndexNodeIDFactoryKey tlk = new IndexNodeIDFactoryKey(indexName);
-    IntegerValue tlv = (IntegerValue)currentTransaction.get(tlk);
+    LongValue tlv = (LongValue)currentTransaction.get(tlk);
     if (tlv == null)
       throw new WHDeadlockException();
-    int rval = tlv.getValue();
-    currentTransaction.put(tlk,new IntegerValue(rval+1));
+    long rval = tlv.getValue();
+    currentTransaction.put(tlk,new LongValue(rval+1L));
     return rval;
   }
   
@@ -548,7 +548,7 @@ public class TableStore implements WHTab
 
   }
 
-  // IndexNodeIDFactoryValue is just IntegerValue
+  // IndexNodeIDFactoryValue is just LongValue
 
   // Table head pointer key/value
   
@@ -566,7 +566,7 @@ public class TableStore implements WHTab
     }
   }
 
-  // Table head value is just IntegerValue
+  // Table head value is just LongValue
 
   // Table tail pointer key/value
   
@@ -585,54 +585,101 @@ public class TableStore implements WHTab
 
   }
 
-  // Table tail value is just IntegerValue
+  // Table tail value is just LongValue
   
   // Table row prev pointer key/value
   
   protected static class TableRowPrevKey implements WHKey
   {
     protected String tableName;
-    protected int rowNumber;
+    protected long rowID;
     
     /** Constructor */
-    public TableRowPrevKey(String tableName, int rowNumber)
+    public TableRowPrevKey(String tableName, long rowID)
     {
       this.tableName = tableName;
-      this.rowNumber = rowNumber;
+      this.rowID = rowID;
     }
     
     public TableRowPrevKey(byte[] data)
     {
       BufferPointer bp = new BufferPointer(data);
       this.tableName = StringKey.readObject(bp);
-      this.rowNumber = IntegerKey.readObject(bp);
+      this.rowID = LongKey.readObject(bp);
     }
 
     public byte[] serializeObject()
     {
       byte[] rval = new byte[StringKey.sizeObject(tableName)+
-        IntegerKey.sizeObject()];
+        LongKey.sizeObject()];
       BufferPointer bp = new BufferPointer(rval);
       StringKey.writeObject(bp,tableName);
-      IntegerKey.writeObject(bp,rowNumber);
+      LongKey.writeObject(bp,rowID);
       return rval;
     }
     
     public long getHashCode()
     {
-      return StringKey.calculateHashCode(tableName) + IntegerKey.calculateHashCode(rowNumber);
+      return StringKey.calculateHashCode(tableName) + LongKey.calculateHashCode(rowID);
     }
     
     public boolean isEquals(WHKey o)
     {
       TableRowPrevKey key = (TableRowPrevKey)o;
       return key.tableName.equals(tableName) &&
-        key.rowNumber == rowNumber;
+        key.rowID == rowID;
     }
 
   }
 
-  // Table row prev pointer value is just IntegerValue
+  // Table row prev pointer value is just LongValue
   
+  // Table row next pointer key/value
   
+  protected static class TableRowNextKey implements WHKey
+  {
+    protected String tableName;
+    protected long rowID;
+    
+    /** Constructor */
+    public TableRowNextKey(String tableName, long rowID)
+    {
+      this.tableName = tableName;
+      this.rowID = rowID;
+    }
+    
+    public TableRowNextKey(byte[] data)
+    {
+      BufferPointer bp = new BufferPointer(data);
+      this.tableName = StringKey.readObject(bp);
+      this.rowID = LongKey.readObject(bp);
+    }
+
+    public byte[] serializeObject()
+    {
+      byte[] rval = new byte[StringKey.sizeObject(tableName)+
+        LongKey.sizeObject()];
+      BufferPointer bp = new BufferPointer(rval);
+      StringKey.writeObject(bp,tableName);
+      LongKey.writeObject(bp,rowID);
+      return rval;
+    }
+    
+    public long getHashCode()
+    {
+      return StringKey.calculateHashCode(tableName) + LongKey.calculateHashCode(rowID);
+    }
+    
+    public boolean isEquals(WHKey o)
+    {
+      TableRowNextKey key = (TableRowNextKey)o;
+      return key.tableName.equals(tableName) &&
+        key.rowID == rowID;
+    }
+
+  }
+
+  // Table row next pointer value is just LongValue
+  
+
 }



Mime
View raw message