You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/06/29 13:39:27 UTC
svn commit: r1141053 [2/2] - in
/directory/apacheds/branches/apacheds-no-reverse-index:
jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
jdbm-partition/src/test/java/org/apache/directory/server/core/partition/imp...
Modified: directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/GenericIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/GenericIndexTest.java?rev=1141053&r1=1141052&r2=1141053&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/GenericIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/GenericIndexTest.java Wed Jun 29 11:39:26 2011
@@ -148,13 +148,6 @@ public class GenericIndexTest
@Test(expected = UnsupportedOperationException.class)
- public void testDropID() throws Exception
- {
- index.drop( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
public void testDropKID() throws Exception
{
index.drop( "test", 5L );
@@ -204,20 +197,6 @@ public class GenericIndexTest
@Test(expected = UnsupportedOperationException.class)
- public void testReverseID() throws Exception
- {
- index.reverse( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testReverseIDK() throws Exception
- {
- index.reverse( 5L, "test" );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
public void testForwardGreaterOrEqK() throws Exception
{
index.forwardGreaterOrEq( "test" );
@@ -232,20 +211,6 @@ public class GenericIndexTest
@Test(expected = UnsupportedOperationException.class)
- public void testReverseGreaterOrEqID() throws Exception
- {
- index.reverseGreaterOrEq( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testReverseGreaterOrEqIDK() throws Exception
- {
- index.reverseGreaterOrEq( 5L, "test" );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
public void testForwardLessOrEqK() throws Exception
{
index.forwardLessOrEq( "test" );
@@ -260,20 +225,6 @@ public class GenericIndexTest
@Test(expected = UnsupportedOperationException.class)
- public void testReverseLessOrEqID() throws Exception
- {
- index.reverseLessOrEq( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testReverseLessOrEqIDK() throws Exception
- {
- index.reverseLessOrEq( 5L, "test" );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
public void testGetAttribute()
{
index.getAttribute();
@@ -302,34 +253,6 @@ public class GenericIndexTest
@Test(expected = UnsupportedOperationException.class)
- public void testReverseCursor() throws Exception
- {
- index.reverseCursor();
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testReverseCursorID() throws Exception
- {
- index.reverseCursor( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testReverseLookup() throws Exception
- {
- index.reverseLookup( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testReverseValueCursor() throws Exception
- {
- index.reverseValueCursor( 5L );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
public void testSync() throws Exception
{
index.sync();
Modified: directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/StoreUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/StoreUtils.java?rev=1141053&r1=1141052&r2=1141053&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/StoreUtils.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/StoreUtils.java Wed Jun 29 11:39:26 2011
@@ -173,98 +173,6 @@ public class StoreUtils
/**
- * This is primarily a convenience method used to extract all the attributes
- * associated with an entry.
- *
- * @param store the store to get the attributes from
- * @param id the id of the entry to get index information for
- * @return the index names and values as an Attributes object
- * @throws Exception if there are failures accessing the underlying store
- */
- @SuppressWarnings("unchecked")
- public Entry getAttributes( Store<Object, Long> store, Long id ) throws Exception
- {
- Entry entry = new DefaultEntry();
-
- // Get the distinguishedName to id mapping
- entry.put( "_nDn", store.getEntryDn( id ).getNormName() );
- entry.put( "_upDn", store.getEntryDn( id ).getName() );
- entry.put( "_parent", Long.toString( store.getParentId( id ) ) );
-
- // Get all standard index attribute to value mappings
- for ( Index index : store.getUserIndices() )
- {
- Cursor<ForwardIndexEntry> list = index.reverseCursor();
- ForwardIndexEntry recordForward = new ForwardIndexEntry();
- recordForward.setId( id );
- list.before( recordForward );
-
- while ( list.next() )
- {
- IndexEntry rec = list.get();
- String val = rec.getValue().toString();
- String attrId = index.getAttribute().getName();
- Attribute attr = entry.get( attrId );
-
- if ( attr == null )
- {
- attr = new DefaultAttribute( attrId );
- }
-
- attr.add( val );
- entry.put( attr );
- }
- }
-
- // Get all existence mappings for this id creating a special key
- // that looks like so 'existence[attribute]' and the value is set to id
- IndexCursor<String, Object, Long> list = store.getPresenceIndex().reverseCursor();
- ForwardIndexEntry recordForward = new ForwardIndexEntry();
- recordForward.setId( id );
- list.before( recordForward );
- StringBuffer val = new StringBuffer();
-
- while ( list.next() )
- {
- IndexEntry rec = list.get();
- val.append( "_existence[" );
- val.append( rec.getValue().toString() );
- val.append( "]" );
-
- String valStr = val.toString();
- Attribute attr = entry.get( valStr );
-
- if ( attr == null )
- {
- attr = new DefaultAttribute( valStr );
- }
-
- attr.add( rec.getId().toString() );
- entry.put( attr );
- val.setLength( 0 );
- }
-
- // Get all parent child mappings for this entry as the parent using the
- // key 'child' with many entries following it.
- IndexCursor<Long, Object, Long> children = store.getOneLevelIndex().forwardCursor();
- ForwardIndexEntry longRecordForward = new ForwardIndexEntry();
- recordForward.setId( id );
- children.before( longRecordForward );
-
- Attribute childAttr = new DefaultAttribute( "_child" );
- entry.put( childAttr );
-
- while ( children.next() )
- {
- IndexEntry rec = children.get();
- childAttr.add( rec.getId().toString() );
- }
-
- return entry;
- }
-
-
- /**
*
* adds a given <i>ServerEntry</i> to the store after injecting entryCSN and entryUUID operational
* attributes
Modified: directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java?rev=1141053&r1=1141052&r2=1141053&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java Wed Jun 29 11:39:26 2011
@@ -236,7 +236,6 @@ public class AvlRdnIndexTest
idx.add( key, 0l );
assertEquals( 0, ( long ) idx.forwardLookup( key ) );
- assertEquals( key, idx.reverseLookup( 0l ) );
}
@@ -255,7 +254,6 @@ public class AvlRdnIndexTest
idx.drop( key, 0l );
assertNull( idx.forwardLookup( key ) );
- assertNull( idx.reverseLookup( 0l ) );
}
Modified: directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java?rev=1141053&r1=1141052&r2=1141053&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java Wed Jun 29 11:39:26 2011
@@ -459,7 +459,7 @@ public class AvlStoreTest
assertFalse( cursor.next() );
- idx.drop( 5L );
+ idx.drop( ( long ) cursor.get().getId(), 5L );
cursor = idx.forwardCursor( 2L );
Modified: directory/apacheds/branches/apacheds-no-reverse-index/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-no-reverse-index/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=1141053&r1=1141052&r2=1141053&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Wed Jun 29 11:39:26 2011
@@ -103,6 +103,8 @@ public class EntryNode implements TreeNo
if ( db.getChildCount( rec.getId() ) == 0 )
{
Evaluator evaluator = engine.evaluator( exprNode );
+
+ /*
if ( evaluator.evaluateId( rec.getId() ) )
{
Entry newEntry = db.lookup( rec.getId() );
@@ -114,6 +116,7 @@ public class EntryNode implements TreeNo
{
continue;
}
+ */
}
else
{