directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r917770 [1/4] - in /directory/sandbox/seelmann/hbase-partition/src: main/java/org/apache/directory/server/core/partition/hbase/ main/java/org/apache/directory/server/core/partition/hbase/cursor/ main/java/org/apache/directory/server/core/pa...
Date Mon, 01 Mar 2010 22:45:48 GMT
Author: seelmann
Date: Mon Mar  1 22:45:47 2010
New Revision: 917770

URL: http://svn.apache.org/viewvc?rev=917770&view=rev
Log:
Use UUID as entry ID

Added:
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/TreeTableBuilder.java
Modified:
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Cache.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseDistributedPartition.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseStore.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Utils.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/AbstractHBaseIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/BaseHBaseIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/EmptyIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseNdnIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseOneLevelIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBasePresenceIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseSubLevelIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserColumnIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexReverseCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserRowIndexCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/AbstractHBaseIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseAliasIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseNdnIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneAliasIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneLevelIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBasePresenceIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubAliasIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubLevelIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserIndex.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/IndexBuilder.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/LdifImporter.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseColumnIndexTable.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseIndexTable.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseMasterTable.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBasePresenceIndexTable.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseRowIndexTable.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseTableHelper.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedCursorBuilder.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedEvaluatorBuilder.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedOneLevelScopeCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedOptimizer.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedSubstringCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedSubstringEvaluator.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/ExtendedSubtreeScopeCursor.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/IndexFilteringExtension.java
    directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/xdbmext/IndexSubstringExtension.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionIT.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionPerformanceIT.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/it/mapreduce/LdifImportAndIndexIT.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/it/mapreduce/RemoteLdifImport.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/it/mapreduce/RemoteRunner.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/table/AbstractHBaseTableTest.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/table/HBaseIndexTableTest.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/table/HBaseMasterTableTest.java
    directory/sandbox/seelmann/hbase-partition/src/test/java/org/apache/directory/server/core/partition/hbase/table/HBasePresenceIndexTableTest.java
    directory/sandbox/seelmann/hbase-partition/src/test/resources/hbase-site.xml
    directory/sandbox/seelmann/hbase-partition/src/test/resources/mapred-site.xml

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Cache.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Cache.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Cache.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Cache.java Mon Mar  1 22:45:47 2010
@@ -99,24 +99,6 @@
 
 
     /**
-     * Checks if the key is contained in this cache.
-     * 
-     * @param key the key
-     * 
-     * @return true, if the key is contained in the cache
-     */
-    public synchronized boolean contains( K key )
-    {
-        if ( map == null )
-        {
-            return false;
-        }
-
-        return get( key ) != null;
-    }
-
-
-    /**
      * Gets the value.
      * 
      * @param key the key

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseDistributedPartition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseDistributedPartition.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseDistributedPartition.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseDistributedPartition.java Mon Mar  1 22:45:47 2010
@@ -23,6 +23,7 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -53,7 +54,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseDistributedPartition extends AbstractXdbmPartition
+public class HBaseDistributedPartition extends AbstractXdbmPartition<UUID>
 {
 
     /**
@@ -78,10 +79,10 @@
         this.suffix.normalize( oidsMap );
 
         // setup optimizer and search engine
-        ExtendedEvaluatorBuilder evaluatorBuilder = new ExtendedEvaluatorBuilder( store, schemaManager );
-        ExtendedCursorBuilder cursorBuilder = new ExtendedCursorBuilder( store, evaluatorBuilder );
-        optimizer = new ExtendedOptimizer<ServerEntry>( store, cursorBuilder, evaluatorBuilder );
-        searchEngine = new DefaultSearchEngine( store, cursorBuilder, evaluatorBuilder, optimizer );
+        ExtendedEvaluatorBuilder<UUID> evaluatorBuilder = new ExtendedEvaluatorBuilder<UUID>( store, schemaManager );
+        ExtendedCursorBuilder<UUID> cursorBuilder = new ExtendedCursorBuilder<UUID>( store, evaluatorBuilder );
+        optimizer = new ExtendedOptimizer<ServerEntry, UUID>( store, cursorBuilder, evaluatorBuilder );
+        searchEngine = new DefaultSearchEngine<UUID>( store, cursorBuilder, evaluatorBuilder, optimizer );
 
         // initialize the store
         store.setSuffixDn( getSuffixDn().normalize( oidsMap ).getNormName() );
@@ -89,9 +90,9 @@
         store.setName( id );
         ( ( HBaseStore ) store ).setTablePrefix( "apacheds" + "_" + id + "_" );
 
-        Set<Index<?, ServerEntry>> userIndices = new HashSet<Index<?, ServerEntry>>();
+        Set<Index<?, ServerEntry, UUID>> userIndices = new HashSet<Index<?, ServerEntry, UUID>>();
 
-        for ( Index<?, ServerEntry> obj : getIndexedAttributes() )
+        for ( Index<?, ServerEntry, UUID> obj : getIndexedAttributes() )
         {
             AbstractHBaseIndex<?, ServerEntry> index;
 

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseStore.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseStore.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseStore.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseStore.java Mon Mar  1 22:45:47 2010
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.UUID;
 
 import javax.naming.NamingException;
 
@@ -65,7 +66,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseStore implements Store<ServerEntry>
+public class HBaseStore implements Store<ServerEntry, UUID>
 {
 
     public static final String STRONG_CONSISTENCY_PROPERTY = "org.apache.directory.strong.consistency";
@@ -85,12 +86,12 @@
 
     private Map<String, HBaseUserIndex<HBaseIndexTable>> userIndices = new HashMap<String, HBaseUserIndex<HBaseIndexTable>>();
     private HBasePresenceIndex presenceIndex;
-    private Index<String, ServerEntry> ndnIndex;
-    private Index<Long, ServerEntry> oneLevelIndex;
-    private Index<Long, ServerEntry> subLevelIndex;
-    private Index<String, ServerEntry> aliasIndex;
-    private Index<Long, ServerEntry> oneAliasIndex;
-    private Index<Long, ServerEntry> subAliasIndex;
+    private Index<String, ServerEntry, UUID> ndnIndex;
+    private Index<UUID, ServerEntry, UUID> oneLevelIndex;
+    private Index<UUID, ServerEntry, UUID> subLevelIndex;
+    private Index<String, ServerEntry, UUID> aliasIndex;
+    private Index<UUID, ServerEntry, UUID> oneAliasIndex;
+    private Index<UUID, ServerEntry, UUID> subAliasIndex;
 
 
     public void init( SchemaManager schemaManager ) throws Exception
@@ -151,7 +152,7 @@
             masterTable = null;
         }
 
-        for ( Index<?, ServerEntry> userIndex : userIndices.values() )
+        for ( HBaseUserIndex<HBaseIndexTable> userIndex : userIndices.values() )
         {
             userIndex.close();
         }
@@ -178,7 +179,7 @@
     public void add( ServerEntry entry ) throws Exception
     {
         // write master and dn2id table
-        Long id = getMasterTable().add( entry );
+        UUID id = getMasterTable().add( entry );
 
         // write index tables
         for ( EntryAttribute attribute : entry )
@@ -208,16 +209,16 @@
     }
 
 
-    public Long getEntryId( String dn ) throws Exception
+    public UUID getEntryId( String dn ) throws Exception
     {
         // TODO: is dn already normalized?
         LdapDN normDn = new LdapDN( dn ).normalize( schemaManager.getAttributeTypeRegistry().getNormalizerMapping() );
-        Long id = getMasterTable().fetchId( normDn );
+        UUID id = getMasterTable().fetchId( normDn );
         return id;
     }
 
 
-    public ServerEntry lookup( Long id ) throws Exception
+    public ServerEntry lookup( UUID id ) throws Exception
     {
         ServerEntry entry = getMasterTable().fetchEntry( id );
         return entry;
@@ -225,7 +226,7 @@
 
 
     @SuppressWarnings("unchecked")
-    public void addIndex( Index<?, ServerEntry> index )
+    public void addIndex( Index<?, ServerEntry, UUID> index )
     {
         this.userIndices.put( index.getAttributeId(), ( HBaseUserIndex<HBaseIndexTable> ) index );
     }
@@ -238,7 +239,7 @@
     }
 
 
-    public void delete( Long id ) throws Exception
+    public void delete( UUID id ) throws Exception
     {
         ServerEntry entry = lookup( id );
 
@@ -263,7 +264,7 @@
     }
 
 
-    public Index<String, ServerEntry> getAliasIndex()
+    public Index<String, ServerEntry, UUID> getAliasIndex()
     {
         return aliasIndex;
     }
@@ -275,25 +276,25 @@
     }
 
 
-    public int getChildCount( Long id ) throws Exception
+    public int getChildCount( UUID id ) throws Exception
     {
         return oneLevelIndex.count( id );
     }
 
 
-    public Index<String, ServerEntry> getEntryCsnIndex()
+    public Index<String, ServerEntry, UUID> getEntryCsnIndex()
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public String getEntryDn( Long arg0 ) throws Exception
+    public String getEntryDn( UUID arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public String getEntryUpdn( Long arg0 ) throws Exception
+    public String getEntryUpdn( UUID arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -305,7 +306,7 @@
     }
 
 
-    public Index<String, ServerEntry> getEntryUuidIndex()
+    public Index<String, ServerEntry, UUID> getEntryUuidIndex()
     {
         throw new UnsupportedOperationException();
     }
@@ -317,37 +318,37 @@
     }
 
 
-    public Index<String, ServerEntry> getNdnIndex()
+    public Index<String, ServerEntry, UUID> getNdnIndex()
     {
         return ndnIndex;
     }
 
 
-    public Index<String, ServerEntry> getObjectClassIndex()
+    public Index<String, ServerEntry, UUID> getObjectClassIndex()
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Index<Long, ServerEntry> getOneAliasIndex()
+    public Index<UUID, ServerEntry, UUID> getOneAliasIndex()
     {
         return oneAliasIndex;
     }
 
 
-    public Index<Long, ServerEntry> getOneLevelIndex()
+    public Index<UUID, ServerEntry, UUID> getOneLevelIndex()
     {
         return oneLevelIndex;
     }
 
 
-    public Long getParentId( String arg0 ) throws Exception
+    public UUID getParentId( String arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Long getParentId( Long arg0 ) throws Exception
+    public UUID getParentId( UUID arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -365,13 +366,13 @@
     }
 
 
-    public Index<Long, ServerEntry> getSubAliasIndex()
+    public Index<UUID, ServerEntry, UUID> getSubAliasIndex()
     {
         return subAliasIndex;
     }
 
 
-    public Index<Long, ServerEntry> getSubLevelIndex()
+    public Index<UUID, ServerEntry, UUID> getSubLevelIndex()
     {
         return subLevelIndex;
     }
@@ -389,7 +390,7 @@
     }
 
 
-    public Index<?, ServerEntry> getSystemIndex( String arg0 ) throws IndexNotFoundException
+    public Index<?, ServerEntry, UUID> getSystemIndex( String arg0 ) throws IndexNotFoundException
     {
         throw new UnsupportedOperationException();
     }
@@ -401,7 +402,7 @@
     }
 
 
-    public Index<String, ServerEntry> getUpdnIndex()
+    public Index<String, ServerEntry, UUID> getUpdnIndex()
     {
         throw new UnsupportedOperationException();
     }
@@ -433,9 +434,9 @@
     }
 
 
-    public Set<Index<?, ServerEntry>> getUserIndices()
+    public Set<Index<?, ServerEntry, UUID>> getUserIndices()
     {
-        return new HashSet<Index<?, ServerEntry>>( userIndices.values() );
+        return new HashSet<Index<?, ServerEntry, UUID>>( userIndices.values() );
     }
 
 
@@ -469,7 +470,7 @@
     }
 
 
-    public IndexCursor<Long, ServerEntry> list( Long key ) throws Exception
+    public IndexCursor<UUID, ServerEntry, UUID> list( UUID key ) throws Exception
     {
         return getOneLevelIndex().forwardCursor( key );
     }
@@ -477,7 +478,7 @@
 
     public void modify( LdapDN dn, List<Modification> mods ) throws Exception
     {
-        Long id = getEntryId( dn.getNormName() );
+        UUID id = getEntryId( dn.getNormName() );
         ServerEntry entry = lookup( id );
 
         // TODO: quick and dirty implementation to update the indices
@@ -592,7 +593,7 @@
     }
 
 
-    public void setAliasIndex( Index<String, ServerEntry> aliasIndex ) throws Exception
+    public void setAliasIndex( Index<String, ServerEntry, UUID> aliasIndex ) throws Exception
     {
         this.aliasIndex = aliasIndex;
     }
@@ -604,13 +605,13 @@
     }
 
 
-    public void setEntryCsnIndex( Index<String, ServerEntry> arg0 ) throws Exception
+    public void setEntryCsnIndex( Index<String, ServerEntry, UUID> arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void setEntryUuidIndex( Index<String, ServerEntry> arg0 ) throws Exception
+    public void setEntryUuidIndex( Index<String, ServerEntry, UUID> arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -622,31 +623,31 @@
     }
 
 
-    public void setNdnIndex( Index<String, ServerEntry> ndnIndex ) throws Exception
+    public void setNdnIndex( Index<String, ServerEntry, UUID> ndnIndex ) throws Exception
     {
         this.ndnIndex = ndnIndex;
     }
 
 
-    public void setObjectClassIndex( Index<String, ServerEntry> arg0 ) throws Exception
+    public void setObjectClassIndex( Index<String, ServerEntry, UUID> arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void setOneAliasIndex( Index<Long, ServerEntry> oneAliasIndex ) throws Exception
+    public void setOneAliasIndex( Index<UUID, ServerEntry, UUID> oneAliasIndex ) throws Exception
     {
         this.oneAliasIndex = oneAliasIndex;
     }
 
 
-    public void setOneLevelIndex( Index<Long, ServerEntry> oneLevelIndex ) throws Exception
+    public void setOneLevelIndex( Index<UUID, ServerEntry, UUID> oneLevelIndex ) throws Exception
     {
         this.oneLevelIndex = oneLevelIndex;
     }
 
 
-    public void setPresenceIndex( Index<String, ServerEntry> presenceIndex ) throws Exception
+    public void setPresenceIndex( Index<String, ServerEntry, UUID> presenceIndex ) throws Exception
     {
         this.presenceIndex = ( HBasePresenceIndex ) presenceIndex;
     }
@@ -658,13 +659,13 @@
     }
 
 
-    public void setSubAliasIndex( Index<Long, ServerEntry> subAliasIndex ) throws Exception
+    public void setSubAliasIndex( Index<UUID, ServerEntry, UUID> subAliasIndex ) throws Exception
     {
         this.subAliasIndex = subAliasIndex;
     }
 
 
-    public void setSubLevelIndex( Index<Long, ServerEntry> subLevelIndex ) throws Exception
+    public void setSubLevelIndex( Index<UUID, ServerEntry, UUID> subLevelIndex ) throws Exception
     {
         this.subLevelIndex = subLevelIndex;
     }
@@ -682,16 +683,16 @@
     }
 
 
-    public void setUpdnIndex( Index<String, ServerEntry> arg0 ) throws Exception
+    public void setUpdnIndex( Index<String, ServerEntry, UUID> arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void setUserIndices( Set<Index<?, ServerEntry>> userIndices )
+    public void setUserIndices( Set<Index<?, ServerEntry, UUID>> userIndices )
     {
         this.userIndices.clear();
-        for ( Index<?, ServerEntry> index : userIndices )
+        for ( Index<?, ServerEntry, UUID> index : userIndices )
         {
             addIndex( index );
         }
@@ -744,4 +745,10 @@
     {
         return configuration;
     }
+    
+
+    public UUID getDefaultId() throws Exception
+    {
+        return getEntryId( getSuffixDn() );
+    }
 }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Utils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Utils.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Utils.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/Utils.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.partition.hbase;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.xdbm.search.impl.SubstringEvaluator;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -60,7 +62,7 @@
 
     public static String getValuePattern( SubstringNode node, HBaseStore store ) throws Exception
     {
-        String valuePattern = new SubstringEvaluator( node, store, store.getSchemaManager() ).getPattern().toString();
+        String valuePattern = new SubstringEvaluator<UUID>( node, store, store.getSchemaManager() ).getPattern().toString();
         if ( valuePattern.charAt( 0 ) == '^' )
         {
             // indicates that the value pattern has an initial pattern, filter out the '^'
@@ -72,4 +74,52 @@
         }
     }
 
+
+    public static UUID toUUID( byte[] id )
+    {
+        return UUID.fromString( Bytes.toString( id ) );
+    }
+    
+    public static byte[] toBytes( UUID uuid )
+    {
+        return Bytes.toBytes( uuid.toString() );
+    }
+    
+    public static UUID incrementUUID(UUID uuid) {
+        long lsb = uuid.getLeastSignificantBits();
+        long msb = uuid.getMostSignificantBits();
+        if(lsb == -1L) 
+        {
+            lsb = 0L;
+            msb++;
+        }   
+        else {
+            lsb++;
+        }
+        UUID incremented = new UUID( msb, lsb );
+        return incremented;
+    }
+    
+
+    public static byte[] incrementBytes( byte[] bytes )
+    {
+        byte[] result = new byte[bytes.length];
+        System.arraycopy( bytes, 0, result, 0, bytes.length );
+        for ( int i = result.length - 1; i >= 0; i-- )
+        {
+            if ( result[i] == ( byte ) 0xFF )
+            {
+                // carry-over
+                result[i] = ( byte ) 0x00;
+            }
+            else
+            {
+                // finish
+                result[i]++;
+                return result;
+            }
+        }
+        return result;
+    }
+
 }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/AbstractHBaseIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/AbstractHBaseIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/AbstractHBaseIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/AbstractHBaseIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.partition.hbase.cursor;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
 
@@ -31,14 +33,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractHBaseIndexCursor<V, E> extends AbstractHBaseCursor<IndexEntry<V, E>> implements
-    IndexCursor<V, E>
+public abstract class AbstractHBaseIndexCursor<V, E> extends AbstractHBaseCursor<IndexEntry<V, E, UUID>> implements
+    IndexCursor<V, E, UUID>
 {
 
     /**
      * {@docRoot}
      */
-    public void afterValue( Long id, V indexValue ) throws Exception
+    public void afterValue( UUID id, V indexValue ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -47,7 +49,7 @@
     /**
      * {@docRoot}
      */
-    public void beforeValue( Long id, V indexValue ) throws Exception
+    public void beforeValue( UUID id, V indexValue ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -56,7 +58,7 @@
     /**
      * {@docRoot}
      */
-    public void after( IndexEntry<V, E> element ) throws Exception
+    public void after( IndexEntry<V, E, UUID> element ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -65,7 +67,7 @@
     /**
      * {@docRoot}
      */
-    public void before( IndexEntry<V, E> element ) throws Exception
+    public void before( IndexEntry<V, E, UUID> element ) throws Exception
     {
         throw new UnsupportedOperationException();
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/BaseHBaseIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/BaseHBaseIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/BaseHBaseIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/BaseHBaseIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -22,6 +22,7 @@
 
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.UUID;
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
@@ -50,15 +51,15 @@
     private static final int CAPACITY = 10;
     private int count;
     private int index;
-    private LinkedList<IndexEntry<V, ServerEntry>> entries;
+    private LinkedList<IndexEntry<V, ServerEntry, UUID>> entries;
 
-    protected IndexEntry<V, ServerEntry> currentEntry;
+    protected IndexEntry<V, ServerEntry, UUID> currentEntry;
 
 
     public BaseHBaseIndexCursor( HBaseStore store )
     {
         this.store = store;
-        this.entries = new LinkedList<IndexEntry<V, ServerEntry>>();
+        this.entries = new LinkedList<IndexEntry<V, ServerEntry, UUID>>();
         reset();
     }
 
@@ -118,7 +119,7 @@
 
 
     @Override
-    public final IndexEntry<V, ServerEntry> get() throws Exception
+    public final IndexEntry<V, ServerEntry, UUID> get() throws Exception
     {
         return currentEntry;
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/EmptyIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/EmptyIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/EmptyIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/EmptyIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -21,6 +21,7 @@
 
 
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.xdbm.IndexCursor;
@@ -34,20 +35,20 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class EmptyIndexCursor implements IndexCursor<Long, ServerEntry>
+public class EmptyIndexCursor implements IndexCursor<UUID, ServerEntry, UUID>
 {
 
-    public void afterValue( Long id, Long indexValue ) throws Exception
+    public void afterValue( UUID id, UUID indexValue ) throws Exception
     {
     }
 
 
-    public void beforeValue( Long id, Long indexValue ) throws Exception
+    public void beforeValue( UUID id, UUID indexValue ) throws Exception
     {
     }
 
 
-    public void after( IndexEntry<Long, ServerEntry> element ) throws Exception
+    public void after( IndexEntry<UUID, ServerEntry, UUID> element ) throws Exception
     {
     }
 
@@ -63,7 +64,7 @@
     }
 
 
-    public void before( IndexEntry<Long, ServerEntry> element ) throws Exception
+    public void before( IndexEntry<UUID, ServerEntry, UUID> element ) throws Exception
     {
     }
 
@@ -89,7 +90,7 @@
     }
 
 
-    public IndexEntry<Long, ServerEntry> get() throws Exception
+    public IndexEntry<UUID, ServerEntry, UUID> get() throws Exception
     {
         return null;
     }
@@ -130,7 +131,7 @@
     }
 
 
-    public Iterator<IndexEntry<Long, ServerEntry>> iterator()
+    public Iterator<IndexEntry<UUID, ServerEntry, UUID>> iterator()
     {
         return null;
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseNdnIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseNdnIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseNdnIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseNdnIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -20,13 +20,15 @@
 package org.apache.directory.server.core.partition.hbase.cursor;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
+import org.apache.directory.server.core.partition.hbase.Utils;
 import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.util.Bytes;
 
 
 /**
@@ -61,8 +63,8 @@
         {
             Result next = iterator.next();
             byte[] id = next.getRow();
-            currentEntry = new ForwardIndexEntry<String, ServerEntry>();
-            currentEntry.setId( Bytes.toLong( id ) );
+            currentEntry = new ForwardIndexEntry<String, ServerEntry, UUID>();
+            currentEntry.setId( Utils.toUUID( id ) );
             //currentEntry.setValue( entry.getDn().getNormName() );
 
             //ServerEntry entry = store.getId2entryTable().convertToServerEntry( id, next );

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseOneLevelIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseOneLevelIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseOneLevelIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseOneLevelIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -20,14 +20,16 @@
 package org.apache.directory.server.core.partition.hbase.cursor;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
+import org.apache.directory.server.core.partition.hbase.Utils;
 import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.util.Bytes;
 
 
 /**
@@ -37,23 +39,23 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseOneLevelIndexCursor extends BaseHBaseIndexCursor<Long>
+public class HBaseOneLevelIndexCursor extends BaseHBaseIndexCursor<UUID>
 {
     /** The entry ID of the search base. */
-    private Long baseId;
+    private UUID baseId;
 
     /** The filter to apply while scanning. */
     private ExprNode filter;
 
 
-    public HBaseOneLevelIndexCursor( Long baseId, HBaseStore store )
+    public HBaseOneLevelIndexCursor( UUID baseId, HBaseStore store )
     {
         super( store );
         this.baseId = baseId;
     }
 
 
-    public HBaseOneLevelIndexCursor( Long baseId, ExprNode filter, HBaseStore store )
+    public HBaseOneLevelIndexCursor( UUID baseId, ExprNode filter, HBaseStore store )
     {
         this( baseId, store );
         this.filter = filter;
@@ -65,8 +67,8 @@
     {
         if ( scanner == null )
         {
-            byte[] start = Bytes.toBytes( baseId );
-            byte[] stop = Bytes.toBytes( baseId + 1 );
+            byte[] start = Utils.toBytes( baseId );
+            byte[] stop = Utils.toBytes( Utils.incrementUUID( baseId ) );
             Scan s = new Scan( start, stop );
             s.addFamily( HBaseMasterTable.TREE_INFO_FAMILY );
             s.addFamily( HBaseMasterTable.NORM_ATTRIBUTES_FAMILY );
@@ -80,8 +82,8 @@
             Result next = iterator.next();
             byte[] id = next.getValue( HBaseMasterTable.TREE_INFO_FAMILY, HBaseMasterTable.ID_QUALIFIER );
 
-            currentEntry = new ForwardIndexEntry<Long, ServerEntry>();
-            currentEntry.setId( Bytes.toLong( id ) );
+            currentEntry = new ForwardIndexEntry<UUID, ServerEntry, UUID>();
+            currentEntry.setId( Utils.toUUID( id ) );
             currentEntry.setValue( baseId );
             if ( filter != null )
             {

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBasePresenceIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBasePresenceIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBasePresenceIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBasePresenceIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -20,12 +20,14 @@
 package org.apache.directory.server.core.partition.hbase.cursor;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.partition.hbase.Utils;
 import org.apache.directory.server.core.partition.hbase.table.HBasePresenceIndexTable;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.util.Bytes;
 
 
 /**
@@ -68,8 +70,8 @@
             //byte[] row = next.getRow();
             byte[] id = next.getValue( HBasePresenceIndexTable.INFO_FAMILY, HBasePresenceIndexTable.ID_QUALIFIER );
 
-            currentEntry = new ForwardIndexEntry<String, ServerEntry>();
-            currentEntry.setId( Bytes.toLong( id ) );
+            currentEntry = new ForwardIndexEntry<String, ServerEntry, UUID>();
+            currentEntry.setId( Utils.toUUID( id ) );
             return true;
         }
         return false;

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseSubLevelIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseSubLevelIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseSubLevelIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseSubLevelIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -22,6 +22,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 import java.util.regex.Pattern;
 
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -54,26 +55,26 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseSubLevelIndexCursor extends BaseHBaseIndexCursor<Long>
+public class HBaseSubLevelIndexCursor extends BaseHBaseIndexCursor<UUID>
 {
     /** The entry ID of the search base. */
-    private Long baseId;
+    private UUID baseId;
 
     /** The filter to apply while scanning. */
     private ExprNode filter;
 
     /** Contains entry IDs which needs to be scanned for children. */
-    private List<Long> parentIds;
+    private List<UUID> parentIds;
 
 
-    public HBaseSubLevelIndexCursor( Long baseId, HBaseStore store )
+    public HBaseSubLevelIndexCursor( UUID baseId, HBaseStore store )
     {
         super( store );
         this.baseId = baseId;
     }
 
 
-    public HBaseSubLevelIndexCursor( Long baseId, ExprNode filter, HBaseStore store )
+    public HBaseSubLevelIndexCursor( UUID baseId, ExprNode filter, HBaseStore store )
     {
         this( baseId, store );
         this.filter = filter;
@@ -100,9 +101,9 @@
         if ( parentIds != null && !parentIds.isEmpty() )
         {
             // create a scanner over all direct children of the parent
-            Long key = parentIds.remove( 0 );
-            byte[] start = Bytes.toBytes( key );
-            byte[] stop = Bytes.toBytes( key + 1 );
+            UUID key = parentIds.remove( 0 );
+            byte[] start = Utils.toBytes( key );
+            byte[] stop = Utils.toBytes( Utils.incrementUUID( key ) );
             Scan scan = new Scan( start, stop );
             scan.addFamily( HBaseMasterTable.TREE_INFO_FAMILY );
             scan.addFamily( HBaseMasterTable.NORM_ATTRIBUTES_FAMILY );
@@ -142,7 +143,7 @@
             // We don't need to scan for children if the entry doesn't have children.
             if ( store.getChildCount( baseId ) > 0 )
             {
-                parentIds = new ArrayList<Long>();
+                parentIds = new ArrayList<UUID>();
                 parentIds.add( baseId );
             }
 
@@ -172,11 +173,11 @@
                 // We don't need to scan for children if the entry doesn't have children.
                 if ( oneLevelCount != null && Bytes.toLong( oneLevelCount ) > 0L )
                 {
-                    parentIds.add( Bytes.toLong( id ) );
+                    parentIds.add( Utils.toUUID( id ) );
                 }
 
                 // TODO: use evaluator on normAttributes to evaluate if entry matches the filter 
-                fetchEntry( Bytes.toLong( id ), next );
+                fetchEntry( Utils.toUUID( id ), next );
                 return true;
             }
         }
@@ -185,10 +186,10 @@
     }
 
 
-    private void fetchEntry( Long id, Result next ) throws Exception
+    private void fetchEntry( UUID id, Result next ) throws Exception
     {
         //System.out.println("fetchEntry " + Bytes.toLong( id ));
-        currentEntry = new ForwardIndexEntry<Long, ServerEntry>();
+        currentEntry = new ForwardIndexEntry<UUID, ServerEntry, UUID>();
         currentEntry.setId( id );
         currentEntry.setValue( baseId );
         if ( filter != null && next != null )

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserColumnIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserColumnIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserColumnIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserColumnIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -22,6 +22,7 @@
 
 import java.io.IOException;
 import java.util.Iterator;
+import java.util.UUID;
 import java.util.regex.Pattern;
 
 import org.apache.commons.collections.iterators.EmptyIterator;
@@ -39,6 +40,7 @@
 import org.apache.hadoop.hbase.filter.RegexStringComparator;
 import org.apache.hadoop.hbase.filter.RowFilter;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
+import org.apache.hadoop.hbase.util.Bytes;
 
 
 /**
@@ -52,7 +54,7 @@
 {
 
     private final HBaseColumnIndexTable indexTable;
-    private Iterator<Long> candidates;
+    private Iterator<UUID> candidates;
 
 
     // TODO: count for substring, gt, lt
@@ -102,8 +104,8 @@
 
         if ( candidates != null && candidates.hasNext() )
         {
-            Long next = candidates.next();
-            currentEntry = new ForwardIndexEntry<Object, ServerEntry>();
+            UUID next = candidates.next();
+            currentEntry = new ForwardIndexEntry<Object, ServerEntry, UUID>();
             currentEntry.setId( next );
             currentEntry.setValue( value );
 
@@ -170,8 +172,9 @@
                      * this case is relevant for substring filters with an initial pattern, e.g. (cn=test*)
                      * - row filter is "^=test.*$" 
                      */
-                    start = indexTable.getScanKey( node.getInitial(), null );
-                    stop = indexTable.getScanKey( node.getInitial(), HBaseIndexTable.VALUE_SCAN_STOP );
+                    start = indexTable.getScanKey( node.getInitial() );
+                    stop = Bytes.add( indexTable.getScanKey( node.getInitial() ), new byte[]
+                        { ( byte ) 0xFF } );
                     rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store ) + "$" );
                 }
                 else
@@ -181,8 +184,8 @@
                      * unfortunately we need to scan the whole index, but can set a row filter
                      * - row filter is "^=.*test.*$" 
                      */
-                    start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START, null );
-                    stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null );
+                    start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START );
+                    stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP );
                     rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store ) + "$" );
                 }
             }
@@ -193,8 +196,8 @@
                  * - start row is "=test"
                  * - stop row is "=0xFF"
                  */
-                start = indexTable.getScanKey( value, null );
-                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null );
+                start = indexTable.getScanKey( value );
+                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP );
                 // TODO: is it possible to use the LdapComparator for the row filter?
                 rowFilterPattern = null;
             }
@@ -206,8 +209,8 @@
                  * - start row is "=0x00"
                  * - stop row is "=0xFF"
                  */
-                start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START, null );
-                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null );
+                start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START );
+                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP );
                 // TODO: is it possible to use the LdapComparator for the row filter?
                 rowFilterPattern = null;
             }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.partition.hbase.cursor;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
 import org.apache.directory.server.xdbm.IndexEntry;
@@ -68,7 +70,7 @@
 
 
     @Override
-    public void before( IndexEntry<Object, ServerEntry> element ) throws Exception
+    public void before( IndexEntry<Object, ServerEntry, UUID> element ) throws Exception
     {
         value = element.getValue();
         reset();

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexReverseCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexReverseCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexReverseCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserIndexReverseCursor.java Mon Mar  1 22:45:47 2010
@@ -22,6 +22,7 @@
 
 import java.util.Iterator;
 import java.util.NavigableMap;
+import java.util.UUID;
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
@@ -43,15 +44,15 @@
 public class HBaseUserIndexReverseCursor extends AbstractHBaseIndexCursor<Object, ServerEntry>
 {
     private String attributeTypeOid;
-    private Long id;
+    private UUID id;
     private HBaseStore store;
 
     private NavigableMap<byte[], byte[]> attributeMap;
     private Iterator<byte[]> attributeIterator;
-    private IndexEntry<Object, ServerEntry> currentEntry;
+    private IndexEntry<Object, ServerEntry, UUID> currentEntry;
 
 
-    public HBaseUserIndexReverseCursor( String attributeTypeOid, Long id, HBaseStore store )
+    public HBaseUserIndexReverseCursor( String attributeTypeOid, UUID id, HBaseStore store )
     {
         this.attributeTypeOid = attributeTypeOid;
         this.id = id;
@@ -60,7 +61,7 @@
 
 
     @Override
-    public IndexEntry<Object, ServerEntry> get() throws Exception
+    public IndexEntry<Object, ServerEntry, UUID> get() throws Exception
     {
         return currentEntry;
     }
@@ -92,7 +93,7 @@
 
             if ( oid != null && oid.equals( attributeTypeOid ) )
             {
-                currentEntry = new ForwardIndexEntry<Object, ServerEntry>();
+                currentEntry = new ForwardIndexEntry<Object, ServerEntry, UUID>();
                 currentEntry.setId( id );
                 AttributeType at = store.getSchemaManager().getAttributeTypeRegistry().lookup( attributeTypeOid );
                 currentEntry.setValue( at.getSyntax().isHumanReadable() ? Bytes.toString( value ) : value );

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserRowIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserRowIndexCursor.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserRowIndexCursor.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/cursor/HBaseUserRowIndexCursor.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.partition.hbase.cursor;
 
 
+import java.util.UUID;
 import java.util.regex.Pattern;
 
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -35,7 +36,6 @@
 import org.apache.hadoop.hbase.filter.RegexStringComparator;
 import org.apache.hadoop.hbase.filter.RowFilter;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
-import org.apache.hadoop.hbase.util.Bytes;
 
 
 /**
@@ -88,14 +88,14 @@
                 /*
                  * this case is relevant for equal filters, e.g. (cn=test)
                  * we exactly set the bound of the scanner:
-                 * - start row is "=test0x00"
-                 * - stop row is "=test0xFF"
-                 * - row filter is "^=test[A-Za-z0-9+/=]{12}$" 
+                 * - start row is "=test\00<VALUE_SCAN_START>"
+                 * - stop row is "=test\00<VALUE_SCAN_STOP>"
+                 * - row filter is "^=test\00[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$"
                  */
-                start = indexTable.getScanKey( value, HBaseIndexTable.VALUE_SCAN_START );
-                stop = indexTable.getScanKey( value, HBaseIndexTable.VALUE_SCAN_STOP );
-                rowFilterPattern = Pattern.compile( "^=" + Pattern.quote( "" + value ) + "[A-Za-z0-9+/=]{12}$" );
-                //rowFilterPattern = null;
+                start = indexTable.getScanKey( value, HBaseIndexTable.DELIMITER, HBaseIndexTable.VALUE_SCAN_START );
+                stop = indexTable.getScanKey( value, HBaseIndexTable.DELIMITER, HBaseIndexTable.VALUE_SCAN_STOP );
+                rowFilterPattern = Pattern.compile( "^=" + Pattern.quote( "" + value ) + Pattern.quote( "\00" )
+                    + "[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" );
             }
             else if ( node != null )
             {
@@ -103,39 +103,43 @@
                 {
                     /*
                      * this case is relevant for substring filters with an initial pattern, e.g. (cn=test*)
-                     * - start row is "=test0x00"
-                     * - stop row is "=test0xFF"
-                     * - row filter is "^=test.*[A-Za-z0-9+/=]{12}$" 
+                     * - start row is "=test\00"
+                     * - stop row is "=test\FF"
+                     * - row filter is "^=test.*\00[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" 
                      */
-                    start = indexTable.getScanKey( node.getInitial(), HBaseIndexTable.VALUE_SCAN_START );
-                    stop = indexTable.getScanKey( node.getInitial(), HBaseIndexTable.VALUE_SCAN_STOP );
+                    start = indexTable.getScanKey( node.getInitial(), HBaseIndexTable.FULL_SCAN_START, null );
+                    stop = indexTable.getScanKey( node.getInitial(), HBaseIndexTable.FULL_SCAN_STOP, null );
+                    //start = new byte[0];
+                    //stop = new byte[0];
                     rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store )
-                        + "[A-Za-z0-9+/=]{12}$" );
+                        + Pattern.quote( "\00" )
+                        + "[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" );
                 }
                 else
                 {
                     /*
                      * this case is relevant for substring filters w/o an initial pattern, e.g. (cn=*test*) 
                      * unfortunately we need to scan the whole index, but can set a row filter
-                     * - start row is "=0x00"
-                     * - stop row is "=0xFF"
-                     * - row filter is "^=.*test.*[A-Za-z0-9+/=]{12}$" 
+                     * - start row is "=\00"
+                     * - stop row is "=\FF"
+                     * - row filter is "^=.*test.*\00[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" 
                      */
-                    start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START, null );
-                    stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null );
+                    start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START, null, null );
+                    stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null, null );
                     rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store )
-                        + "[A-Za-z0-9+/=]{12}$" );
+                        + Pattern.quote( "\00" )
+                        + "[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$" );
                 }
             }
             else if ( value != null )
             {
                 /*
                  * this case is relevant for greater than filters (the start value is set by before(IndexEntry)), e.g. (cn>=test)
-                 * - start row is "=test0x00"
-                 * - stop row is "=0xFF"
+                 * - start row is "=test\00"
+                 * - stop row is "=\FF"
                  */
-                start = indexTable.getScanKey( value, HBaseIndexTable.VALUE_SCAN_START );
-                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null );
+                start = indexTable.getScanKey( value, HBaseIndexTable.DELIMITER, null );
+                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null, null );
                 // TODO: is it possible to use the LdapComparator for the row filter?
                 rowFilterPattern = null;
             }
@@ -144,11 +148,11 @@
                 /*
                  * this case is relevant for less than filters, e.g. (cn<=test)
                  * unfortunately we need to scan the whole index
-                 * - start row is "=0x00"
-                 * - stop row is "=0xFF"
+                 * - start row is "=\00"
+                 * - stop row is "=\FF"
                  */
-                start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START, null );
-                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null );
+                start = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_START, null, null );
+                stop = indexTable.getScanKey( HBaseIndexTable.FULL_SCAN_STOP, null, null );
                 // TODO: is it possible to use the LdapComparator for the row filter?
                 rowFilterPattern = null;
             }
@@ -176,13 +180,13 @@
         {
             Result next = iterator.next();
             //byte[] row = next.getRow();
-            Object value = indexTable.getValueFromEqualsKey( next.getRow() );
+            Object value = indexTable.extractValueFromEqualsKey( next.getRow() );
             if ( value != null )
             {
                 byte[] id = next.getValue( HBaseIndexTable.INFO_FAMILY, HBaseIndexTable.ID_QUALIFIER );
 
-                currentEntry = new ForwardIndexEntry<Object, ServerEntry>();
-                currentEntry.setId( Bytes.toLong( id ) );
+                currentEntry = new ForwardIndexEntry<Object, ServerEntry, UUID>();
+                currentEntry.setId( Utils.toUUID( id ) );
                 currentEntry.setValue( value );
                 return true;
             }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/AbstractHBaseIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/AbstractHBaseIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/AbstractHBaseIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/AbstractHBaseIndex.java Mon Mar  1 22:45:47 2010
@@ -21,6 +21,7 @@
 
 
 import java.io.File;
+import java.util.UUID;
 
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
 import org.apache.directory.server.xdbm.Index;
@@ -36,14 +37,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractHBaseIndex<K, O> implements Index<K, O>
+public abstract class AbstractHBaseIndex<K, O> implements Index<K, O, UUID>
 {
 
     protected int cacheSize = DEFAULT_INDEX_CACHE_SIZE;
     protected String attributeId;
     protected HBaseStore store;
 
-    
+
     public HBaseStore getStore()
     {
         return store;
@@ -56,7 +57,7 @@
     }
 
 
-    public void add( K attrVal, Long id ) throws Exception
+    public void add( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -74,13 +75,13 @@
     }
 
 
-    public void drop( Long entryId ) throws Exception
+    public void drop( UUID entryId ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void drop( K attrVal, Long id ) throws Exception
+    public void drop( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -92,19 +93,19 @@
     }
 
 
-    public boolean forward( K attrVal, Long id ) throws Exception
+    public boolean forward( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O> forwardCursor() throws Exception
+    public IndexCursor<K, O, UUID> forwardCursor() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O> forwardCursor( K key ) throws Exception
+    public IndexCursor<K, O, UUID> forwardCursor( K key ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -116,7 +117,7 @@
     }
 
 
-    public boolean forwardGreaterOrEq( K attrVal, Long id ) throws Exception
+    public boolean forwardGreaterOrEq( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -128,19 +129,19 @@
     }
 
 
-    public boolean forwardLessOrEq( K attrVal, Long id ) throws Exception
+    public boolean forwardLessOrEq( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Long forwardLookup( K attrVal ) throws Exception
+    public UUID forwardLookup( K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Cursor<Long> forwardValueCursor( K key ) throws Exception
+    public Cursor<UUID> forwardValueCursor( K key ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -194,61 +195,61 @@
     }
 
 
-    public boolean reverse( Long id ) throws Exception
+    public boolean reverse( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverse( Long id, K attrVal ) throws Exception
+    public boolean reverse( UUID id, K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O> reverseCursor() throws Exception
+    public IndexCursor<K, O, UUID> reverseCursor() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O> reverseCursor( Long id ) throws Exception
+    public IndexCursor<K, O, UUID> reverseCursor( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseGreaterOrEq( Long id ) throws Exception
+    public boolean reverseGreaterOrEq( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseGreaterOrEq( Long id, K attrVal ) throws Exception
+    public boolean reverseGreaterOrEq( UUID id, K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseLessOrEq( Long id ) throws Exception
+    public boolean reverseLessOrEq( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseLessOrEq( Long id, K attrVal ) throws Exception
+    public boolean reverseLessOrEq( UUID id, K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public K reverseLookup( Long id ) throws Exception
+    public K reverseLookup( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Cursor<K> reverseValueCursor( Long id ) throws Exception
+    public Cursor<K> reverseValueCursor( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseAliasIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseAliasIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseAliasIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseAliasIndex.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.partition.hbase.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 
 
@@ -39,7 +41,7 @@
     }
 
 
-    public String reverseLookup( Long id ) throws Exception
+    public String reverseLookup( UUID id ) throws Exception
     {
         // TODO 
         return null;

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseNdnIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseNdnIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseNdnIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseNdnIndex.java Mon Mar  1 22:45:47 2010
@@ -22,8 +22,8 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
+import org.apache.directory.server.core.partition.hbase.cursor.AbstractHBaseIndexCursor;
 import org.apache.directory.server.core.partition.hbase.cursor.HBaseNdnIndexCursor;
-import org.apache.directory.server.xdbm.IndexCursor;
 
 
 /**
@@ -39,8 +39,8 @@
     public HBaseNdnIndex()
     {
     }
-    
-    
+
+
     public HBaseNdnIndex( HBaseStore store )
     {
         setStore( store );
@@ -53,14 +53,14 @@
 
 
     @Override
-    public IndexCursor<String, ServerEntry> forwardCursor() throws Exception
+    public AbstractHBaseIndexCursor<String, ServerEntry> forwardCursor() throws Exception
     {
         return new HBaseNdnIndexCursor( store );
     }
 
 
     @Override
-    public IndexCursor<String, ServerEntry> reverseCursor() throws Exception
+    public AbstractHBaseIndexCursor<String, ServerEntry> reverseCursor() throws Exception
     {
         return new HBaseNdnIndexCursor( store );
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneAliasIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneAliasIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneAliasIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneAliasIndex.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.partition.hbase.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.xdbm.EmptyIndexCursor;
 import org.apache.directory.server.xdbm.IndexCursor;
@@ -33,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseOneAliasIndex extends AbstractHBaseIndex<Long, ServerEntry>
+public class HBaseOneAliasIndex extends AbstractHBaseIndex<UUID, ServerEntry>
 {
 
     public void close() throws Exception
@@ -42,7 +44,7 @@
 
 
     @Override
-    public boolean forward( Long attrVal, Long id ) throws Exception
+    public boolean forward( UUID attrVal, UUID id ) throws Exception
     {
         // TODO
         return false;
@@ -50,9 +52,9 @@
 
 
     @Override
-    public IndexCursor<Long, ServerEntry> forwardCursor( Long key ) throws Exception
+    public IndexCursor<UUID, ServerEntry, UUID> forwardCursor( UUID key ) throws Exception
     {
-        return new EmptyIndexCursor<Long, ServerEntry>();
+        return new EmptyIndexCursor<UUID, ServerEntry, UUID>();
     }
 
 }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneLevelIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneLevelIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneLevelIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseOneLevelIndex.java Mon Mar  1 22:45:47 2010
@@ -20,11 +20,12 @@
 package org.apache.directory.server.core.partition.hbase.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
 import org.apache.directory.server.core.partition.hbase.cursor.HBaseOneLevelIndexCursor;
 import org.apache.directory.server.core.partition.hbase.xdbmext.IndexFilteringExtension;
-import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
@@ -35,14 +36,15 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseOneLevelIndex extends AbstractHBaseIndex<Long, ServerEntry> implements
-    IndexFilteringExtension<Long, ServerEntry>
+public class HBaseOneLevelIndex extends AbstractHBaseIndex<UUID, ServerEntry> implements
+    IndexFilteringExtension<UUID, ServerEntry, UUID>
 {
 
     public HBaseOneLevelIndex()
     {
     }
 
+
     public HBaseOneLevelIndex( HBaseStore store )
     {
         setStore( store );
@@ -54,29 +56,29 @@
     }
 
 
-    public boolean forward( Long baseId, Long id ) throws Exception
+    public boolean forward( UUID baseId, UUID id ) throws Exception
     {
         // check if 'id' is child of 'baseId'
-        long parentId = store.getMasterTable().fetchParentId( id );
-        return baseId == parentId;
+        UUID parentId = store.getMasterTable().fetchParentId( id );
+        return baseId.equals( parentId );
     }
 
 
     @Override
-    public IndexCursor<Long, ServerEntry> forwardCursor( Long baseId ) throws Exception
+    public HBaseOneLevelIndexCursor forwardCursor( UUID baseId ) throws Exception
     {
         return new HBaseOneLevelIndexCursor( baseId, store );
     }
 
 
-    public IndexCursor<Long, ServerEntry> forwardFilteringCursor( Long baseId, ExprNode filter ) throws Exception
+    public HBaseOneLevelIndexCursor forwardFilteringCursor( UUID baseId, ExprNode filter ) throws Exception
     {
         return new HBaseOneLevelIndexCursor( baseId, filter, store );
     }
 
 
     @Override
-    public int count( Long id ) throws Exception
+    public int count( UUID id ) throws Exception
     {
         return store.getMasterTable().getOneLevelCount( id );
 

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBasePresenceIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBasePresenceIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBasePresenceIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBasePresenceIndex.java Mon Mar  1 22:45:47 2010
@@ -22,6 +22,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.UUID;
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
@@ -72,7 +73,7 @@
 
 
     @Override
-    public boolean forward( String attributeTypeOid, Long entryId ) throws Exception
+    public boolean forward( String attributeTypeOid, UUID entryId ) throws Exception
     {
         return getPresenceIndexTable( attributeTypeOid ).exists( entryId );
     }
@@ -86,14 +87,14 @@
 
 
     @Override
-    public void add( String attributeTypeOid, Long id ) throws Exception
+    public void add( String attributeTypeOid, UUID id ) throws Exception
     {
         getPresenceIndexTable( attributeTypeOid ).add( id );
     }
 
 
     @Override
-    public void drop( String attributeTypeOid, Long id ) throws Exception
+    public void drop( String attributeTypeOid, UUID id ) throws Exception
     {
         getPresenceIndexTable( attributeTypeOid ).drop( id );
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubAliasIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubAliasIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubAliasIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubAliasIndex.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.partition.hbase.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.xdbm.EmptyIndexCursor;
 import org.apache.directory.server.xdbm.IndexCursor;
@@ -33,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseSubAliasIndex extends AbstractHBaseIndex<Long, ServerEntry>
+public class HBaseSubAliasIndex extends AbstractHBaseIndex<UUID, ServerEntry>
 {
 
     public void close() throws Exception
@@ -42,7 +44,7 @@
 
 
     @Override
-    public boolean forward( Long attrVal, Long id ) throws Exception
+    public boolean forward( UUID attrVal, UUID id ) throws Exception
     {
         // TODO
         return false;
@@ -50,8 +52,8 @@
 
 
     @Override
-    public IndexCursor<Long, ServerEntry> forwardCursor( Long key ) throws Exception
+    public IndexCursor<UUID, ServerEntry, UUID> forwardCursor( UUID key ) throws Exception
     {
-        return new EmptyIndexCursor<Long, ServerEntry>();
+        return new EmptyIndexCursor<UUID, ServerEntry, UUID>();
     }
 }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubLevelIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubLevelIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubLevelIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseSubLevelIndex.java Mon Mar  1 22:45:47 2010
@@ -20,11 +20,13 @@
 package org.apache.directory.server.core.partition.hbase.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
 import org.apache.directory.server.core.partition.hbase.cursor.HBaseSubLevelIndexCursor;
+import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable;
 import org.apache.directory.server.core.partition.hbase.xdbmext.IndexFilteringExtension;
-import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
@@ -35,8 +37,8 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HBaseSubLevelIndex extends AbstractHBaseIndex<Long, ServerEntry> implements
-    IndexFilteringExtension<Long, ServerEntry>
+public class HBaseSubLevelIndex extends AbstractHBaseIndex<UUID, ServerEntry> implements
+    IndexFilteringExtension<UUID, ServerEntry, UUID>
 {
 
     public HBaseSubLevelIndex()
@@ -55,36 +57,36 @@
     }
 
 
-    public boolean forward( Long baseId, Long id ) throws Exception
+    public boolean forward( UUID baseId, UUID id ) throws Exception
     {
         // check if 'id' is (grand-)child of 'baseId'
         // TODO: optimization: cache context entry ID 
-        long parentId = id;
-        while ( parentId != baseId && parentId != 0L )
+        UUID parentId = id;
+        while ( !parentId.equals( baseId ) && !parentId.equals( HBaseMasterTable.ROOT_ID ) )
         {
             //System.out.println("parent: " + parentId);
             parentId = store.getMasterTable().fetchParentId( parentId );
         }
         //System.out.println("subLevelIndex.forward " + key + " -> " + id + " = " + (key==parentId));
-        return baseId == parentId;
+        return baseId.equals( parentId );
     }
 
 
     @Override
-    public IndexCursor<Long, ServerEntry> forwardCursor( Long baseId ) throws Exception
+    public HBaseSubLevelIndexCursor forwardCursor( UUID baseId ) throws Exception
     {
         return new HBaseSubLevelIndexCursor( baseId, store );
     }
 
 
-    public IndexCursor<Long, ServerEntry> forwardFilteringCursor( Long baseId, ExprNode filter ) throws Exception
+    public HBaseSubLevelIndexCursor forwardFilteringCursor( UUID baseId, ExprNode filter ) throws Exception
     {
         return new HBaseSubLevelIndexCursor( baseId, filter, store );
     }
 
 
     @Override
-    public int count( Long baseId ) throws Exception
+    public int count( UUID baseId ) throws Exception
     {
         return store.getMasterTable().getSubLevelCount( baseId );
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserIndex.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserIndex.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserIndex.java Mon Mar  1 22:45:47 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.partition.hbase.index;
 
 
+import java.util.UUID;
 import java.util.regex.Pattern;
 
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -38,7 +39,7 @@
  * @version $Rev$, $Date$
  */
 public abstract class HBaseUserIndex<T extends HBaseIndexTable> extends AbstractHBaseIndex<Object, ServerEntry>
-    implements IndexSubstringExtension<Object, ServerEntry>
+    implements IndexSubstringExtension<Object, ServerEntry, UUID>
 {
 
     protected HBaseUserIndex()
@@ -86,21 +87,21 @@
 
 
     @Override
-    public boolean forward( Object value, Long id ) throws Exception
+    public boolean forward( Object value, UUID id ) throws Exception
     {
         return getIndexTable().exists( value, id );
     }
 
 
     @Override
-    public IndexCursor<Object, ServerEntry> reverseCursor( Long id ) throws Exception
+    public IndexCursor<Object, ServerEntry, UUID> reverseCursor( UUID id ) throws Exception
     {
         return new HBaseUserIndexReverseCursor( getAttributeId(), id, store );
     }
 
 
     @Override
-    public boolean reverseLessOrEq( Long id, Object attrVal ) throws Exception
+    public boolean reverseLessOrEq( UUID id, Object attrVal ) throws Exception
     {
         String testValue = ( String ) attrVal;
         HBaseUserIndexReverseCursor cursor = new HBaseUserIndexReverseCursor( getAttributeId(), id, store );
@@ -123,7 +124,7 @@
 
 
     @Override
-    public boolean reverseGreaterOrEq( Long id, Object attrVal ) throws Exception
+    public boolean reverseGreaterOrEq( UUID id, Object attrVal ) throws Exception
     {
         String testValue = ( String ) attrVal;
         HBaseUserIndexReverseCursor cursor = new HBaseUserIndexReverseCursor( getAttributeId(), id, store );
@@ -156,7 +157,7 @@
         {
             //System.out.println("substringCount: scan for '" + node.getInitial() + "', totalCount=" + totalCount);
 
-            IndexCursor<Object, ServerEntry> cursor = forwardSubstringCursor( node );
+            IndexCursor<Object, ServerEntry, UUID> cursor = forwardSubstringCursor( node );
             int substringCount = 0;
             //long t0 = System.currentTimeMillis();
             while ( cursor.next() )
@@ -183,14 +184,14 @@
     }
 
 
-    public boolean forwardSubstring( SubstringNode expr, Pattern valuePattern, Long id ) throws Exception
+    public boolean forwardSubstring( SubstringNode expr, Pattern valuePattern, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
     @Override
-    public void add( Object value, Long id ) throws Exception
+    public void add( Object value, UUID id ) throws Exception
     {
         if ( value instanceof byte[] )
         {
@@ -204,7 +205,7 @@
 
 
     @Override
-    public void drop( Object value, Long id ) throws Exception
+    public void drop( Object value, UUID id ) throws Exception
     {
         if ( value instanceof byte[] )
         {

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/IndexBuilder.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/IndexBuilder.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/IndexBuilder.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/IndexBuilder.java Mon Mar  1 22:45:47 2010
@@ -21,9 +21,12 @@
 
 
 import java.io.IOException;
+import java.util.Map;
+import java.util.UUID;
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.hbase.HBaseStore;
+import org.apache.directory.server.core.partition.hbase.Utils;
 import org.apache.directory.server.core.partition.hbase.index.HBaseUserColumnIndex;
 import org.apache.directory.server.core.partition.hbase.index.HBaseUserIndex;
 import org.apache.directory.server.core.partition.hbase.index.HBaseUserRowIndex;
@@ -38,7 +41,6 @@
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.mapreduce.TableMapper;
-import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Mapper;
@@ -107,8 +109,13 @@
             String tablePrefix = context.getConfiguration().get( TABLE_PREFIX );
             store.setTablePrefix( tablePrefix );
             store.init( schemaManager );
+
             store.getConfiguration().setBoolean( HBaseStore.STRONG_CONSISTENCY_PROPERTY, false );
-            store.getConfiguration().setBoolean( HBaseMasterTable.MAINTAIN_COUNTERS_PROPERTY, true );
+            store.getConfiguration().setBoolean( HBaseMasterTable.MAINTAIN_COUNTERS_PROPERTY, false );
+            for ( Map.Entry<String, String> property : context.getConfiguration() )
+            {
+                store.getConfiguration().set( property.getKey(), property.getValue() );
+            }
         }
         catch ( Throwable e )
         {
@@ -139,10 +146,8 @@
     {
         try
         {
-            // write to tree table
-            Long id = Bytes.toLong( key.get() );
+            UUID id = Utils.toUUID( key.get() );
             ServerEntry entry = store.getMasterTable().convertToServerEntry( id, result );
-            store.getMasterTable().addToTree( id, entry );
 
             // write index tables
             for ( EntryAttribute attribute : entry )
@@ -164,7 +169,7 @@
         }
         catch ( Exception e )
         {
-            System.err.println( "Error indexing entry id=" + Bytes.toLong( key.get() ) );
+            System.err.println( "Error indexing entry id=" + Utils.toUUID( key.get() ) );
             System.err.println( ">>>" + result + "<<<" );
             e.printStackTrace();
         }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/LdifImporter.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/LdifImporter.java?rev=917770&r1=917769&r2=917770&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/LdifImporter.java (original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/mapreduce/LdifImporter.java Mon Mar  1 22:45:47 2010
@@ -22,6 +22,7 @@
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import javax.naming.NamingException;
@@ -91,8 +92,13 @@
             store.setCacheSize( 100 );
             store.setTablePrefix( context.getConfiguration().get( TABLE_PREFIX ) );
             store.init( schemaManager );
+
             store.getConfiguration().setBoolean( HBaseStore.STRONG_CONSISTENCY_PROPERTY, false );
             store.getConfiguration().setBoolean( HBaseMasterTable.MAINTAIN_COUNTERS_PROPERTY, false );
+            for ( Map.Entry<String, String> property : context.getConfiguration() )
+            {
+                store.getConfiguration().set( property.getKey(), property.getValue() );
+            }
         }
         catch ( Throwable e )
         {



Mime
View raw message