Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30B957BA7 for ; Thu, 28 Jul 2011 21:24:00 +0000 (UTC) Received: (qmail 46495 invoked by uid 500); 28 Jul 2011 21:24:00 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 46442 invoked by uid 500); 28 Jul 2011 21:23:59 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 46435 invoked by uid 99); 28 Jul 2011 21:23:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2011 21:23:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2011 21:23:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 40CCD238890D for ; Thu, 28 Jul 2011 21:23:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1152005 [1/2] - in /directory/sandbox/seelmann: hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/ hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/suites/ hbase-parti... Date: Thu, 28 Jul 2011 21:23:24 -0000 To: commits@directory.apache.org From: seelmann@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110728212326.40CCD238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: seelmann Date: Thu Jul 28 21:23:18 2011 New Revision: 1152005 URL: http://svn.apache.org/viewvc?rev=1152005&view=rev Log: Fix more compilation errors Added: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseContext.java Modified: directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionIT.java directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionPT.java directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/suites/StockServerISuite.java directory/sandbox/seelmann/hbase-partition/pom.xml 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/HBaseEmbeddedPartition.java directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartitionFactory.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/BaseHBaseIndexCursor.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/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/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/HBaseRdnIndex.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/HBaseUserColumnIndex.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/index/HBaseUserRowIndex.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/table/HBaseIndexTableBase.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/HBaseTablePool.java Modified: directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionIT.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionIT.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionIT.java (original) +++ directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionIT.java Thu Jul 28 21:23:18 2011 @@ -55,13 +55,13 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Modification; import org.apache.directory.shared.ldap.model.entry.ModificationOperation; -import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException; +import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException; import org.apache.directory.shared.ldap.model.filter.FilterParser; -import org.apache.directory.shared.ldap.model.filter.SearchScope; -import org.apache.directory.shared.ldap.message.AliasDerefMode; +import org.apache.directory.shared.ldap.model.message.SearchScope; +import org.apache.directory.shared.ldap.model.message.AliasDerefMode; import org.apache.directory.shared.ldap.model.name.Dn; import org.apache.directory.shared.ldap.model.name.Rdn; -import org.apache.directory.shared.util.String; +import org.apache.directory.shared.util.Strings; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Result; @@ -501,7 +501,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-ou", entry.get( "ou" ).get( 0 ).getString() ); + assertEquals( "test-ou", entry.get( "ou" ).get().getString() ); assertFalse( cursor.next() ); } @@ -532,7 +532,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test-person,ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-person", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test-person", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -551,7 +551,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test-person,ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-person", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test-person", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -570,7 +570,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test-person,ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-person", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test-person", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -589,7 +589,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-ou", entry.get( "ou" ).get( 0 ).getString() ); + assertEquals( "test-ou", entry.get( "ou" ).get().getString() ); assertFalse( cursor.next() ); } @@ -608,8 +608,8 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test-person,ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-person", entry.get( "cn" ).get( 0 ).getString() ); - assertEquals( "test-person", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test-person", entry.get( "cn" ).get().getString() ); + assertEquals( "test-person", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -628,8 +628,8 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test-person,ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-person", entry.get( "cn" ).get( 0 ).getString() ); - assertEquals( "test-person", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test-person", entry.get( "cn" ).get().getString() ); + assertEquals( "test-person", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -688,8 +688,8 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test-person,ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-person", entry.get( "cn" ).get( 0 ).getString() ); - assertEquals( "test-person", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test-person", entry.get( "cn" ).get().getString() ); + assertEquals( "test-person", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -727,7 +727,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-ou", entry.get( "ou" ).get( 0 ).getString() ); + assertEquals( "test-ou", entry.get( "ou" ).get().getString() ); assertFalse( cursor.next() ); } @@ -746,7 +746,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-ou", entry.get( "ou" ).get( 0 ).getString() ); + assertEquals( "test-ou", entry.get( "ou" ).get().getString() ); assertFalse( cursor.next() ); } @@ -765,7 +765,7 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "ou=test-ou,o=hbase", entry.getDn().getName() ); - assertEquals( "test-ou", entry.get( "ou" ).get( 0 ).getString() ); + assertEquals( "test-ou", entry.get( "ou" ).get().getString() ); assertFalse( cursor.next() ); } @@ -830,8 +830,8 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test999,ou=test1000,o=hbase", entry.getDn().getName() ); - assertEquals( "test999", entry.get( "cn" ).get( 0 ).getString() ); - assertEquals( "test999", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test999", entry.get( "cn" ).get().getString() ); + assertEquals( "test999", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } @@ -849,8 +849,8 @@ public class HBasePartitionIT extends Ab Entry entry = cursor.get(); assertNotNull( entry ); assertEquals( "cn=test999,ou=test1000,o=hbase", entry.getDn().getName() ); - assertEquals( "test999", entry.get( "cn" ).get( 0 ).getString() ); - assertEquals( "test999", entry.get( "sn" ).get( 0 ).getString() ); + assertEquals( "test999", entry.get( "cn" ).get().getString() ); + assertEquals( "test999", entry.get( "sn" ).get().getString() ); assertFalse( cursor.next() ); } Modified: directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionPT.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionPT.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionPT.java (original) +++ directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/it/HBasePartitionPT.java Thu Jul 28 21:23:18 2011 @@ -42,8 +42,8 @@ import org.apache.directory.server.core. import org.apache.directory.shared.ldap.model.entry.DefaultEntry; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.filter.FilterParser; -import org.apache.directory.shared.ldap.model.filter.SearchScope; -import org.apache.directory.shared.ldap.message.AliasDerefMode; +import org.apache.directory.shared.ldap.model.message.SearchScope; +import org.apache.directory.shared.ldap.model.message.AliasDerefMode; import org.apache.directory.shared.ldap.model.name.Dn; import org.apache.directory.shared.ldap.model.schema.SchemaManager; import org.junit.Before; Modified: directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/suites/StockServerISuite.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/suites/StockServerISuite.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/suites/StockServerISuite.java (original) +++ directory/sandbox/seelmann/hbase-partition-test/src/test/java/org/apache/directory/server/core/partition/hbase/suites/StockServerISuite.java Thu Jul 28 21:23:18 2011 @@ -28,7 +28,7 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.annotations.CreatePartition; import org.apache.directory.server.core.integ.FrameworkSuite; import org.apache.directory.server.operations.add.AddIT; -import org.apache.directory.server.operations.add.AddingEntriesWithSpecialCharactersInRdnIT; +//import org.apache.directory.server.operations.add.AddingEntriesWithSpecialCharactersInRdnIT; import org.apache.directory.server.operations.bind.BindIT; import org.apache.directory.server.operations.bind.MiscBindIT; import org.apache.directory.server.operations.bind.SaslBindIT; @@ -71,7 +71,7 @@ import org.junit.runners.Suite; @RunWith ( FrameworkSuite.class ) @Ignore @Suite.SuiteClasses ( { - AddingEntriesWithSpecialCharactersInRdnIT.class, +// AddingEntriesWithSpecialCharactersInRdnIT.class, AddIT.class, BindIT.class, Modified: directory/sandbox/seelmann/hbase-partition/pom.xml URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/pom.xml?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition/pom.xml (original) +++ directory/sandbox/seelmann/hbase-partition/pom.xml Thu Jul 28 21:23:18 2011 @@ -45,6 +45,10 @@ org.apache.directory.shared shared-ldap-model + + org.apache.directory.shared + shared-ldap-schema-data + ${project.groupId} @@ -55,13 +59,11 @@ ${project.groupId} apacheds-core - Added: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseContext.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseContext.java?rev=1152005&view=auto ============================================================================== --- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseContext.java (added) +++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseContext.java Thu Jul 28 21:23:18 2011 @@ -0,0 +1,30 @@ + +package org.apache.directory.server.core.partition.hbase; + +import java.util.UUID; + +import org.apache.directory.server.core.partition.hbase.index.HBaseUserIndex; +import org.apache.directory.server.core.partition.hbase.table.HBaseIndexTable; +import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable; +import org.apache.directory.server.xdbm.Store; +import org.apache.directory.shared.ldap.model.entry.Entry; +import org.apache.directory.shared.ldap.model.exception.LdapException; +import org.apache.directory.shared.ldap.model.schema.SchemaManager; +import org.apache.hadoop.conf.Configuration; + +public interface HBaseContext extends Store +{ + + SchemaManager getSchemaManager(); + + String getTablePrefix(); + + Configuration getConfiguration(); + + HBaseMasterTable getMasterTable(); + + boolean hasUserIndexOn( String attributeId ) throws LdapException; + + HBaseUserIndex getIndex( String attributeTypeOid ); + +} 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -20,18 +20,34 @@ package org.apache.directory.server.core.partition.hbase; -import java.util.Map; +import java.io.File; import java.util.UUID; +import org.apache.directory.server.constants.ApacheSchemaConstants; import org.apache.directory.server.core.partition.Partition; +import org.apache.directory.server.core.partition.hbase.index.AbstractHBaseIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseAliasIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseOneAliasIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseOneLevelIndex; +import org.apache.directory.server.core.partition.hbase.index.HBasePresenceIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseRdnIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseSubAliasIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseSubLevelIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseUserIndex; +import org.apache.directory.server.core.partition.hbase.index.HBaseUserRowIndex; +import org.apache.directory.server.core.partition.hbase.table.HBaseIndexTable; +import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable; import org.apache.directory.server.core.partition.hbase.xdbmext.ExtendedCursorBuilder; import org.apache.directory.server.core.partition.hbase.xdbmext.ExtendedEvaluatorBuilder; import org.apache.directory.server.core.partition.hbase.xdbmext.ExtendedOptimizer; -import org.apache.directory.server.core.partition.impl.xdbm.AbstractXdbmPartition; +import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition; import org.apache.directory.server.xdbm.Index; import org.apache.directory.server.xdbm.search.impl.DefaultSearchEngine; import org.apache.directory.shared.ldap.model.entry.Entry; -import org.apache.directory.shared.ldap.model.schema.normalizers.OidNormalizer; +import org.apache.directory.shared.ldap.model.exception.LdapException; +import org.apache.directory.shared.ldap.model.schema.SchemaManager; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; /** @@ -42,42 +58,53 @@ import org.apache.directory.shared.ldap. * @author Apache Directory Project * @version $Rev$, $Date$ */ -public class HBaseDistributedPartition extends AbstractXdbmPartition +public class HBaseDistributedPartition extends AbstractBTreePartition implements HBaseContext { + public static final String STRONG_CONSISTENCY_PROPERTY = "org.apache.directory.strong.consistency"; + + private String tablePrefix; + + private EmbeddedHBase embeddedHBase; + private Configuration configuration; + + /** * Creates a new instance of HBasePartition. */ - public HBaseDistributedPartition() + public HBaseDistributedPartition( SchemaManager schemaManager ) { - super( new HBaseStore() ); + super( schemaManager ); } - - // ------------------------------------------------------------------------ - // L I F E C Y C L E M E T H O D S - // ------------------------------------------------------------------------ +// public UUID getEntryId( Dn dn ) throws Exception +// { +// if ( !dn.isNormalized() ) +// { +// dn.normalize( schemaManager.getNormalizerMapping() ); +// // TODO: force normalized Dn +// //throw new IllegalArgumentException( I18n.err( I18n.ERR_218, suffixDn.getName() ) ); +// } +// +// UUID id = getMasterTable().fetchId( dn ); +// return id; +// } /** * {@inheritDoc} */ protected void doInit() throws Exception { - Map oidsMap = schemaManager.getAttributeTypeRegistry().getNormalizerMapping(); - suffix.normalize( oidsMap ); - // setup optimizer and search engine - ExtendedEvaluatorBuilder evaluatorBuilder = new ExtendedEvaluatorBuilder( store, schemaManager ); - ExtendedCursorBuilder cursorBuilder = new ExtendedCursorBuilder( store, evaluatorBuilder ); - optimizer = new ExtendedOptimizer( store, cursorBuilder, evaluatorBuilder ); - searchEngine = new DefaultSearchEngine( store, cursorBuilder, evaluatorBuilder, optimizer ); + ExtendedEvaluatorBuilder evaluatorBuilder = new ExtendedEvaluatorBuilder( this, schemaManager ); + ExtendedCursorBuilder cursorBuilder = new ExtendedCursorBuilder( this, evaluatorBuilder ); + optimizer = new ExtendedOptimizer( this, cursorBuilder, evaluatorBuilder ); + searchEngine = new DefaultSearchEngine( this, cursorBuilder, evaluatorBuilder, optimizer ); // initialize the store - store.setSuffixDn( suffix ); - store.setCacheSize( cacheSize ); - store.setId( id ); - String directoryServiceInstanceName = getPartitionDir().getParentFile().getParentFile().getName(); - ( ( HBaseStore ) store ).setTablePrefix( "apacheds" + "_" + directoryServiceInstanceName + "_" + id + "_" ); + File partitionDir = new File( getPartitionPath() ); + String directoryServiceInstanceName = partitionDir.getParentFile().getParentFile().getName(); + this.tablePrefix = "apacheds" + "_" + directoryServiceInstanceName + "_" + id + "_"; for ( Index index : getIndexedAttributes() ) { @@ -87,10 +114,167 @@ public class HBaseDistributedPartition e { index.setAttributeId( oid ); } - store.addIndex( index ); + addIndex( index ); + } + + // TODO: this switch doesn't work + if ( partitionDir != null ) + { + embeddedHBase = EmbeddedHBase.getInstance( partitionDir ); + embeddedHBase.start( tablePrefix + HBaseMasterTable.TREE_TABLE ); + configuration = embeddedHBase.getConfiguration(); + } + else + { + configuration = HBaseConfiguration.create(); + } + + super.doInit(); + + // create master table + getMasterTable(); + + // We are done ! + initialized = true; + } + + + public void doDestroy() throws Exception + { + if ( master != null ) + { + master.close(); + master = null; + } + + for ( Index userIndex : userIndices.values() ) + { + userIndex.close(); + } + userIndices.clear(); + + presenceIdx.close(); + rdnIdx.close(); + oneLevelIdx.close(); + subLevelIdx.close(); + aliasIdx.close(); + oneAliasIdx.close(); + subAliasIdx.close(); + + if ( embeddedHBase != null ) + { + embeddedHBase.shutdown(); + embeddedHBase = null; + } + + schemaManager = null; + } + + @Override + public void sync() throws Exception + { + // always synched + } + + + @Override + protected Index convertAndInit( Index index ) throws Exception + { + AbstractHBaseIndex hbaseIndex; + + if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID ) ) + { + hbaseIndex = new HBasePresenceIndex( this ); + } + else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_RDN_AT_OID ) ) + { + hbaseIndex = new HBaseRdnIndex( this ); + } + else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) ) + { + hbaseIndex = new HBaseOneLevelIndex( this ); + } + else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) ) + { + hbaseIndex = new HBaseSubLevelIndex( this ); + } + else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) ) + { + hbaseIndex = new HBaseAliasIndex(); + } + else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID ) ) + { + hbaseIndex = new HBaseOneAliasIndex(); + } + else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID ) ) + { + hbaseIndex = new HBaseSubAliasIndex(); + } + else if ( !( index instanceof AbstractHBaseIndex ) ) + { + hbaseIndex = new HBaseUserRowIndex( index.getAttributeId() ); + } + else + { + hbaseIndex = ( AbstractHBaseIndex ) index; } - store.init( schemaManager ); + hbaseIndex.setContext( this ); + hbaseIndex.setCacheSize( index.getCacheSize() ); + + return hbaseIndex; + } + + + public UUID getDefaultId() + { + try + { + return getEntryId( getSuffixDn() ); + } + catch ( LdapException e ) + { + throw new RuntimeException( e ); + } + } + + + @Override + public UUID getRootId() + { + return HBaseMasterTable.ROOT_ID; + } + + public HBaseMasterTable getMasterTable() + { + if ( master == null ) + { + master = new HBaseMasterTable( this ); + } + return ( HBaseMasterTable ) master; + } + + public String getTablePrefix() + { + return tablePrefix; + } + + public Configuration getConfiguration() + { + return configuration; + } + + @Override + public boolean hasUserIndexOn( String attributeId ) throws LdapException + { + return hasUserIndexOn( schemaManager.getAttributeType( attributeId ) ); + } + + @Override + public HBaseUserIndex getIndex( String attributeTypeOid ) + { + // TODO Auto-generated method stub + return null; } } Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartition.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartition.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartition.java (original) +++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartition.java Thu Jul 28 21:23:18 2011 @@ -21,6 +21,7 @@ package org.apache.directory.server.core import org.apache.directory.server.core.partition.Partition; +import org.apache.directory.shared.ldap.model.schema.SchemaManager; /** @@ -36,9 +37,9 @@ public class HBaseEmbeddedPartition exte /** * Creates a new instance of HBaseEmbeddedPartition. */ - public HBaseEmbeddedPartition() + public HBaseEmbeddedPartition( SchemaManager schemaManager ) { - super(); + super( schemaManager ); } @@ -53,7 +54,8 @@ public class HBaseEmbeddedPartition exte { // setting the working directory triggers the store to // start up an embedded HBase server. - store.setPartitionDir( getPartitionDir() ); + // TODO +// store.setPartitionDir( getPartitionDir() ); super.doInit(); } Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartitionFactory.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartitionFactory.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartitionFactory.java (original) +++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/HBaseEmbeddedPartitionFactory.java Thu Jul 28 21:23:18 2011 @@ -29,6 +29,7 @@ import org.apache.directory.server.core. import org.apache.directory.server.xdbm.Index; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.name.Dn; +import org.apache.directory.shared.ldap.model.schema.SchemaManager; /** @@ -40,17 +41,17 @@ import org.apache.directory.shared.ldap. public class HBaseEmbeddedPartitionFactory implements PartitionFactory { - public HBaseEmbeddedPartition createPartition( String id, String suffix, int cacheSize, File workingDirectory ) + public HBaseEmbeddedPartition createPartition( SchemaManager schemaManager, String id, String suffix, int cacheSize, File workingDirectory ) throws Exception { - HBaseEmbeddedPartition partition = new HBaseEmbeddedPartition(); + HBaseEmbeddedPartition partition = new HBaseEmbeddedPartition( schemaManager ); partition.setId( id ); Dn suffixDn = new Dn( suffix ); - partition.setSuffix( suffixDn ); + partition.setSuffixDn( suffixDn ); partition.setCacheSize( 500 ); - partition.setPartitionDir( workingDirectory ); + partition.setPartitionPath( workingDirectory.toURI() ); return partition; } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -33,7 +33,7 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.partition.hbase.index.HBaseSubLevelIndex; import org.apache.directory.server.core.partition.hbase.index.HBaseUserRowIndex; import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable; -import org.apache.directory.server.xdbm.AbstractStore; +//import org.apache.directory.server.xdbm.AbstractStore; import org.apache.directory.server.xdbm.Index; import org.apache.directory.server.xdbm.Store; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; @@ -53,155 +53,155 @@ import org.apache.hadoop.hbase.HBaseConf * @author Apache Directory Project * @version $Rev$, $Date$ */ -public class HBaseStore extends AbstractStore +public class HBaseStore //extends AbstractStore { - public static final String STRONG_CONSISTENCY_PROPERTY = "org.apache.directory.strong.consistency"; - - private String tablePrefix; - - private EmbeddedHBase embeddedHBase; - private Configuration configuration; - - - public void init( SchemaManager schemaManager ) throws Exception - { - if ( partitionDir != null ) - { - embeddedHBase = EmbeddedHBase.getInstance( partitionDir ); - embeddedHBase.start( tablePrefix + HBaseMasterTable.TREE_TABLE ); - configuration = embeddedHBase.getConfiguration(); - } - else - { - configuration = HBaseConfiguration.create(); - } - - this.schemaManager = schemaManager; - - // Initialize Attribute types used all over this method - OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT ); - ALIASED_OBJECT_NAME_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ALIASED_OBJECT_NAME_AT ); - ENTRY_CSN_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_CSN_AT ); - ENTRY_UUID_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_UUID_AT ); - - // ------------------------------------------------------------------- - // Initializes the user and system indices - // ------------------------------------------------------------------- - setupSystemIndices(); - setupUserIndices(); - - // create master table - getMasterTable(); - - // We are done ! - initialized = true; - } - - - @Override - protected Index convertAndInit( Index index ) throws Exception - { - AbstractHBaseIndex hbaseIndex; - - if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID ) ) - { - hbaseIndex = new HBasePresenceIndex( this ); - } - else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_Rdn_AT_OID ) ) - { - hbaseIndex = new HBaseRdnIndex( this ); - } - else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) ) - { - hbaseIndex = new HBaseOneLevelIndex( this ); - } - else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) ) - { - hbaseIndex = new HBaseSubLevelIndex( this ); - } - else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) ) - { - hbaseIndex = new HBaseAliasIndex(); - } - else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID ) ) - { - hbaseIndex = new HBaseOneAliasIndex(); - } - else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID ) ) - { - hbaseIndex = new HBaseSubAliasIndex(); - } - else if ( !( index instanceof AbstractHBaseIndex ) ) - { - hbaseIndex = new HBaseUserRowIndex( index.getAttributeId() ); - } - else - { - hbaseIndex = ( AbstractHBaseIndex ) index; - } - - hbaseIndex.setStore( this ); - hbaseIndex.setCacheSize( index.getCacheSize() ); - - return hbaseIndex; - } - - - public void destroy() throws Exception - { - if ( master != null ) - { - master.close(); - master = null; - } - - for ( Index userIndex : userIndices.values() ) - { - userIndex.close(); - } - userIndices.clear(); - - presenceIdx.close(); - rdnIdx.close(); - oneLevelIdx.close(); - subLevelIdx.close(); - aliasIdx.close(); - oneAliasIdx.close(); - subAliasIdx.close(); - - if ( embeddedHBase != null ) - { - embeddedHBase.shutdown(); - embeddedHBase = null; - } - - schemaManager = null; - } - - - public HBaseMasterTable getMasterTable() throws Exception - { - if ( master == null ) - { - master = new HBaseMasterTable( this ); - } - return ( HBaseMasterTable ) master; - } - - - public UUID getEntryId( Dn dn ) throws Exception - { - if ( !dn.isNormalized() ) - { - dn.normalize( schemaManager.getNormalizerMapping() ); - // TODO: force normalized Dn - //throw new IllegalArgumentException( I18n.err( I18n.ERR_218, suffixDn.getName() ) ); - } - - UUID id = getMasterTable().fetchId( dn ); - return id; - } +// public static final String STRONG_CONSISTENCY_PROPERTY = "org.apache.directory.strong.consistency"; +// +// private String tablePrefix; +// +// private EmbeddedHBase embeddedHBase; +// private Configuration configuration; + + +// public void init( SchemaManager schemaManager ) throws Exception +// { +//// if ( partitionDir != null ) +//// { +//// embeddedHBase = EmbeddedHBase.getInstance( partitionDir ); +//// embeddedHBase.start( tablePrefix + HBaseMasterTable.TREE_TABLE ); +//// configuration = embeddedHBase.getConfiguration(); +//// } +//// else +//// { +//// configuration = HBaseConfiguration.create(); +//// } +//// +//// this.schemaManager = schemaManager; +// +// // Initialize Attribute types used all over this method +// OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT ); +// ALIASED_OBJECT_NAME_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ALIASED_OBJECT_NAME_AT ); +// ENTRY_CSN_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_CSN_AT ); +// ENTRY_UUID_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_UUID_AT ); +// +// // ------------------------------------------------------------------- +// // Initializes the user and system indices +// // ------------------------------------------------------------------- +// setupSystemIndices(); +// setupUserIndices(); +// +// // create master table +// getMasterTable(); +// +// // We are done ! +// initialized = true; +// } + + +// @Override +// protected Index convertAndInit( Index index ) throws Exception +// { +// AbstractHBaseIndex hbaseIndex; +// +// if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID ) ) +// { +// hbaseIndex = new HBasePresenceIndex( this ); +// } +// else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_Rdn_AT_OID ) ) +// { +// hbaseIndex = new HBaseRdnIndex( this ); +// } +// else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) ) +// { +// hbaseIndex = new HBaseOneLevelIndex( this ); +// } +// else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) ) +// { +// hbaseIndex = new HBaseSubLevelIndex( this ); +// } +// else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) ) +// { +// hbaseIndex = new HBaseAliasIndex(); +// } +// else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID ) ) +// { +// hbaseIndex = new HBaseOneAliasIndex(); +// } +// else if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID ) ) +// { +// hbaseIndex = new HBaseSubAliasIndex(); +// } +// else if ( !( index instanceof AbstractHBaseIndex ) ) +// { +// hbaseIndex = new HBaseUserRowIndex( index.getAttributeId() ); +// } +// else +// { +// hbaseIndex = ( AbstractHBaseIndex ) index; +// } +// +// hbaseIndex.setStore( this ); +// hbaseIndex.setCacheSize( index.getCacheSize() ); +// +// return hbaseIndex; +// } + + +// public void destroy() throws Exception +// { +// if ( master != null ) +// { +// master.close(); +// master = null; +// } +// +// for ( Index userIndex : userIndices.values() ) +// { +// userIndex.close(); +// } +// userIndices.clear(); +// +// presenceIdx.close(); +// rdnIdx.close(); +// oneLevelIdx.close(); +// subLevelIdx.close(); +// aliasIdx.close(); +// oneAliasIdx.close(); +// subAliasIdx.close(); +// +// if ( embeddedHBase != null ) +// { +// embeddedHBase.shutdown(); +// embeddedHBase = null; +// } +// +// schemaManager = null; +// } + + +// public HBaseMasterTable getMasterTable() throws Exception +// { +// if ( master == null ) +// { +// master = new HBaseMasterTable( this ); +// } +// return ( HBaseMasterTable ) master; +// } + + +// public UUID getEntryId( Dn dn ) throws Exception +// { +// if ( !dn.isNormalized() ) +// { +// dn.normalize( schemaManager.getNormalizerMapping() ); +// // TODO: force normalized Dn +// //throw new IllegalArgumentException( I18n.err( I18n.ERR_218, suffixDn.getName() ) ); +// } +// +// UUID id = getMasterTable().fetchId( dn ); +// return id; +// } public Entry lookup( UUID id ) throws Exception @@ -252,46 +252,46 @@ public class HBaseStore extends Abstract } - public void sync() throws Exception - { - // always synched - } - - - public void setTablePrefix( String tablePrefix ) - { - this.tablePrefix = tablePrefix; - } - - - public String getTablePrefix() - { - return tablePrefix; - } - - - public SchemaManager getSchemaManager() - { - return schemaManager; - } - - - public Configuration getConfiguration() - { - return configuration; - } - - - public UUID getDefaultId() throws Exception - { - return getEntryId( getSuffixDn() ); - } - - - @Override - protected UUID getRootId() - { - return HBaseMasterTable.ROOT_ID; - } +// public void sync() throws Exception +// { +// // always synched +// } + + +// public void setTablePrefix( String tablePrefix ) +// { +// this.tablePrefix = tablePrefix; +// } + + +// public String getTablePrefix() +// { +// return tablePrefix; +// } + + +// public SchemaManager getSchemaManager() +// { +// return schemaManager; +// } + + +// public Configuration getConfiguration() +// { +// return configuration; +// } + + +// public UUID getDefaultId() throws Exception +// { +// return getEntryId( getSuffixDn() ); +// } +// +// +// @Override +// protected UUID getRootId() +// { +// return HBaseMasterTable.ROOT_ID; +// } } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -60,9 +60,9 @@ public class Utils } - public static String getValuePattern( SubstringNode node, HBaseStore store ) throws Exception + public static String getValuePattern( SubstringNode node, HBaseContext context ) throws Exception { - String valuePattern = new SubstringEvaluator( node, store, store.getSchemaManager() ).getPattern().toString(); + String valuePattern = new SubstringEvaluator( node, context, context.getSchemaManager() ).getPattern().toString(); if ( valuePattern.charAt( 0 ) == '^' ) { // indicates that the value pattern has an initial pattern, filter out the '^' 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -24,7 +24,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.xdbm.IndexCursor; import org.apache.directory.server.xdbm.IndexEntry; import org.apache.directory.shared.ldap.model.entry.Entry; @@ -44,7 +44,7 @@ import org.apache.hadoop.hbase.client.Re public abstract class BaseHBaseIndexCursor extends AbstractHBaseIndexCursor { - protected HBaseStore store; + protected HBaseContext context; protected ResultScanner scanner; protected Iterator iterator; @@ -56,9 +56,9 @@ public abstract class BaseHBaseIndexCurs protected IndexEntry currentEntry; - public BaseHBaseIndexCursor( HBaseStore store ) + public BaseHBaseIndexCursor( HBaseContext context ) { - this.store = store; + this.context = context; this.entries = new LinkedList>(); reset(); } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -22,7 +22,7 @@ package org.apache.directory.server.core import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; 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; @@ -30,11 +30,11 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.filter.ExprNode; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.FilterList; -import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.FilterList.Operator; +import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; /** @@ -53,16 +53,16 @@ public class HBaseOneLevelIndexCursor ex private ExprNode exprNode; - public HBaseOneLevelIndexCursor( UUID baseId, HBaseStore store ) + public HBaseOneLevelIndexCursor( UUID baseId, HBaseContext context ) { - super( store ); + super( context ); this.baseId = baseId; } - public HBaseOneLevelIndexCursor( UUID baseId, ExprNode exprNode, HBaseStore store ) + public HBaseOneLevelIndexCursor( UUID baseId, ExprNode exprNode, HBaseContext context ) { - this( baseId, store ); + this( baseId, context ); this.exprNode = exprNode; } @@ -86,7 +86,7 @@ public class HBaseOneLevelIndexCursor ex Filter filter = new SingleColumnValueFilter( HBaseMasterTable.TREE_INFO_FAMILY, HBaseMasterTable.STATUS_QUALIFIER, CompareOp.EQUAL, HBaseMasterTable.EXISTS ); - Filter mainFilter = HBaseSubLevelIndexCursor.getFilter( exprNode, store ); + Filter mainFilter = HBaseSubLevelIndexCursor.getFilter( exprNode, context ); if ( mainFilter != null ) { FilterList filterList = new FilterList( Operator.MUST_PASS_ALL ); @@ -96,7 +96,7 @@ public class HBaseOneLevelIndexCursor ex } s.setFilter( filter ); - scanner = store.getMasterTable().getTreeTableScanner( s ); + scanner = context.getMasterTable().getTreeTableScanner( s ); iterator = scanner.iterator(); } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -26,7 +26,7 @@ import java.util.UUID; import java.util.regex.Pattern; import org.apache.directory.server.core.normalization.ExpandingVisitor; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.SingleColumnQualifierFilter; import org.apache.directory.server.core.partition.hbase.Utils; import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable; @@ -41,13 +41,13 @@ import org.apache.directory.shared.ldap. import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.filter.BinaryComparator; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.FilterList; +import org.apache.hadoop.hbase.filter.FilterList.Operator; import org.apache.hadoop.hbase.filter.RegexStringComparator; import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; import org.apache.hadoop.hbase.filter.WritableByteArrayComparable; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -import org.apache.hadoop.hbase.filter.FilterList.Operator; import org.apache.hadoop.hbase.util.Bytes; @@ -70,16 +70,16 @@ public class HBaseSubLevelIndexCursor ex private List parentIds; - public HBaseSubLevelIndexCursor( UUID baseId, HBaseStore store ) + public HBaseSubLevelIndexCursor( UUID baseId, HBaseContext context ) { - super( store ); + super( context ); this.baseId = baseId; } - public HBaseSubLevelIndexCursor( UUID baseId, ExprNode filter, HBaseStore store ) + public HBaseSubLevelIndexCursor( UUID baseId, ExprNode filter, HBaseContext context ) { - this( baseId, store ); + this( baseId, context ); this.filter = filter; } @@ -113,7 +113,7 @@ public class HBaseSubLevelIndexCursor ex Filter existsFilter = new SingleColumnValueFilter( HBaseMasterTable.TREE_INFO_FAMILY, HBaseMasterTable.STATUS_QUALIFIER, CompareOp.EQUAL, HBaseMasterTable.EXISTS ); - Filter mainFilter = getFilter( filter, store ); + Filter mainFilter = getFilter( filter, context ); Filter filter = null; if ( mainFilter != null ) { @@ -140,7 +140,7 @@ public class HBaseSubLevelIndexCursor ex } scan.setFilter( filter ); - scanner = store.getMasterTable().getTreeTableScanner( scan ); + scanner = context.getMasterTable().getTreeTableScanner( scan ); iterator = scanner.iterator(); } } @@ -156,7 +156,7 @@ public class HBaseSubLevelIndexCursor ex // Add the base to the list of entry IDs which needs to be scanned. // We don't need to scan for children if the entry doesn't have children. - if ( store.getChildCount( baseId ) > 0 ) + if ( context.getChildCount( baseId ) > 0 ) { parentIds = new ArrayList(); parentIds.add( baseId ); @@ -210,7 +210,7 @@ public class HBaseSubLevelIndexCursor ex } - static Filter getFilter( ExprNode node, HBaseStore store ) throws Exception + static Filter getFilter( ExprNode node, HBaseContext context ) throws Exception { if ( node != null ) { @@ -220,12 +220,12 @@ public class HBaseSubLevelIndexCursor ex // of an attribute type. For example if the LDAP filter is // (name=test) it must be expanded to (|(cn=test)(ou=test)...) AndNode containerNode = new AndNode( node ); - ExpandingVisitor visitor = new ExpandingVisitor( store.getSchemaManager() ); + ExpandingVisitor visitor = new ExpandingVisitor( context.getSchemaManager() ); containerNode.accept( visitor ); ExprNode expanded = containerNode.getChildren().get( 0 ); //System.out.println(expanded); - return buildFilter( expanded, store ); + return buildFilter( expanded, context ); } catch ( IllegalStateException e ) { @@ -241,12 +241,12 @@ public class HBaseSubLevelIndexCursor ex } - private static Filter buildFilter( ExprNode node, HBaseStore store ) throws Exception + private static Filter buildFilter( ExprNode node, HBaseContext context ) throws Exception { if ( node.isLeaf() ) { String attribute = ( ( LeafNode ) node ).getAttribute(); - String oid = store.getSchemaManager().getAttributeTypeRegistry().getOidByName( attribute ); + String oid = context.getSchemaManager().getAttributeTypeRegistry().getOidByName( attribute ); String quotedOid = Pattern.quote( oid ); CompareOp compareOp; @@ -281,7 +281,7 @@ public class HBaseSubLevelIndexCursor ex + ".*" ); break; case SUBSTRING: - String valuePattern = Utils.getValuePattern( ( SubstringNode ) node, store ); + String valuePattern = Utils.getValuePattern( ( SubstringNode ) node, context ); comparator = new RegexStringComparator( "^" + quotedOid + HBaseMasterTable.NORM_ATTRIBUTE_DELIMITER + valuePattern ); break; @@ -296,7 +296,7 @@ public class HBaseSubLevelIndexCursor ex switch ( node.getAssertionType() ) { case OR: - return buildOrFilter( ( OrNode ) node, store ); + return buildOrFilter( ( OrNode ) node, context ); case AND: //return buildAndCursor( ( AndNode ) node, store ); case NOT: @@ -319,12 +319,12 @@ public class HBaseSubLevelIndexCursor ex // } // // - private static Filter buildOrFilter( OrNode node, HBaseStore store ) throws Exception + private static Filter buildOrFilter( OrNode node, HBaseContext context ) throws Exception { FilterList orList = new FilterList( Operator.MUST_PASS_ONE ); for ( ExprNode child : node.getChildren() ) { - orList.addFilter( buildFilter( child, store ) ); + orList.addFilter( buildFilter( child, context ) ); } return orList; } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -26,7 +26,7 @@ import java.util.UUID; import java.util.regex.Pattern; import org.apache.commons.collections.iterators.EmptyIterator; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.Utils; import org.apache.directory.server.core.partition.hbase.table.HBaseColumnIndexTable; import org.apache.directory.server.core.partition.hbase.table.HBaseIndexTable; @@ -37,13 +37,13 @@ import org.apache.hadoop.hbase.client.Re import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.filter.BinaryComparator; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.FilterList; +import org.apache.hadoop.hbase.filter.FilterList.Operator; import org.apache.hadoop.hbase.filter.RegexStringComparator; import org.apache.hadoop.hbase.filter.RowFilter; import org.apache.hadoop.hbase.filter.ValueFilter; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -import org.apache.hadoop.hbase.filter.FilterList.Operator; /** @@ -63,24 +63,24 @@ public class HBaseUserColumnIndexCursor // TODO: count for substring, gt, lt public HBaseUserColumnIndexCursor( String attributeTypeOid, Object value, HBaseColumnIndexTable indexTable, - HBaseStore store ) + HBaseContext context ) { - super( attributeTypeOid, value, store ); + super( attributeTypeOid, value, context ); this.indexTable = indexTable; } - public HBaseUserColumnIndexCursor( String attributeTypeOid, HBaseColumnIndexTable indexTable, HBaseStore store ) + public HBaseUserColumnIndexCursor( String attributeTypeOid, HBaseColumnIndexTable indexTable, HBaseContext context ) { - super( attributeTypeOid, store ); + super( attributeTypeOid, context ); this.indexTable = indexTable; } public HBaseUserColumnIndexCursor( String attributeTypeOid, SubstringNode node, HBaseColumnIndexTable indexTable, - HBaseStore store ) throws Exception + HBaseContext context ) throws Exception { - super( attributeTypeOid, node, store ); + super( attributeTypeOid, node, context ); this.indexTable = indexTable; } @@ -179,7 +179,7 @@ public class HBaseUserColumnIndexCursor */ start = indexTable.getScanKey( node.getInitial() ); stop = Utils.incrementBytes( start ); - rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store ) + "$" ); + rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, context ) + "$" ); } else { @@ -192,7 +192,7 @@ public class HBaseUserColumnIndexCursor */ start = indexTable.getScanKey( null ); stop = Utils.incrementBytes( start ); - rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store ) + "$" ); + rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, context ) + "$" ); } } else if ( value != 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -22,7 +22,7 @@ package org.apache.directory.server.core import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.xdbm.IndexEntry; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.filter.SubstringNode; @@ -42,27 +42,27 @@ public abstract class HBaseUserIndexCurs protected SubstringNode node; - public HBaseUserIndexCursor( String attributeTypeOid, Object value, HBaseStore store ) + public HBaseUserIndexCursor( String attributeTypeOid, Object value, HBaseContext context ) { - super( store ); + super( context ); this.attributeTypeOid = attributeTypeOid; this.value = value; this.exactValue = true; } - public HBaseUserIndexCursor( String attributeTypeOid, HBaseStore store ) + public HBaseUserIndexCursor( String attributeTypeOid, HBaseContext context ) { - super( store ); + super( context ); this.attributeTypeOid = attributeTypeOid; this.value = null; this.exactValue = false; } - public HBaseUserIndexCursor( String attributeTypeOid, SubstringNode node, HBaseStore store ) throws Exception + public HBaseUserIndexCursor( String attributeTypeOid, SubstringNode node, HBaseContext context ) throws Exception { - super( store ); + super( context ); this.attributeTypeOid = attributeTypeOid; this.node = node; this.exactValue = false; 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -24,7 +24,7 @@ import java.util.Iterator; import java.util.NavigableMap; import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable; import org.apache.directory.server.xdbm.ForwardIndexEntry; import org.apache.directory.server.xdbm.IndexEntry; @@ -45,18 +45,18 @@ public class HBaseUserIndexReverseCursor { private String attributeTypeOid; private UUID id; - private HBaseStore store; + private HBaseContext context; private NavigableMap attributeMap; private Iterator attributeIterator; private IndexEntry currentEntry; - public HBaseUserIndexReverseCursor( String attributeTypeOid, UUID id, HBaseStore store ) + public HBaseUserIndexReverseCursor( String attributeTypeOid, UUID id, HBaseContext context ) { this.attributeTypeOid = attributeTypeOid; this.id = id; - this.store = store; + this.context = context; } @@ -72,7 +72,7 @@ public class HBaseUserIndexReverseCursor { if ( attributeMap == null ) { - attributeMap = store.getMasterTable().fetchNormAttributes( id ); + attributeMap = context.getMasterTable().fetchNormAttributes( id ); attributeIterator = attributeMap.keySet().iterator(); } @@ -95,7 +95,7 @@ public class HBaseUserIndexReverseCursor { currentEntry = new ForwardIndexEntry(); currentEntry.setId( id ); - AttributeType at = store.getSchemaManager().getAttributeTypeRegistry().lookup( attributeTypeOid ); + AttributeType at = context.getSchemaManager().getAttributeTypeRegistry().lookup( attributeTypeOid ); currentEntry.setValue( at.getSyntax().isHumanReadable() ? Bytes.toString( value ) : value ); return true; } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -23,7 +23,7 @@ package org.apache.directory.server.core import java.util.UUID; import java.util.regex.Pattern; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.Utils; import org.apache.directory.server.core.partition.hbase.table.HBaseIndexTable; import org.apache.directory.server.core.partition.hbase.table.HBaseRowIndexTable; @@ -32,13 +32,13 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.filter.SubstringNode; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.FilterList; +import org.apache.hadoop.hbase.filter.FilterList.Operator; import org.apache.hadoop.hbase.filter.RegexStringComparator; import org.apache.hadoop.hbase.filter.RowFilter; import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -import org.apache.hadoop.hbase.filter.FilterList.Operator; /** @@ -55,24 +55,24 @@ public class HBaseUserRowIndexCursor ext public HBaseUserRowIndexCursor( String attributeTypeOid, Object value, HBaseRowIndexTable indexTable, - HBaseStore store ) + HBaseContext context ) { - super( attributeTypeOid, value, store ); + super( attributeTypeOid, value, context ); this.indexTable = indexTable; } - public HBaseUserRowIndexCursor( String attributeTypeOid, HBaseRowIndexTable indexTable, HBaseStore store ) + public HBaseUserRowIndexCursor( String attributeTypeOid, HBaseRowIndexTable indexTable, HBaseContext context ) { - super( attributeTypeOid, store ); + super( attributeTypeOid, context ); this.indexTable = indexTable; } public HBaseUserRowIndexCursor( String attributeTypeOid, SubstringNode node, HBaseRowIndexTable indexTable, - HBaseStore store ) throws Exception + HBaseContext context ) throws Exception { - super( attributeTypeOid, node, store ); + super( attributeTypeOid, node, context ); this.indexTable = indexTable; } @@ -113,7 +113,7 @@ public class HBaseUserRowIndexCursor ext */ start = indexTable.getScanKey( node.getInitial(), null ); stop = Utils.incrementBytes( start ); - rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store ) + rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, context ) + 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}$" ); } @@ -128,7 +128,7 @@ public class HBaseUserRowIndexCursor ext */ start = indexTable.getScanKey( null, null ); stop = Utils.incrementBytes( start ); - rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, store ) + rowFilterPattern = Pattern.compile( "^=" + Utils.getValuePattern( node, context ) + 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}$" ); } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -20,10 +20,10 @@ package org.apache.directory.server.core.partition.hbase.index; -import java.io.File; +import java.net.URI; import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.xdbm.Index; import org.apache.directory.server.xdbm.IndexCursor; import org.apache.directory.shared.ldap.model.cursor.Cursor; @@ -42,18 +42,18 @@ public abstract class AbstractHBaseIndex protected int cacheSize = DEFAULT_INDEX_CACHE_SIZE; protected String attributeId; - protected HBaseStore store; + protected HBaseContext context; - public HBaseStore getStore() + public HBaseContext getContext() { - return store; + return context; } - public void setStore( HBaseStore store ) + public void setContext( HBaseContext context ) { - this.store = store; + this.context = context; } @@ -171,7 +171,7 @@ public abstract class AbstractHBaseIndex } - public File getWkDirPath() + public URI getWkDirPath() { throw new UnsupportedOperationException(); } @@ -267,7 +267,7 @@ public abstract class AbstractHBaseIndex } - public void setWkDirPath( File wkDirPath ) + public void setWkDirPath( URI wkDirPath ) { throw new UnsupportedOperationException(); } @@ -278,9 +278,11 @@ public abstract class AbstractHBaseIndex throw new UnsupportedOperationException(); } + //FIXME seelmann, just adding this method to make this source compile // not sure if any of these indexes support duplicate keys public boolean isDupsEnabled() { return false; - }} + } +} 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -46,7 +46,7 @@ public class HBaseAliasIndex extends HBa @Override public Object reverseLookup( UUID id ) throws Exception { - Entry entry = store.getMasterTable().get( id ); + Entry entry = context.getMasterTable().get( id ); if ( entry == null ) { return null; @@ -56,7 +56,7 @@ public class HBaseAliasIndex extends HBa { return null; } - return attribute.get().get(); + return attribute.get().getValue(); } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -22,7 +22,7 @@ package org.apache.directory.server.core import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.cursor.HBaseOneLevelIndexCursor; import org.apache.directory.server.core.partition.hbase.xdbmext.IndexFilteringExtension; import org.apache.directory.shared.ldap.model.entry.Entry; @@ -45,9 +45,9 @@ public class HBaseOneLevelIndex extends } - public HBaseOneLevelIndex( HBaseStore store ) + public HBaseOneLevelIndex( HBaseContext context ) { - setStore( store ); + setContext( context ); } @@ -59,7 +59,7 @@ public class HBaseOneLevelIndex extends public boolean forward( UUID baseId, UUID id ) throws Exception { // check if 'id' is child of 'baseId' - UUID parentId = store.getMasterTable().fetchParentId( id ); + UUID parentId = context.getMasterTable().fetchParentId( id ); return baseId.equals( parentId ); } @@ -67,20 +67,20 @@ public class HBaseOneLevelIndex extends @Override public HBaseOneLevelIndexCursor forwardCursor( UUID baseId ) throws Exception { - return new HBaseOneLevelIndexCursor( baseId, store ); + return new HBaseOneLevelIndexCursor( baseId, context ); } public HBaseOneLevelIndexCursor forwardFilteringCursor( UUID baseId, ExprNode filter ) throws Exception { - return new HBaseOneLevelIndexCursor( baseId, filter, store ); + return new HBaseOneLevelIndexCursor( baseId, filter, context ); } @Override public int count( UUID id ) throws Exception { - return store.getMasterTable().getOneLevelCount( id ); + return context.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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.cursor.HBasePresenceIndexCursor; import org.apache.directory.server.core.partition.hbase.table.HBasePresenceIndexTable; import org.apache.directory.shared.ldap.model.entry.Entry; @@ -48,9 +48,9 @@ public class HBasePresenceIndex extends } - public HBasePresenceIndex( HBaseStore store ) + public HBasePresenceIndex( HBaseContext context ) { - setStore( store ); + setContext( context ); } @@ -108,7 +108,7 @@ public class HBasePresenceIndex extends } else { - HBasePresenceIndexTable presenceIndexTable = new HBasePresenceIndexTable( attributeTypeOid, store, + HBasePresenceIndexTable presenceIndexTable = new HBasePresenceIndexTable( attributeTypeOid, getContext(), getCacheSize() ); presenceIndexTables.put( attributeTypeOid, presenceIndexTable ); return presenceIndexTable; Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseRdnIndex.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseRdnIndex.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseRdnIndex.java (original) +++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseRdnIndex.java Thu Jul 28 21:23:18 2011 @@ -22,7 +22,7 @@ package org.apache.directory.server.core import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; import org.apache.directory.server.core.partition.hbase.table.HBaseMasterTable.MasterTreeInfo; import org.apache.directory.server.xdbm.ParentIdAndRdn; import org.apache.directory.shared.ldap.model.entry.Entry; @@ -45,9 +45,9 @@ public class HBaseRdnIndex extends Abstr } - public HBaseRdnIndex( HBaseStore store ) + public HBaseRdnIndex( HBaseContext context ) { - setStore( store ); + setContext( context ); } @@ -73,9 +73,8 @@ public class HBaseRdnIndex extends Abstr @Override public ParentIdAndRdn reverseLookup( UUID id ) throws Exception { - MasterTreeInfo mti = store.getMasterTable().fetchMasterTreeInfo( id ); - Dn dn = new Dn( mti.upName ); - dn.normalize( store.getSchemaManager().getNormalizerMapping() ); + MasterTreeInfo mti = context.getMasterTable().fetchMasterTreeInfo( id ); + Dn dn = new Dn( context.getSchemaManager(), mti.upName ); ParentIdAndRdn piar = new ParentIdAndRdn( mti.parentId, dn.getRdns() ); return piar; } @@ -98,7 +97,7 @@ public class HBaseRdnIndex extends Abstr upName += rdn.getName(); } MasterTreeInfo mti = new MasterTreeInfo( key.getParentId(), normName, upName ); - UUID id = store.getMasterTable().fetchId( mti ); + UUID id = context.getMasterTable().fetchId( mti ); return id; } 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=1152005&r1=1152004&r2=1152005&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 Thu Jul 28 21:23:18 2011 @@ -22,7 +22,7 @@ package org.apache.directory.server.core import java.util.UUID; -import org.apache.directory.server.core.partition.hbase.HBaseStore; +import org.apache.directory.server.core.partition.hbase.HBaseContext; 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; @@ -46,9 +46,9 @@ public class HBaseSubLevelIndex extends } - public HBaseSubLevelIndex( HBaseStore store ) + public HBaseSubLevelIndex( HBaseContext context ) { - setStore( store ); + setContext( context ); } @@ -65,7 +65,7 @@ public class HBaseSubLevelIndex extends while ( !parentId.equals( baseId ) && !parentId.equals( HBaseMasterTable.ROOT_ID ) ) { //System.out.println("parent: " + parentId); - parentId = store.getMasterTable().fetchParentId( parentId ); + parentId = context.getMasterTable().fetchParentId( parentId ); } //System.out.println("subLevelIndex.forward " + key + " -> " + id + " = " + (key==parentId)); return baseId.equals( parentId ); @@ -75,20 +75,20 @@ public class HBaseSubLevelIndex extends @Override public HBaseSubLevelIndexCursor forwardCursor( UUID baseId ) throws Exception { - return new HBaseSubLevelIndexCursor( baseId, store ); + return new HBaseSubLevelIndexCursor( baseId, context ); } public HBaseSubLevelIndexCursor forwardFilteringCursor( UUID baseId, ExprNode filter ) throws Exception { - return new HBaseSubLevelIndexCursor( baseId, filter, store ); + return new HBaseSubLevelIndexCursor( baseId, filter, context ); } @Override public int count( UUID baseId ) throws Exception { - return store.getMasterTable().getSubLevelCount( baseId ); + return context.getMasterTable().getSubLevelCount( baseId ); } Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserColumnIndex.java URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserColumnIndex.java?rev=1152005&r1=1152004&r2=1152005&view=diff ============================================================================== --- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserColumnIndex.java (original) +++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserColumnIndex.java Thu Jul 28 21:23:18 2011 @@ -58,20 +58,20 @@ public class HBaseUserColumnIndex extend @Override public HBaseUserColumnIndexCursor forwardCursor( Object value ) throws Exception { - return new HBaseUserColumnIndexCursor( getAttributeId(), value, getIndexTable(), store ); + return new HBaseUserColumnIndexCursor( getAttributeId(), value, getIndexTable(), context ); } @Override public HBaseUserColumnIndexCursor forwardCursor() throws Exception { - return new HBaseUserColumnIndexCursor( getAttributeId(), getIndexTable(), store ); + return new HBaseUserColumnIndexCursor( getAttributeId(), getIndexTable(), context ); } public HBaseUserColumnIndexCursor forwardSubstringCursor( SubstringNode node ) throws Exception { - return new HBaseUserColumnIndexCursor( getAttributeId(), node, getIndexTable(), store ); + return new HBaseUserColumnIndexCursor( getAttributeId(), node, getIndexTable(), context ); } @@ -80,8 +80,8 @@ public class HBaseUserColumnIndex extend { if ( indexTable == null ) { - indexTable = new HBaseColumnIndexTable( getAttributeId(), store.getSchemaManager(), store.getTablePrefix(), - store.getConfiguration(), getCacheSize() ); + indexTable = new HBaseColumnIndexTable( getAttributeId(), context.getSchemaManager(), context.getTablePrefix(), + context.getConfiguration(), getCacheSize() ); } return indexTable; }