incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1220353 [7/11] - in /incubator/lcf/branches/CONNECTORS-286/warthog-reimport: ./ src/main/java/org/apache/warthog/api/ src/main/java/org/apache/warthog/bytekeyvalue/ src/main/java/org/apache/warthog/common/ src/main/java/org/apache/warthog/...
Date Sun, 18 Dec 2011 08:36:56 GMT
Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeColumnKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeColumnKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeColumnKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeColumnKey.java Sun Dec 18 08:36:52 2011
@@ -1,39 +1,39 @@
-/* $Id: IndexNodeColumnKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Index node next column pointer key */
-public class IndexNodeColumnKey extends IndexNodeKey
-{
-  /** Constructor */
-  public IndexNodeColumnKey(long indexID, long rowID, long columnID)
-  {
-    super(indexID,rowID,columnID);
-  }
-    
-  public IndexNodeColumnKey(byte[] data)
-  {
-    super(data);
-  }
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Index node next column pointer key */
+public class IndexNodeColumnKey extends IndexNodeKey
+{
+  /** Constructor */
+  public IndexNodeColumnKey(long indexID, long rowID, long columnID)
+  {
+    super(indexID,rowID,columnID);
+  }
+    
+  public IndexNodeColumnKey(byte[] data)
+  {
+    super(data);
+  }
 }
\ No newline at end of file

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeColumnKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeColumnKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeEqualsKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeEqualsKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeEqualsKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeEqualsKey.java Sun Dec 18 08:36:52 2011
@@ -1,39 +1,39 @@
-/* $Id: IndexNodeEqualsKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Index node equals pointer key */
-public class IndexNodeEqualsKey extends IndexNodeKey
-{
-  /** Constructor */
-  public IndexNodeEqualsKey(long indexID, long rowID, long columnID)
-  {
-    super(indexID,rowID,columnID);
-  }
-    
-  public IndexNodeEqualsKey(byte[] data)
-  {
-    super(data);
-  }
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Index node equals pointer key */
+public class IndexNodeEqualsKey extends IndexNodeKey
+{
+  /** Constructor */
+  public IndexNodeEqualsKey(long indexID, long rowID, long columnID)
+  {
+    super(indexID,rowID,columnID);
+  }
+    
+  public IndexNodeEqualsKey(byte[] data)
+  {
+    super(data);
+  }
 }
\ No newline at end of file

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeEqualsKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeEqualsKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeGreaterKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeGreaterKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeGreaterKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeGreaterKey.java Sun Dec 18 08:36:52 2011
@@ -1,39 +1,39 @@
-/* $Id: IndexNodeGreaterKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Index node greater pointer key */
-public class IndexNodeGreaterKey extends IndexNodeKey
-{
-  /** Constructor */
-  public IndexNodeGreaterKey(long indexID, long rowID, long columnID)
-  {
-    super(indexID,rowID,columnID);
-  }
-    
-  public IndexNodeGreaterKey(byte[] data)
-  {
-    super(data);
-  }
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Index node greater pointer key */
+public class IndexNodeGreaterKey extends IndexNodeKey
+{
+  /** Constructor */
+  public IndexNodeGreaterKey(long indexID, long rowID, long columnID)
+  {
+    super(indexID,rowID,columnID);
+  }
+    
+  public IndexNodeGreaterKey(byte[] data)
+  {
+    super(data);
+  }
 }
\ No newline at end of file

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeGreaterKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeGreaterKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeKey.java Sun Dec 18 08:36:52 2011
@@ -1,96 +1,96 @@
-/* $Id: IndexNodeKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Base class for node lesser/greater keys */
-public class IndexNodeKey implements WHKey
-{
-  protected long indexID;
-  protected long rowID;
-  protected long columnID;
-  
-  /** Constructor */
-  public IndexNodeKey(long indexID, long rowID, long columnID)
-  {
-    this.indexID = indexID;
-    this.rowID = rowID;
-    this.columnID = columnID;
-  }
-    
-  public IndexNodeKey(byte[] data)
-  {
-    BufferPointer bp = new BufferPointer(data);
-    this.indexID = LongKey.readObject(bp);
-    this.rowID = LongKey.readObject(bp);
-    this.columnID = LongKey.readObject(bp);
-  }
-
-  public byte[] serializeObject()
-  {
-    byte[] rval = new byte[LongKey.sizeObject()+
-      LongKey.sizeObject() + LongKey.sizeObject()];
-    BufferPointer bp = new BufferPointer(rval);
-    LongKey.writeObject(bp,indexID);
-    LongKey.writeObject(bp,rowID);
-    LongKey.writeObject(bp,columnID);
-    return rval;
-  }
-    
-  public long getHashCode()
-  {
-    return calculateHashCode(indexID,rowID,columnID);
-  }
-  
-  public static long calculateHashCode(long indexID, long rowID, long columnID)
-  {
-    return LongKey.calculateHashCode(indexID) + LongKey.calculateHashCode(rowID) +
-      LongKey.calculateHashCode(columnID);
-  }
-    
-  public boolean isEquals(WHKeyValue o)
-  {
-    IndexNodeKey key = (IndexNodeKey)o;
-    return key.indexID == indexID &&
-      key.rowID == rowID &&
-      key.columnID == columnID;
-  }
-
-  public int hashCode()
-  {
-    return ((int)((indexID << 5) ^ (indexID >> 3))) +
-      ((int)((rowID << 5) ^ (rowID >> 3))) +
-      ((int)((columnID << 5) ^ (columnID >> 3)));
-  }
-  
-  public boolean equals(Object o)
-  {
-    if (o.getClass() != getClass())
-      return false;
-    IndexNodeKey other = (IndexNodeKey)o;
-    return other.indexID == indexID &&
-      other.rowID == rowID &&
-      other.columnID == columnID;
-  }
-  
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Base class for node lesser/greater keys */
+public class IndexNodeKey implements WHKey
+{
+  protected long indexID;
+  protected long rowID;
+  protected long columnID;
+  
+  /** Constructor */
+  public IndexNodeKey(long indexID, long rowID, long columnID)
+  {
+    this.indexID = indexID;
+    this.rowID = rowID;
+    this.columnID = columnID;
+  }
+    
+  public IndexNodeKey(byte[] data)
+  {
+    BufferPointer bp = new BufferPointer(data);
+    this.indexID = LongKey.readObject(bp);
+    this.rowID = LongKey.readObject(bp);
+    this.columnID = LongKey.readObject(bp);
+  }
+
+  public byte[] serializeObject()
+  {
+    byte[] rval = new byte[LongKey.sizeObject()+
+      LongKey.sizeObject() + LongKey.sizeObject()];
+    BufferPointer bp = new BufferPointer(rval);
+    LongKey.writeObject(bp,indexID);
+    LongKey.writeObject(bp,rowID);
+    LongKey.writeObject(bp,columnID);
+    return rval;
+  }
+    
+  public long getHashCode()
+  {
+    return calculateHashCode(indexID,rowID,columnID);
+  }
+  
+  public static long calculateHashCode(long indexID, long rowID, long columnID)
+  {
+    return LongKey.calculateHashCode(indexID) + LongKey.calculateHashCode(rowID) +
+      LongKey.calculateHashCode(columnID);
+  }
+    
+  public boolean isEquals(WHKeyValue o)
+  {
+    IndexNodeKey key = (IndexNodeKey)o;
+    return key.indexID == indexID &&
+      key.rowID == rowID &&
+      key.columnID == columnID;
+  }
+
+  public int hashCode()
+  {
+    return ((int)((indexID << 5) ^ (indexID >> 3))) +
+      ((int)((rowID << 5) ^ (rowID >> 3))) +
+      ((int)((columnID << 5) ^ (columnID >> 3)));
+  }
+  
+  public boolean equals(Object o)
+  {
+    if (o.getClass() != getClass())
+      return false;
+    IndexNodeKey other = (IndexNodeKey)o;
+    return other.indexID == indexID &&
+      other.rowID == rowID &&
+      other.columnID == columnID;
+  }
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeLesserKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeLesserKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeLesserKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeLesserKey.java Sun Dec 18 08:36:52 2011
@@ -1,39 +1,39 @@
-/* $Id: IndexNodeLesserKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Index node lesser pointer key */
-public class IndexNodeLesserKey extends IndexNodeKey
-{
-  /** Constructor */
-  public IndexNodeLesserKey(long indexID, long rowID, long columnID)
-  {
-    super(indexID,rowID,columnID);
-  }
-    
-  public IndexNodeLesserKey(byte[] data)
-  {
-    super(data);
-  }
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Index node lesser pointer key */
+public class IndexNodeLesserKey extends IndexNodeKey
+{
+  /** Constructor */
+  public IndexNodeLesserKey(long indexID, long rowID, long columnID)
+  {
+    super(indexID,rowID,columnID);
+  }
+    
+  public IndexNodeLesserKey(byte[] data)
+  {
+    super(data);
+  }
 }
\ No newline at end of file

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeLesserKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeLesserKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeParentKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeParentKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeParentKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeParentKey.java Sun Dec 18 08:36:52 2011
@@ -1,40 +1,40 @@
-/* $Id: IndexNodeParentKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Key for the btree link to its parent reference (NOT node; WHKey).  This allows
-* us to perform fast in-context deletions. */
-public class IndexNodeParentKey extends IndexNodeKey
-{
-  /** Constructor */
-  public IndexNodeParentKey(long indexID, long rowID, long columnID)
-  {
-    super(indexID,rowID,columnID);
-  }
-    
-  public IndexNodeParentKey(byte[] data)
-  {
-    super(data);
-  }
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Key for the btree link to its parent reference (NOT node; WHKey).  This allows
+* us to perform fast in-context deletions. */
+public class IndexNodeParentKey extends IndexNodeKey
+{
+  /** Constructor */
+  public IndexNodeParentKey(long indexID, long rowID, long columnID)
+  {
+    super(indexID,rowID,columnID);
+  }
+    
+  public IndexNodeParentKey(byte[] data)
+  {
+    super(data);
+  }
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeParentKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexNodeParentKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexRootKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexRootKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexRootKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexRootKey.java Sun Dec 18 08:36:52 2011
@@ -1,39 +1,39 @@
-/* $Id: IndexRootKey.java 1207727 2011-11-29 01:12:13Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Key for the btree root node link */
-public class IndexRootKey extends LongKey
-{
-  /** Constructor */
-  public IndexRootKey(long indexID)
-  {
-    super(indexID);
-  }
-    
-  public IndexRootKey(byte[] data)
-  {
-    super(data);
-  }
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Key for the btree root node link */
+public class IndexRootKey extends LongKey
+{
+  /** Constructor */
+  public IndexRootKey(long indexID)
+  {
+    super(indexID);
+  }
+    
+  public IndexRootKey(byte[] data)
+  {
+    super(data);
+  }
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexRootKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexRootKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexValue.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexValue.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexValue.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexValue.java Sun Dec 18 08:36:52 2011
@@ -1,119 +1,119 @@
-/* $Id: IndexValue.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** An index definition value */
-public class IndexValue implements WHKeyValue
-{
-  protected long tableID;
-  protected long[] columnIDs;
-  protected String[] comparatorClassNames;
-  protected boolean unique;
-    
-  /** Constructor */
-  public IndexValue(long tableID, long[] columnIDs, String[] comparatorClassNames, boolean unique)
-  {
-    this.tableID = tableID;
-    this.columnIDs = columnIDs;
-    this.comparatorClassNames = comparatorClassNames;
-    this.unique = unique;
-  }
-    
-  public IndexValue(byte[] data)
-  {
-    BufferPointer bp = new BufferPointer(data);
-    tableID = LongValue.readObject(bp);
-    columnIDs = LongArray.readObject(bp);
-    comparatorClassNames = StringArray.readObject(bp);
-    unique = BooleanValue.readObject(bp);
-  }
-    
-  public byte[] serializeObject()
-  {
-    byte[] rval = new byte[LongValue.sizeObject() +
-      LongArray.sizeObject(columnIDs.length) +
-      StringArray.sizeObject(comparatorClassNames) +
-      BooleanValue.sizeObject()];
-    BufferPointer bp = new BufferPointer(rval);
-    LongValue.writeObject(bp,tableID);
-    LongArray.writeObject(bp,columnIDs);
-    StringArray.writeObject(bp,comparatorClassNames);
-    BooleanValue.writeObject(bp,unique);
-    return rval;
-  }
-
-  /** Check if equals (classes must already agree) */
-  public boolean isEquals(WHKeyValue value)
-  {
-    IndexValue other = (IndexValue)value;
-    return other.tableID == this.tableID &&
-      LongArray.compareObject(other.columnIDs,this.columnIDs) &&
-      StringArray.compareObject(other.comparatorClassNames,this.comparatorClassNames) &&
-      other.unique == this.unique;
-  }
-  
-  public long getTableID()
-  {
-    return tableID;
-  }
-  
-  public long[] getColumnIDs()
-  {
-    return columnIDs;
-  }
-    
-  public String[] getComparatorClassNames()
-  {
-    return comparatorClassNames;
-  }
-    
-  public boolean getUnique()
-  {
-    return unique;
-  }
-  
-  public int hashCode()
-  {
-    int rval = (int)((tableID << 5) ^ (tableID >> 3));
-    for (int i = 0 ; i < columnIDs.length ; i++)
-    {
-      rval += (int)((columnIDs[i] << 5) ^ (columnIDs[i] >> 3));
-      rval += comparatorClassNames[i].hashCode();
-    }
-    rval += (unique?87245:31);
-    return rval;
-  }
-  
-  public boolean equals(Object o)
-  {
-    if (this.getClass() != o.getClass())
-      return false;
-    IndexValue other = (IndexValue)o;
-    return other.tableID == tableID &&
-      LongArray.compareObject(other.columnIDs,this.columnIDs) &&
-      StringArray.compareObject(other.comparatorClassNames,this.comparatorClassNames) &&
-      other.unique == this.unique;
-  }
-  
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** An index definition value */
+public class IndexValue implements WHKeyValue
+{
+  protected long tableID;
+  protected long[] columnIDs;
+  protected String[] comparatorClassNames;
+  protected boolean unique;
+    
+  /** Constructor */
+  public IndexValue(long tableID, long[] columnIDs, String[] comparatorClassNames, boolean unique)
+  {
+    this.tableID = tableID;
+    this.columnIDs = columnIDs;
+    this.comparatorClassNames = comparatorClassNames;
+    this.unique = unique;
+  }
+    
+  public IndexValue(byte[] data)
+  {
+    BufferPointer bp = new BufferPointer(data);
+    tableID = LongValue.readObject(bp);
+    columnIDs = LongArray.readObject(bp);
+    comparatorClassNames = StringArray.readObject(bp);
+    unique = BooleanValue.readObject(bp);
+  }
+    
+  public byte[] serializeObject()
+  {
+    byte[] rval = new byte[LongValue.sizeObject() +
+      LongArray.sizeObject(columnIDs.length) +
+      StringArray.sizeObject(comparatorClassNames) +
+      BooleanValue.sizeObject()];
+    BufferPointer bp = new BufferPointer(rval);
+    LongValue.writeObject(bp,tableID);
+    LongArray.writeObject(bp,columnIDs);
+    StringArray.writeObject(bp,comparatorClassNames);
+    BooleanValue.writeObject(bp,unique);
+    return rval;
+  }
+
+  /** Check if equals (classes must already agree) */
+  public boolean isEquals(WHKeyValue value)
+  {
+    IndexValue other = (IndexValue)value;
+    return other.tableID == this.tableID &&
+      LongArray.compareObject(other.columnIDs,this.columnIDs) &&
+      StringArray.compareObject(other.comparatorClassNames,this.comparatorClassNames) &&
+      other.unique == this.unique;
+  }
+  
+  public long getTableID()
+  {
+    return tableID;
+  }
+  
+  public long[] getColumnIDs()
+  {
+    return columnIDs;
+  }
+    
+  public String[] getComparatorClassNames()
+  {
+    return comparatorClassNames;
+  }
+    
+  public boolean getUnique()
+  {
+    return unique;
+  }
+  
+  public int hashCode()
+  {
+    int rval = (int)((tableID << 5) ^ (tableID >> 3));
+    for (int i = 0 ; i < columnIDs.length ; i++)
+    {
+      rval += (int)((columnIDs[i] << 5) ^ (columnIDs[i] >> 3));
+      rval += comparatorClassNames[i].hashCode();
+    }
+    rval += (unique?87245:31);
+    return rval;
+  }
+  
+  public boolean equals(Object o)
+  {
+    if (this.getClass() != o.getClass())
+      return false;
+    IndexValue other = (IndexValue)o;
+    return other.tableID == tableID &&
+      LongArray.compareObject(other.columnIDs,this.columnIDs) &&
+      StringArray.compareObject(other.comparatorClassNames,this.comparatorClassNames) &&
+      other.unique == this.unique;
+  }
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/IndexValue.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/Table.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/Table.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/Table.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/Table.java Sun Dec 18 08:36:52 2011
@@ -1,308 +1,308 @@
-/* $Id: Table.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-import java.util.*;
-
-/** This is the standard implementation of WHTable.
-*/
-public class Table implements WHTable
-{
-  protected TableStore ts;
-  protected LongValue tableID;
-  protected long tableIDValue;
-  protected String[] columns;
-  protected long[] columnIDs;
-  protected long nextColumnID;
-  protected Map<String,Integer> columnLookup = new HashMap<String,Integer>();
-  
-  protected static final int maxInstanceCount = 128;
-  protected static final int maxInstanceMask = maxInstanceCount-1;
-  
-  /** Constructor */
-  public Table(TableStore ts, LongValue tableID, String[] columns, long[] columnIDs, long nextColumnID)
-    throws WHException
-  {
-    if (columnIDs.length != columns.length)
-      throw new WHException("Number of column names must match number of column IDs");
-    this.ts = ts;
-    this.tableID = tableID;
-    this.tableIDValue = tableID.getValue();
-    this.columns = columns;
-    this.columnIDs = columnIDs;
-    this.nextColumnID = nextColumnID;
-    for (int i = 0 ; i < columns.length ; i++)
-    {
-      columnLookup.put(columns[i],new Integer(i));
-    }
-  }
-  
-  /** Get the column names.
-  */
-  public String[] getColumnNames()
-    throws WHException
-  {
-    return columns;
-  }
-  
-  /** Insert a row */
-  public void insertRow(String[] columns, WHValue[] values)
-    throws WHException
-  {
-    if (columns.length != values.length)
-      throw new WHException("Column count must agree with value count");
-    // Allocate the row
-    LongValue rowID = ts.allocateNewTableRow(tableID);
-    // Set the values
-    for (int i = 0 ; i < columns.length ; i++)
-    {
-      setTableColumnValue(rowID,getColumnID(columns[i]),(WHKeyValue)values[i]);
-    }
-    // Add to all indices
-    ts.addIndexRow(tableID,rowID,null);
-    // Last, link in the row.  Do it last to reduce chances of collision.
-    addTableRow(rowID);
-  }
-  
-  /** Update row(s) */
-  public void updateRows(String[] columns, WHValue[] values,
-    WHAccessor accessor)
-    throws WHException
-  {
-    if (columns.length != values.length)
-      throw new WHException("Column count must agree with value count");
-    // Convert the columns to a set, for convenience later
-    Set<Long> columnSet = new HashSet<Long>();
-    for (int i = 0 ; i < columns.length ; i++)
-    {
-      columnSet.add(new Long(columnIDs[i]));
-    }
-    
-    // Update the rows one at a time
-    while (true)
-    {
-      LongValue rowID = (LongValue)accessor.getCurrentRowID();
-      if (rowID == null)
-        break;
-      
-      // Note: The problem with this loop is that I cannot guarantee that the accessor will continue
-      // to work right after I delete and re-add the row to/from the indexes.  If the accessor is an
-      // index accessor it may be the case that the changed row appears in the update list at a new
-      // place after the modification, and thus can technically be visited more than once.  We
-      // currently do nothing to detect such conditions or attempt to stop them.
-      
-      // Delete the row from all indexes which can potentially intersect the changes
-      ts.deleteIndexRow(tableID,rowID,columnSet);
-      // Change the values as specified
-      for (int i = 0 ; i < columns.length ; i++)
-      {
-        setTableColumnValue(rowID,getColumnID(columns[i]),(WHKeyValue)values[i]);
-      }
-      // Add the row back to all indexes which can potentially intersect the changes
-      ts.addIndexRow(tableID,rowID,columnSet);
-      accessor.advance();
-    }
-  }
-    
-  /** Delete row(s) */
-  public void deleteRows(WHAccessor accessor)
-    throws WHException
-  {
-    // Read the rows one at a time
-    while (true)
-    {
-      LongValue rowID = (LongValue)accessor.getCurrentRowID();
-      if (rowID == null)
-        break;
-      // Delete the row from all indexes
-      ts.deleteIndexRow(tableID,rowID,null);
-      // Delete all values
-      for (int i = 0 ; i < columnIDs.length ; i++)
-      {
-        setTableColumnValue(rowID,columnIDs[i],null);
-      }
-      // Unlink the row in the linked list
-      removeTableRow(rowID);
-      accessor.advance();
-    }
-  }
-  
-  /** Build an accessor that simply scans all the rows in the table */
-  public WHAccessor buildAccessor()
-    throws WHException
-  {
-    return new TableAccessor(this);
-  }
-
-  // Protected methods
-  
-  /** Get identifier */
-  protected LongValue getID()
-  {
-    return tableID;
-  }
-  
-  protected long getIDValue()
-  {
-    return tableIDValue;
-  }
-  
-  protected long[] getColumnIDs()
-  {
-    return columnIDs;
-  }
-  
-  protected long getColumnID(String columnName)
-    throws WHException
-  {
-    Integer i = columnLookup.get(columnName);
-    if (i == null)
-      throw new WHException("No such column: "+columnName);
-    return columnIDs[i.intValue()];
-  }
-  
-  /** 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.
-  */
-  protected void remove()
-    throws WHException
-  {
-    deleteRows(buildAccessor());
-  }
-
-  /** Add a table row to the linked list for that table.
-  */
-  protected void addTableRow(LongValue rowID)
-    throws WHException
-  {
-    int instanceNumber = rowID.hashCode() & maxInstanceMask;
-    
-    if (ts.randomDecision())
-    {
-      TableTailKey tailKey = new TableTailKey(tableIDValue,instanceNumber);
-      LongValue tailValue = (LongValue)ts.get(tailKey);
-      if (tailValue == null)
-      {
-        // First row.  Set the head.
-        ts.put(new TableHeadKey(tableIDValue,instanceNumber),rowID);
-      }
-      else
-      {
-        // Set the next pointer for last row.
-        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(tableIDValue,instanceNumber);
-      LongValue headValue = (LongValue)ts.get(headKey);
-      if (headValue == null)
-      {
-        // First row.  Set the tail.
-        ts.put(new TableTailKey(tableIDValue,instanceNumber),rowID);
-      }
-      else
-      {
-        // Set the prev pointer for first row.
-        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);
-    }
-  }
-  
-  /** Remove a table row from the linked list for that table.
-  */
-  protected void removeTableRow(LongValue rowID)
-    throws WHException
-  {
-    int instanceNumber = rowID.hashCode() & maxInstanceMask;
-
-    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(tableIDValue,instanceNumber),nextValue);
-    }
-    else
-    {
-      ts.put(new TableRowNextKey(tableIDValue,prevValue.getValue()),nextValue);
-    }
-    // Fix up the next pointer reference
-    if (nextValue == null)
-    {
-      ts.put(new TableTailKey(tableIDValue,instanceNumber),prevValue);
-    }
-    else
-    {
-      ts.put(new TableRowPrevKey(tableIDValue,nextValue.getValue()),prevValue);
-    }
-  }
-  
-  /** Set a table column value.
-  */
-  protected void setTableColumnValue(LongValue rowID, long columnID, WHKeyValue value)
-    throws WHException
-  {
-    ts.put(new TableColumnKey(tableIDValue,rowID.getValue(),columnID),value);
-  }
-  
-  /** Get a table column value.
-  */
-  protected WHKeyValue getTableColumnValue(LongValue rowID, long columnID)
-    throws WHException
-  {
-    return ts.get(new TableColumnKey(tableIDValue,rowID.getValue(),columnID));
-  }
-
-  /** Get the max number of instances.
-  */
-  protected int getMaxInstanceNumber()
-  {
-    return maxInstanceCount;
-  }
-  
-  /** Read the first table row ID.
-  */
-  protected LongValue readFirstTableRowID(int instanceNumber)
-    throws WHException
-  {
-    return (LongValue)ts.get(new TableHeadKey(tableIDValue,instanceNumber));
-  }
-  
-  /** Reade the next table row ID.
-  */
-  protected LongValue readNextTableRowID(LongValue currentRowID)
-    throws WHException
-  {
-    // Read the row's next pointer
-    return (LongValue)ts.get(new TableRowNextKey(tableIDValue,currentRowID.getValue()));
-  }
-  
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+import java.util.*;
+
+/** This is the standard implementation of WHTable.
+*/
+public class Table implements WHTable
+{
+  protected TableStore ts;
+  protected LongValue tableID;
+  protected long tableIDValue;
+  protected String[] columns;
+  protected long[] columnIDs;
+  protected long nextColumnID;
+  protected Map<String,Integer> columnLookup = new HashMap<String,Integer>();
+  
+  protected static final int maxInstanceCount = 128;
+  protected static final int maxInstanceMask = maxInstanceCount-1;
+  
+  /** Constructor */
+  public Table(TableStore ts, LongValue tableID, String[] columns, long[] columnIDs, long nextColumnID)
+    throws WHException
+  {
+    if (columnIDs.length != columns.length)
+      throw new WHException("Number of column names must match number of column IDs");
+    this.ts = ts;
+    this.tableID = tableID;
+    this.tableIDValue = tableID.getValue();
+    this.columns = columns;
+    this.columnIDs = columnIDs;
+    this.nextColumnID = nextColumnID;
+    for (int i = 0 ; i < columns.length ; i++)
+    {
+      columnLookup.put(columns[i],new Integer(i));
+    }
+  }
+  
+  /** Get the column names.
+  */
+  public String[] getColumnNames()
+    throws WHException
+  {
+    return columns;
+  }
+  
+  /** Insert a row */
+  public void insertRow(String[] columns, WHValue[] values)
+    throws WHException
+  {
+    if (columns.length != values.length)
+      throw new WHException("Column count must agree with value count");
+    // Allocate the row
+    LongValue rowID = ts.allocateNewTableRow(tableID);
+    // Set the values
+    for (int i = 0 ; i < columns.length ; i++)
+    {
+      setTableColumnValue(rowID,getColumnID(columns[i]),(WHKeyValue)values[i]);
+    }
+    // Add to all indices
+    ts.addIndexRow(tableID,rowID,null);
+    // Last, link in the row.  Do it last to reduce chances of collision.
+    addTableRow(rowID);
+  }
+  
+  /** Update row(s) */
+  public void updateRows(String[] columns, WHValue[] values,
+    WHAccessor accessor)
+    throws WHException
+  {
+    if (columns.length != values.length)
+      throw new WHException("Column count must agree with value count");
+    // Convert the columns to a set, for convenience later
+    Set<Long> columnSet = new HashSet<Long>();
+    for (int i = 0 ; i < columns.length ; i++)
+    {
+      columnSet.add(new Long(columnIDs[i]));
+    }
+    
+    // Update the rows one at a time
+    while (true)
+    {
+      LongValue rowID = (LongValue)accessor.getCurrentRowID();
+      if (rowID == null)
+        break;
+      
+      // Note: The problem with this loop is that I cannot guarantee that the accessor will continue
+      // to work right after I delete and re-add the row to/from the indexes.  If the accessor is an
+      // index accessor it may be the case that the changed row appears in the update list at a new
+      // place after the modification, and thus can technically be visited more than once.  We
+      // currently do nothing to detect such conditions or attempt to stop them.
+      
+      // Delete the row from all indexes which can potentially intersect the changes
+      ts.deleteIndexRow(tableID,rowID,columnSet);
+      // Change the values as specified
+      for (int i = 0 ; i < columns.length ; i++)
+      {
+        setTableColumnValue(rowID,getColumnID(columns[i]),(WHKeyValue)values[i]);
+      }
+      // Add the row back to all indexes which can potentially intersect the changes
+      ts.addIndexRow(tableID,rowID,columnSet);
+      accessor.advance();
+    }
+  }
+    
+  /** Delete row(s) */
+  public void deleteRows(WHAccessor accessor)
+    throws WHException
+  {
+    // Read the rows one at a time
+    while (true)
+    {
+      LongValue rowID = (LongValue)accessor.getCurrentRowID();
+      if (rowID == null)
+        break;
+      // Delete the row from all indexes
+      ts.deleteIndexRow(tableID,rowID,null);
+      // Delete all values
+      for (int i = 0 ; i < columnIDs.length ; i++)
+      {
+        setTableColumnValue(rowID,columnIDs[i],null);
+      }
+      // Unlink the row in the linked list
+      removeTableRow(rowID);
+      accessor.advance();
+    }
+  }
+  
+  /** Build an accessor that simply scans all the rows in the table */
+  public WHAccessor buildAccessor()
+    throws WHException
+  {
+    return new TableAccessor(this);
+  }
+
+  // Protected methods
+  
+  /** Get identifier */
+  protected LongValue getID()
+  {
+    return tableID;
+  }
+  
+  protected long getIDValue()
+  {
+    return tableIDValue;
+  }
+  
+  protected long[] getColumnIDs()
+  {
+    return columnIDs;
+  }
+  
+  protected long getColumnID(String columnName)
+    throws WHException
+  {
+    Integer i = columnLookup.get(columnName);
+    if (i == null)
+      throw new WHException("No such column: "+columnName);
+    return columnIDs[i.intValue()];
+  }
+  
+  /** 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.
+  */
+  protected void remove()
+    throws WHException
+  {
+    deleteRows(buildAccessor());
+  }
+
+  /** Add a table row to the linked list for that table.
+  */
+  protected void addTableRow(LongValue rowID)
+    throws WHException
+  {
+    int instanceNumber = rowID.hashCode() & maxInstanceMask;
+    
+    if (ts.randomDecision())
+    {
+      TableTailKey tailKey = new TableTailKey(tableIDValue,instanceNumber);
+      LongValue tailValue = (LongValue)ts.get(tailKey);
+      if (tailValue == null)
+      {
+        // First row.  Set the head.
+        ts.put(new TableHeadKey(tableIDValue,instanceNumber),rowID);
+      }
+      else
+      {
+        // Set the next pointer for last row.
+        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(tableIDValue,instanceNumber);
+      LongValue headValue = (LongValue)ts.get(headKey);
+      if (headValue == null)
+      {
+        // First row.  Set the tail.
+        ts.put(new TableTailKey(tableIDValue,instanceNumber),rowID);
+      }
+      else
+      {
+        // Set the prev pointer for first row.
+        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);
+    }
+  }
+  
+  /** Remove a table row from the linked list for that table.
+  */
+  protected void removeTableRow(LongValue rowID)
+    throws WHException
+  {
+    int instanceNumber = rowID.hashCode() & maxInstanceMask;
+
+    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(tableIDValue,instanceNumber),nextValue);
+    }
+    else
+    {
+      ts.put(new TableRowNextKey(tableIDValue,prevValue.getValue()),nextValue);
+    }
+    // Fix up the next pointer reference
+    if (nextValue == null)
+    {
+      ts.put(new TableTailKey(tableIDValue,instanceNumber),prevValue);
+    }
+    else
+    {
+      ts.put(new TableRowPrevKey(tableIDValue,nextValue.getValue()),prevValue);
+    }
+  }
+  
+  /** Set a table column value.
+  */
+  protected void setTableColumnValue(LongValue rowID, long columnID, WHKeyValue value)
+    throws WHException
+  {
+    ts.put(new TableColumnKey(tableIDValue,rowID.getValue(),columnID),value);
+  }
+  
+  /** Get a table column value.
+  */
+  protected WHKeyValue getTableColumnValue(LongValue rowID, long columnID)
+    throws WHException
+  {
+    return ts.get(new TableColumnKey(tableIDValue,rowID.getValue(),columnID));
+  }
+
+  /** Get the max number of instances.
+  */
+  protected int getMaxInstanceNumber()
+  {
+    return maxInstanceCount;
+  }
+  
+  /** Read the first table row ID.
+  */
+  protected LongValue readFirstTableRowID(int instanceNumber)
+    throws WHException
+  {
+    return (LongValue)ts.get(new TableHeadKey(tableIDValue,instanceNumber));
+  }
+  
+  /** Reade the next table row ID.
+  */
+  protected LongValue readNextTableRowID(LongValue currentRowID)
+    throws WHException
+  {
+    // Read the row's next pointer
+    return (LongValue)ts.get(new TableRowNextKey(tableIDValue,currentRowID.getValue()));
+  }
+  
 }
\ No newline at end of file

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/Table.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/Table.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableAccessor.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableAccessor.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableAccessor.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableAccessor.java Sun Dec 18 08:36:52 2011
@@ -1,100 +1,100 @@
-/* $Id: TableAccessor.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-import java.util.*;
-
-/** Table accessor. */
-public class TableAccessor implements WHAccessor
-{
-  protected Table table;
-  /** This is the current row to be returned. */
-  protected LongValue currentRowID;
-  /** This is the current instance number */
-  protected int currentInstanceNumber;
-    
-  /** Constructor */
-  public TableAccessor(Table table)
-    throws WHException
-  {
-    this.table = table;
-    currentInstanceNumber = 0;
-    currentRowID = null;
-    goToNextLegalRow();
-  }
-  
-  protected void goToNextLegalRow()
-    throws WHException
-  {
-    while (true)
-    {
-      if (currentRowID == null)
-      {
-        currentRowID = table.readFirstTableRowID(currentInstanceNumber);
-      }
-      else
-      {
-        currentRowID = table.readNextTableRowID(currentRowID);
-      }
-      if (currentRowID == null)
-      {
-        currentInstanceNumber++;
-        if (currentInstanceNumber == table.getMaxInstanceNumber())
-          return;
-      }
-      else
-        return;
-    }
-  }
-    
-  /** Advance to the next row.
-  */
-  public void advance()
-    throws WHException
-  {
-    if (currentRowID != null)
-    {
-      goToNextLegalRow();
-    }
-  }
-  
-  /** Read the current relationship row ID,  Null will be returned if we are
-  * at the end of the sequence.
-  */
-  public WHRowID getCurrentRowID()
-    throws WHException
-  {
-    return currentRowID;
-  }
-	
-  /** Get the data for the current row and specified column. 
-  */
-  public WHValue getValue(String columnName)
-    throws WHException
-  {
-    if (currentRowID != null)
-      return (WHValue)table.getTableColumnValue(currentRowID,table.getColumnID(columnName));
-    throw new WHException("Can't read beyond end of accessor");
-  }
-
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+import java.util.*;
+
+/** Table accessor. */
+public class TableAccessor implements WHAccessor
+{
+  protected Table table;
+  /** This is the current row to be returned. */
+  protected LongValue currentRowID;
+  /** This is the current instance number */
+  protected int currentInstanceNumber;
+    
+  /** Constructor */
+  public TableAccessor(Table table)
+    throws WHException
+  {
+    this.table = table;
+    currentInstanceNumber = 0;
+    currentRowID = null;
+    goToNextLegalRow();
+  }
+  
+  protected void goToNextLegalRow()
+    throws WHException
+  {
+    while (true)
+    {
+      if (currentRowID == null)
+      {
+        currentRowID = table.readFirstTableRowID(currentInstanceNumber);
+      }
+      else
+      {
+        currentRowID = table.readNextTableRowID(currentRowID);
+      }
+      if (currentRowID == null)
+      {
+        currentInstanceNumber++;
+        if (currentInstanceNumber == table.getMaxInstanceNumber())
+          return;
+      }
+      else
+        return;
+    }
+  }
+    
+  /** Advance to the next row.
+  */
+  public void advance()
+    throws WHException
+  {
+    if (currentRowID != null)
+    {
+      goToNextLegalRow();
+    }
+  }
+  
+  /** Read the current relationship row ID,  Null will be returned if we are
+  * at the end of the sequence.
+  */
+  public WHRowID getCurrentRowID()
+    throws WHException
+  {
+    return currentRowID;
+  }
+	
+  /** Get the data for the current row and specified column. 
+  */
+  public WHValue getValue(String columnName)
+    throws WHException
+  {
+    if (currentRowID != null)
+      return (WHValue)table.getTableColumnValue(currentRowID,table.getColumnID(columnName));
+    throw new WHException("Can't read beyond end of accessor");
+  }
+
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableAccessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableAccessor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableBaseKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableBaseKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableBaseKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableBaseKey.java Sun Dec 18 08:36:52 2011
@@ -1,88 +1,88 @@
-/* $Id: TableBaseKey.java 1208927 2011-12-01 01:18:07Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Base class for table row prev/next keys */
-public class TableBaseKey implements WHKey
-{
-  protected long tableID;
-  protected int instanceNumber;
-  
-  /** Constructor */
-  public TableBaseKey(long tableID, int instanceNumber)
-  {
-    this.tableID = tableID;
-    this.instanceNumber = instanceNumber;
-  }
-    
-  public TableBaseKey(byte[] data)
-  {
-    BufferPointer bp = new BufferPointer(data);
-    this.tableID = LongKey.readObject(bp);
-    this.instanceNumber = IntegerKey.readObject(bp);
-  }
-
-  public byte[] serializeObject()
-  {
-    byte[] rval = new byte[LongKey.sizeObject()+
-      IntegerKey.sizeObject()];
-    BufferPointer bp = new BufferPointer(rval);
-    LongKey.writeObject(bp,tableID);
-    IntegerKey.writeObject(bp,instanceNumber);
-    return rval;
-  }
-    
-  public long getHashCode()
-  {
-    return calculateHashCode(tableID,instanceNumber);
-  }
-  
-  public static long calculateHashCode(long tableID, int instanceNumber)
-  {
-    return LongKey.calculateHashCode(tableID) + IntegerKey.calculateHashCode(instanceNumber);
-  }
-    
-  public boolean isEquals(WHKeyValue o)
-  {
-    TableBaseKey key = (TableBaseKey)o;
-    return key.tableID == tableID &&
-      key.instanceNumber == instanceNumber;
-  }
-
-  public int hashCode()
-  {
-    return ((int)((tableID << 5) ^ (tableID >> 3))) +
-      ((instanceNumber << 5) ^ (instanceNumber >> 3));
-  }
-  
-  public boolean equals(Object o)
-  {
-    if (getClass() != o.getClass())
-      return false;
-    TableBaseKey other = (TableBaseKey)o;
-    return other.tableID == tableID &&
-      other.instanceNumber == instanceNumber;
-  }
-  
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Base class for table row prev/next keys */
+public class TableBaseKey implements WHKey
+{
+  protected long tableID;
+  protected int instanceNumber;
+  
+  /** Constructor */
+  public TableBaseKey(long tableID, int instanceNumber)
+  {
+    this.tableID = tableID;
+    this.instanceNumber = instanceNumber;
+  }
+    
+  public TableBaseKey(byte[] data)
+  {
+    BufferPointer bp = new BufferPointer(data);
+    this.tableID = LongKey.readObject(bp);
+    this.instanceNumber = IntegerKey.readObject(bp);
+  }
+
+  public byte[] serializeObject()
+  {
+    byte[] rval = new byte[LongKey.sizeObject()+
+      IntegerKey.sizeObject()];
+    BufferPointer bp = new BufferPointer(rval);
+    LongKey.writeObject(bp,tableID);
+    IntegerKey.writeObject(bp,instanceNumber);
+    return rval;
+  }
+    
+  public long getHashCode()
+  {
+    return calculateHashCode(tableID,instanceNumber);
+  }
+  
+  public static long calculateHashCode(long tableID, int instanceNumber)
+  {
+    return LongKey.calculateHashCode(tableID) + IntegerKey.calculateHashCode(instanceNumber);
+  }
+    
+  public boolean isEquals(WHKeyValue o)
+  {
+    TableBaseKey key = (TableBaseKey)o;
+    return key.tableID == tableID &&
+      key.instanceNumber == instanceNumber;
+  }
+
+  public int hashCode()
+  {
+    return ((int)((tableID << 5) ^ (tableID >> 3))) +
+      ((instanceNumber << 5) ^ (instanceNumber >> 3));
+  }
+  
+  public boolean equals(Object o)
+  {
+    if (getClass() != o.getClass())
+      return false;
+    TableBaseKey other = (TableBaseKey)o;
+    return other.tableID == tableID &&
+      other.instanceNumber == instanceNumber;
+  }
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableBaseKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableBaseKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableColumnKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableColumnKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableColumnKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableColumnKey.java Sun Dec 18 08:36:52 2011
@@ -1,95 +1,95 @@
-/* $Id: TableColumnKey.java 1209929 2011-12-03 15:06:22Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-public class TableColumnKey implements WHKey
-{
-  protected long tableID;
-  protected long rowID;
-  protected long columnID;
-  
-  /** Constructor */
-  public TableColumnKey(long tableID, long rowID, long columnID)
-  {
-    this.tableID = tableID;
-    this.rowID = rowID;
-    this.columnID = columnID;
-  }
-    
-  public TableColumnKey(byte[] data)
-  {
-    BufferPointer bp = new BufferPointer(data);
-    this.tableID = LongKey.readObject(bp);
-    this.rowID = LongKey.readObject(bp);
-    this.columnID = LongKey.readObject(bp);
-  }
-
-  public byte[] serializeObject()
-  {
-    byte[] rval = new byte[LongKey.sizeObject()+
-      LongKey.sizeObject() + LongKey.sizeObject()];
-    BufferPointer bp = new BufferPointer(rval);
-    LongKey.writeObject(bp,tableID);
-    LongKey.writeObject(bp,rowID);
-    LongKey.writeObject(bp,columnID);
-    return rval;
-  }
-    
-  public long getHashCode()
-  {
-    return calculateHashCode(tableID,rowID,columnID);
-  }
-  
-  public static long calculateHashCode(long tableID, long rowID, long columnID)
-  {
-    return LongKey.calculateHashCode(tableID) + LongKey.calculateHashCode(rowID)
-      + LongKey.calculateHashCode(columnID);
-  }
-    
-  public boolean isEquals(WHKeyValue o)
-  {
-    TableColumnKey key = (TableColumnKey)o;
-    return key.tableID == tableID &&
-      key.rowID == rowID &&
-      key.columnID == columnID;
-  }
-  
-  public int hashCode()
-  {
-    return ((int)((tableID << 5) ^ (tableID >>3))) +
-      ((int)((rowID << 5) ^ (rowID >> 3))) +
-      ((int)((columnID << 5) ^ (columnID >> 3)));
-  }
-  
-  public boolean equals(Object o)
-  {
-    if (getClass() != o.getClass())
-      return false;
-    TableColumnKey other = (TableColumnKey)o;
-    return other.tableID == tableID &&
-      other.rowID == rowID &&
-      other.columnID == columnID;
-  }
-  
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+public class TableColumnKey implements WHKey
+{
+  protected long tableID;
+  protected long rowID;
+  protected long columnID;
+  
+  /** Constructor */
+  public TableColumnKey(long tableID, long rowID, long columnID)
+  {
+    this.tableID = tableID;
+    this.rowID = rowID;
+    this.columnID = columnID;
+  }
+    
+  public TableColumnKey(byte[] data)
+  {
+    BufferPointer bp = new BufferPointer(data);
+    this.tableID = LongKey.readObject(bp);
+    this.rowID = LongKey.readObject(bp);
+    this.columnID = LongKey.readObject(bp);
+  }
+
+  public byte[] serializeObject()
+  {
+    byte[] rval = new byte[LongKey.sizeObject()+
+      LongKey.sizeObject() + LongKey.sizeObject()];
+    BufferPointer bp = new BufferPointer(rval);
+    LongKey.writeObject(bp,tableID);
+    LongKey.writeObject(bp,rowID);
+    LongKey.writeObject(bp,columnID);
+    return rval;
+  }
+    
+  public long getHashCode()
+  {
+    return calculateHashCode(tableID,rowID,columnID);
+  }
+  
+  public static long calculateHashCode(long tableID, long rowID, long columnID)
+  {
+    return LongKey.calculateHashCode(tableID) + LongKey.calculateHashCode(rowID)
+      + LongKey.calculateHashCode(columnID);
+  }
+    
+  public boolean isEquals(WHKeyValue o)
+  {
+    TableColumnKey key = (TableColumnKey)o;
+    return key.tableID == tableID &&
+      key.rowID == rowID &&
+      key.columnID == columnID;
+  }
+  
+  public int hashCode()
+  {
+    return ((int)((tableID << 5) ^ (tableID >>3))) +
+      ((int)((rowID << 5) ^ (rowID >> 3))) +
+      ((int)((columnID << 5) ^ (columnID >> 3)));
+  }
+  
+  public boolean equals(Object o)
+  {
+    if (getClass() != o.getClass())
+      return false;
+    TableColumnKey other = (TableColumnKey)o;
+    return other.tableID == tableID &&
+      other.rowID == rowID &&
+      other.columnID == columnID;
+  }
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableColumnKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableColumnKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableHeadKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableHeadKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableHeadKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableHeadKey.java Sun Dec 18 08:36:52 2011
@@ -1,38 +1,38 @@
-/* $Id: TableHeadKey.java 1208927 2011-12-01 01:18:07Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-public class TableHeadKey extends TableBaseKey
-{
-  /** Constructor */
-  public TableHeadKey(long tableID, int instanceNumber)
-  {
-    super(tableID,instanceNumber);
-  }
-    
-  public TableHeadKey(byte[] data)
-  {
-    super(data);
-  }
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+public class TableHeadKey extends TableBaseKey
+{
+  /** Constructor */
+  public TableHeadKey(long tableID, int instanceNumber)
+  {
+    super(tableID,instanceNumber);
+  }
+    
+  public TableHeadKey(byte[] data)
+  {
+    super(data);
+  }
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableHeadKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableHeadKey.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableIndexKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableIndexKey.java?rev=1220353&r1=1220352&r2=1220353&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableIndexKey.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableIndexKey.java Sun Dec 18 08:36:52 2011
@@ -1,39 +1,39 @@
-/* $Id: TableIndexKey.java 1207727 2011-11-29 01:12:13Z kwright $ */
-
-/**
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.apache.warthog.keyvaluetablestore;
-
-import org.apache.warthog.api.*;
-import org.apache.warthog.transactionalkeyvaluestore.*;
-import org.apache.warthog.common.*;
-
-/** Key for accessing indexes that index a table */
-public class TableIndexKey extends LongKey
-{
-  /** Constructor */
-  public TableIndexKey(long tableID)
-  {
-    super(tableID);
-  }
-    
-  public TableIndexKey(byte[] data)
-  {
-    super(data);
-  }
-}
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.warthog.keyvaluetablestore;
+
+import org.apache.warthog.api.*;
+import org.apache.warthog.transactionalkeyvaluestore.*;
+import org.apache.warthog.common.*;
+
+/** Key for accessing indexes that index a table */
+public class TableIndexKey extends LongKey
+{
+  /** Constructor */
+  public TableIndexKey(long tableID)
+  {
+    super(tableID);
+  }
+    
+  public TableIndexKey(byte[] data)
+  {
+    super(data);
+  }
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableIndexKey.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog-reimport/src/main/java/org/apache/warthog/keyvaluetablestore/TableIndexKey.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message