directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1152005 [2/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 GMT
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=1152005&r1=1152004&r2=1152005&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
Thu Jul 28 21:23:18 2011
@@ -57,14 +57,14 @@ public abstract class HBaseUserIndex<T e
     @Override
     public int count() throws Exception
     {
-        if ( store.hasUserIndexOn( getAttributeId() ) )
+        if ( context.hasUserIndexOn( getAttributeId() ) )
         {
-            int count = store.getPresenceIndex().count( getAttributeId() );
+            int count = context.getPresenceIndex().count( getAttributeId() );
             return count;
         }
         else //if ( store.hasSystemIndexOn( getAttributeId() ) )
         {
-            int count = store.count();
+            int count = context.count();
             return count;
         }
     }
@@ -106,7 +106,7 @@ public abstract class HBaseUserIndex<T e
     @Override
     public IndexCursor<Object, Entry, UUID> reverseCursor( UUID id ) throws Exception
     {
-        return new HBaseUserIndexReverseCursor( getAttributeId(), id, store );
+        return new HBaseUserIndexReverseCursor( getAttributeId(), id, context );
     }
 
 
@@ -114,7 +114,7 @@ public abstract class HBaseUserIndex<T e
     public boolean reverseLessOrEq( UUID id, Object attrVal ) throws Exception
     {
         String testValue = ( String ) attrVal;
-        HBaseUserIndexReverseCursor cursor = new HBaseUserIndexReverseCursor( getAttributeId(),
id, store );
+        HBaseUserIndexReverseCursor cursor = new HBaseUserIndexReverseCursor( getAttributeId(),
id, context );
         boolean match = false;
 
         while ( cursor.next() )
@@ -137,7 +137,7 @@ public abstract class HBaseUserIndex<T e
     public boolean reverseGreaterOrEq( UUID id, Object attrVal ) throws Exception
     {
         String testValue = ( String ) attrVal;
-        HBaseUserIndexReverseCursor cursor = new HBaseUserIndexReverseCursor( getAttributeId(),
id, store );
+        HBaseUserIndexReverseCursor cursor = new HBaseUserIndexReverseCursor( getAttributeId(),
id, context );
         boolean match = false;
 
         while ( cursor.next() )
@@ -159,7 +159,7 @@ public abstract class HBaseUserIndex<T e
     @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;
@@ -169,7 +169,7 @@ public abstract class HBaseUserIndex<T e
         {
             return null;
         }
-        return attribute.get().get();
+        return attribute.get().getValue();
     }
 
 
@@ -273,11 +273,11 @@ public abstract class HBaseUserIndex<T e
     @Override
     public void drop( UUID id ) throws Exception
     {
-        Entry entry = store.lookup( id );
+        Entry entry = context.lookup( id );
         Attribute attribute = entry.get( attributeId );
         for ( Value<?> value : attribute )
         {
-            drop( value.get(), id );
+            drop( value.getValue(), id );
         }
     }
 

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserRowIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserRowIndex.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/HBaseUserRowIndex.java
(original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/index/HBaseUserRowIndex.java
Thu Jul 28 21:23:18 2011
@@ -64,20 +64,20 @@ public class HBaseUserRowIndex extends H
     @Override
     public HBaseUserRowIndexCursor forwardCursor( Object value ) throws Exception
     {
-        return new HBaseUserRowIndexCursor( getAttributeId(), value, getIndexTable(), store
);
+        return new HBaseUserRowIndexCursor( getAttributeId(), value, getIndexTable(), context
);
     }
 
 
     @Override
     public HBaseUserRowIndexCursor forwardCursor() throws Exception
     {
-        return new HBaseUserRowIndexCursor( getAttributeId(), getIndexTable(), store );
+        return new HBaseUserRowIndexCursor( getAttributeId(), getIndexTable(), context );
     }
 
 
     public HBaseUserRowIndexCursor forwardSubstringCursor( SubstringNode node ) throws Exception
     {
-        return new HBaseUserRowIndexCursor( getAttributeId(), node, getIndexTable(), store
);
+        return new HBaseUserRowIndexCursor( getAttributeId(), node, getIndexTable(), context
);
     }
 
 
@@ -86,7 +86,7 @@ public class HBaseUserRowIndex extends H
     {
         if ( indexTable == null )
         {
-            indexTable = new HBaseRowIndexTable( getAttributeId(), store, getCacheSize()
);
+            indexTable = new HBaseRowIndexTable( getAttributeId(), context, getCacheSize()
);
         }
         return indexTable;
     }

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=1152005&r1=1152004&r2=1152005&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
Thu Jul 28 21:23:18 2011
@@ -36,8 +36,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.ldap.model.schema.loader.ldif.JarLdifSchemaLoader;
-import org.apache.directory.shared.ldap.model.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.ldap.schemaloader.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.mapreduce.TableMapper;
@@ -77,8 +77,7 @@ public class IndexBuilder extends TableM
             SchemaManager schemaManager = new DefaultSchemaManager( schemaLoader );
             schemaManager.loadAllEnabled();
 
-            Dn suffixDn = new Dn( context.getConfiguration().get( SUFFIX ) );
-            suffixDn.normalize( schemaManager.getNormalizerMapping() );
+            Dn suffixDn = new Dn( schemaManager, context.getConfiguration().get( SUFFIX )
);
 
             store = new HBaseStore();
 

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseIndexTableBase.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseIndexTableBase.java?rev=1152005&r1=1152004&r2=1152005&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseIndexTableBase.java
(original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseIndexTableBase.java
Thu Jul 28 21:23:18 2011
@@ -92,14 +92,7 @@ public abstract class HBaseIndexTableBas
         else if ( value instanceof byte[] )
         {
             Value<?> normalized = at.getEquality().getNormalizer().normalize( new BinaryValue(
( byte[] ) value ) );
-            if ( normalized.isBinary() )
-            {
-                normValue = normalized.getBytes();
-            }
-            else
-            {
-                normValue = Bytes.toBytes( normalized.getString() );
-            }
+            normValue = normalized.getBytes();
         }
         else if ( value instanceof UUID )
         {

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseMasterTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseMasterTable.java?rev=1152005&r1=1152004&r2=1152005&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseMasterTable.java
(original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseMasterTable.java
Thu Jul 28 21:23:18 2011
@@ -28,17 +28,17 @@ import java.util.NavigableMap;
 import java.util.UUID;
 
 import org.apache.directory.server.core.partition.hbase.Cache;
-import org.apache.directory.server.core.partition.hbase.HBaseStore;
+import org.apache.directory.server.core.partition.hbase.HBaseDistributedPartition;
 import org.apache.directory.server.core.partition.hbase.Utils;
 import org.apache.directory.server.xdbm.MasterTable;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
-import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
+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.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.StringValue;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -130,26 +130,26 @@ public class HBaseMasterTable implements
     private Cache<UUID, Entry> entryCache;
 
 
-    public HBaseMasterTable( HBaseStore store )
+    public HBaseMasterTable( HBaseDistributedPartition partition )
     {
-        this.schemaManager = store.getSchemaManager();
-        this.suffixDn = store.getSuffixDn();
-        this.configuration = store.getConfiguration();
+        this.schemaManager = partition.getSchemaManager();
+        this.suffixDn = partition.getSuffixDn();
+        this.configuration = partition.getConfiguration();
         this.maintainCounters = configuration.getBoolean( MAINTAIN_COUNTERS_PROPERTY, true
);
-        this.masterTableName = store.getTablePrefix() + MASTER_TABLE;
-        this.treeTableName = store.getTablePrefix() + TREE_TABLE;
+        this.masterTableName = partition.getTablePrefix() + MASTER_TABLE;
+        this.treeTableName = partition.getTablePrefix() + TREE_TABLE;
         this.suffixMti = new MasterTreeInfo( ROOT_ID, suffixDn.getNormName(), null );
 
-        this.entryCache = new Cache<UUID, Entry>( store.getCacheSize() );
+        this.entryCache = new Cache<UUID, Entry>( partition.getCacheSize() );
 
-        int dnCacheSize = Math.max( store.getCacheSize(), store.getNdnIndex().getCacheSize()
);
+        int dnCacheSize = Math.max( partition.getCacheSize(), partition.getEntryUuidIndex().getCacheSize()
);
         this.dnCache = new Cache<UUID, Dn>( dnCacheSize );
         this.mtiCache = new Cache<UUID, MasterTreeInfo>( dnCacheSize );
         this.idCache = new Cache<String, UUID>( dnCacheSize );
 
-        this.oneLevelCountCache = new Cache<UUID, Long>( Math.max( store.getCacheSize(),
store.getOneLevelIndex()
+        this.oneLevelCountCache = new Cache<UUID, Long>( Math.max( partition.getCacheSize(),
partition.getOneLevelIndex()
             .getCacheSize() ) );
-        this.subLevelCountCache = new Cache<UUID, Long>( Math.max( store.getCacheSize(),
store.getSubLevelIndex()
+        this.subLevelCountCache = new Cache<UUID, Long>( Math.max( partition.getCacheSize(),
partition.getSubLevelIndex()
             .getCacheSize() ) );
     }
 
@@ -212,15 +212,15 @@ public class HBaseMasterTable implements
         for ( Attribute attribute : entry )
         {
             String attr = attribute.getUpId();
-            for ( int i = 0; i < attribute.size(); i++ )
+            int i = 0;
+            for ( Value<?> value : attribute )
             {
-                Value<?> value = attribute.get( i );
-
                 // upAttributes:
                 // objectClass0 -> inetOrgPerson
                 // objectClass1 -> top
                 masterPut.add( UP_ATTRIBUTES_FAMILY, Bytes.add( Bytes.toBytes( attr ), Bytes.toBytes(
i ) ), value
                     .getBytes() );
+                i++;
             }
         }
         HBaseTableHelper.put( getMasterTablePool(), masterTableName, masterPut );
@@ -236,16 +236,15 @@ public class HBaseMasterTable implements
         for ( Attribute attribute : entry )
         {
             String attrOid = attribute.getAttributeType().getOid();
-            for ( int i = 0; i < attribute.size(); i++ )
+            int i = 0;
+            for ( Value<?> value : attribute )
             {
-                Value<?> value = attribute.get( i );
-
                 // normAttributes:
                 // 2.5.4.0:inetorgperson -> 0
                 // 2.5.4.0:top -> 1
                 //if ( store.hasUserIndexOn( attrOid ) )
                 {
-                    Object normalizedValue = value.getNormalizedValue();
+                    Object normalizedValue = value.getNormValue();
                     byte[] normalizedValueBytes;
                     if ( normalizedValue instanceof String )
                     {
@@ -258,6 +257,7 @@ public class HBaseMasterTable implements
                     treePut.add( NORM_ATTRIBUTES_FAMILY, Bytes.add( Bytes.toBytes( attrOid
),
                         NORM_ATTRIBUTE_DELIMITER_BYTES, normalizedValueBytes ), Bytes.toBytes(
i ) );
                 }
+                i++;
             }
         }
 
@@ -274,7 +274,7 @@ public class HBaseMasterTable implements
     }
 
 
-    public void delete( UUID id, Entry entry ) throws Exception
+    public void remove( UUID id, Entry entry ) throws Exception
     {
         MasterTreeInfo key = fetchMasterTreeInfo( id );
 
@@ -501,7 +501,7 @@ public class HBaseMasterTable implements
                 entry.add( attribute );
             }
             Value<?> value;
-            if ( attribute.isHR() )
+            if ( attribute.isHumanReadable() )
             {
                 value = new StringValue( attributeType, Bytes.toString( attributeEntry.getValue()
) );
             }
@@ -535,8 +535,7 @@ public class HBaseMasterTable implements
             }
         }
         while ( mti != null );
-        dn = new Dn( sb.toString() );
-        dn.normalize( schemaManager.getAttributeTypeRegistry().getNormalizerMapping() );
+        dn = new Dn( schemaManager, sb.toString() );
 
         // put Dn to cache
         dnCache.put( id, dn );
@@ -672,7 +671,7 @@ public class HBaseMasterTable implements
 
     private List<UUID> fetchParentIds( Dn dn, boolean includeChild ) throws Exception
     {
-        if ( !dn.isChildOf( suffixDn ) )
+        if ( !dn.isDescendantOf( suffixDn ) )
         {
             return null;
         }
@@ -834,9 +833,9 @@ public class HBaseMasterTable implements
 
 
     @Override
-    public void delete( UUID id ) throws Exception
+    public void remove( UUID id ) throws Exception
     {
-        delete( id, null );
+        remove( id, null );
     }
 
 
@@ -848,13 +847,6 @@ public class HBaseMasterTable implements
 
 
     @Override
-    public UUID getCurrentId( Entry entry ) throws Exception
-    {
-        return getNextId( entry );
-    }
-
-
-    @Override
     public UUID getNextId( Entry entry ) throws Exception
     {
         String name = entry.get( SchemaConstants.ENTRY_UUID_AT ).getString();
@@ -864,13 +856,6 @@ public class HBaseMasterTable implements
 
 
     @Override
-    public String getProperty( String property ) throws Exception
-    {
-        throw new UnsupportedOperationException();
-    }
-
-
-    @Override
     public void put( UUID id, Entry entry ) throws Exception
     {
         MasterTreeInfo mti = fetchMasterTreeInfo( id );
@@ -886,13 +871,6 @@ public class HBaseMasterTable implements
 
 
     @Override
-    public void setProperty( String property, String value ) throws Exception
-    {
-        throw new UnsupportedOperationException();
-    }
-
-
-    @Override
     public int count() throws Exception
     {
         throw new UnsupportedOperationException();
@@ -991,13 +969,6 @@ public class HBaseMasterTable implements
 
 
     @Override
-    public boolean isCountExact()
-    {
-        throw new UnsupportedOperationException();
-    }
-
-
-    @Override
     public boolean isDupsEnabled()
     {
         throw new UnsupportedOperationException();
@@ -1012,23 +983,16 @@ public class HBaseMasterTable implements
 
 
     @Override
-    public void remove( UUID key ) throws Exception
-    {
-        throw new UnsupportedOperationException();
-    }
-
-
-    @Override
-    public void remove( UUID key, Entry value ) throws Exception
+    public Cursor<Entry> valueCursor( UUID key ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
     @Override
-    public Cursor<Entry> valueCursor( UUID key ) throws Exception
+    public void resetCounter() throws Exception
     {
-        throw new UnsupportedOperationException();
+        // TODO: what's this?
     }
 
 }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBasePresenceIndexTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBasePresenceIndexTable.java?rev=1152005&r1=1152004&r2=1152005&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBasePresenceIndexTable.java
(original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBasePresenceIndexTable.java
Thu Jul 28 21:23:18 2011
@@ -23,7 +23,7 @@ package org.apache.directory.server.core
 import java.util.UUID;
 
 import org.apache.directory.server.core.partition.hbase.Cache;
-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.cursor.HBasePresenceIndexCursor;
 import org.apache.directory.shared.util.ByteBuffer;
@@ -31,8 +31,8 @@ import org.apache.hadoop.hbase.client.Ge
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
+import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 import org.apache.hadoop.hbase.util.Bytes;
 
 
@@ -58,18 +58,18 @@ public class HBasePresenceIndexTable
 
     protected String indexTableName;
     private HBaseTablePool indexTablePool;
-    private HBaseStore store;
+    private HBaseContext context;
     private String attributeTypeOid;
 
     private Cache<String, Integer> countCache;
 
 
-    public HBasePresenceIndexTable( String attributeTypeOid, HBaseStore store, int cacheSize
) throws Exception
+    public HBasePresenceIndexTable( String attributeTypeOid, HBaseContext context, int cacheSize
) throws Exception
     {
         this.attributeTypeOid = attributeTypeOid;
-        this.store = store;
-        String name = store.getSchemaManager().getGlobalOidRegistry().getPrimaryName( attributeTypeOid
);
-        this.indexTableName = store.getTablePrefix() + "index_" + name;
+        this.context = context;
+        String name = context.getSchemaManager().getGlobalOidRegistry().getPrimaryName( attributeTypeOid
);
+        this.indexTableName = context.getTablePrefix() + "index_" + name;
         this.countCache = new Cache<String, Integer>( cacheSize );
     }
 
@@ -136,7 +136,7 @@ public class HBasePresenceIndexTable
         if ( count >= limit )
         {
             // this is just a guess to avoid subtree scan
-            count = store.count() / 10;
+            count = context.count() / 10;
         }
         cursor.close();
 
@@ -197,8 +197,8 @@ public class HBasePresenceIndexTable
         if ( indexTablePool == null )
         {
             // ensure table is created
-            HBaseTableHelper.createTable( store.getConfiguration(), indexTableName, INFO_FAMILY
);
-            indexTablePool = new HBaseTablePool( indexTableName, store.getConfiguration()
);
+            HBaseTableHelper.createTable( context.getConfiguration(), indexTableName, INFO_FAMILY
);
+            indexTablePool = new HBaseTablePool( indexTableName, context.getConfiguration()
);
         }
         return indexTablePool;
     }

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseRowIndexTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseRowIndexTable.java?rev=1152005&r1=1152004&r2=1152005&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseRowIndexTable.java
(original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseRowIndexTable.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.index.HBaseUserIndex;
 import org.apache.directory.server.xdbm.IndexCursor;
@@ -31,8 +31,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.util.ByteBuffer;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
+import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,13 +50,13 @@ import org.slf4j.LoggerFactory;
 public class HBaseRowIndexTable extends HBaseIndexTableBase
 {
     private static final Logger LOG = LoggerFactory.getLogger( HBaseRowIndexTable.class );
-    private HBaseStore store;
+    private HBaseContext context;
 
 
-    public HBaseRowIndexTable( String attributeTypeOid, HBaseStore store, int cacheSize )
throws Exception
+    public HBaseRowIndexTable( String attributeTypeOid, HBaseContext context, int cacheSize
) throws Exception
     {
-        super( attributeTypeOid, store.getSchemaManager(), store.getTablePrefix(), store.getConfiguration(),
cacheSize );
-        this.store = store;
+        super( attributeTypeOid, context.getSchemaManager(), context.getTablePrefix(), context.getConfiguration(),
cacheSize );
+        this.context = context;
     }
 
 
@@ -144,7 +144,7 @@ public class HBaseRowIndexTable extends 
         }
 
         // TODO: scan directly instead of using the cursor?
-        HBaseUserIndex<HBaseIndexTable> index = ( HBaseUserIndex<HBaseIndexTable>
) store
+        HBaseUserIndex<HBaseIndexTable> index = ( HBaseUserIndex<HBaseIndexTable>
) context
             .getIndex( attributeTypeOid );
         IndexCursor<Object, Entry, UUID> cursor = index.forwardCursor( value );
         int count = 0;
@@ -156,7 +156,7 @@ public class HBaseRowIndexTable extends 
         if ( count >= limit )
         {
             // this is just a guess to avoid subtree scan
-            count = store.count() / 10;
+            count = context.count() / 10;
         }
         cursor.close();
 

Modified: directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseTablePool.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseTablePool.java?rev=1152005&r1=1152004&r2=1152005&view=diff
==============================================================================
--- directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseTablePool.java
(original)
+++ directory/sandbox/seelmann/hbase-partition/src/main/java/org/apache/directory/server/core/partition/hbase/table/HBaseTablePool.java
Thu Jul 28 21:23:18 2011
@@ -23,7 +23,7 @@ package org.apache.directory.server.core
 import java.util.LinkedList;
 import java.util.Queue;
 
-import org.apache.directory.server.core.partition.hbase.HBaseStore;
+import org.apache.directory.server.core.partition.hbase.HBaseDistributedPartition;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.client.HTable;
 
@@ -54,7 +54,7 @@ public class HBaseTablePool
     {
         this.tableName = tableName;
         this.configuration = configuration;
-        this.strongConsistency = configuration.getBoolean( HBaseStore.STRONG_CONSISTENCY_PROPERTY,
true );
+        this.strongConsistency = configuration.getBoolean( HBaseDistributedPartition.STRONG_CONSISTENCY_PROPERTY,
true );
         this.available = new LinkedList<HTable>();
         this.used = new LinkedList<HTable>();
     }



Mime
View raw message