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 8306146B3 for ; Wed, 29 Jun 2011 11:39:54 +0000 (UTC) Received: (qmail 18408 invoked by uid 500); 29 Jun 2011 11:39:54 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 18269 invoked by uid 500); 29 Jun 2011 11:39:53 -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 18262 invoked by uid 99); 29 Jun 2011 11:39:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 11:39:52 +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; Wed, 29 Jun 2011 11:39:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DAAC323889BB for ; Wed, 29 Jun 2011 11:39:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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... Date: Wed, 29 Jun 2011 11:39:27 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110629113927.DAAC323889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 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 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 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 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 ServerEntry 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 {