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 7A54F4337 for ; Thu, 23 Jun 2011 11:37:45 +0000 (UTC) Received: (qmail 72597 invoked by uid 500); 23 Jun 2011 11:37:45 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 72551 invoked by uid 500); 23 Jun 2011 11:37:45 -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 72544 invoked by uid 99); 23 Jun 2011 11:37:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 11:37:45 +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, 23 Jun 2011 11:37:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 749E723889D5 for ; Thu, 23 Jun 2011 11:37:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1138838 - in /directory/apacheds/trunk: 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/impl/btree/jdbm/ ldif-partition/src/ma... Date: Thu, 23 Jun 2011 11:37:23 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110623113723.749E723889D5@eris.apache.org> Author: elecharny Date: Thu Jun 23 11:37:22 2011 New Revision: 1138838 URL: http://svn.apache.org/viewvc?rev=1138838&view=rev Log: Removed the getCurrentId(E), getProperty(String) and setProperty(String) from the MasterTable interface and implementation classes, those methods are never used. (YAGNI principle) Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java (original) +++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java Thu Jun 23 11:37:22 2011 @@ -182,19 +182,6 @@ public class JdbmMasterTable extends } - public Long getCurrentId( E entry ) throws Exception - { - Long id; - - synchronized ( adminTbl ) - { - id = new Long( adminTbl.get( SEQPROP_KEY ) ); - } - - return id; - } - - /** * Get's the next value from this SequenceBDb. This has the side-effect of * changing the current sequence values permanently in memory and on disk. @@ -222,38 +209,6 @@ public class JdbmMasterTable extends /** - * Gets a persistent property stored in the admin table of this MasterTable. - * - * @param property the key of the property to get the value of - * @return the value of the property - * @throws Exception when the underlying admin table cannot be read - */ - public String getProperty( String property ) throws Exception - { - synchronized ( adminTbl ) - { - return adminTbl.get( property ); - } - } - - - /** - * Sets a persistent property stored in the admin table of this MasterTable. - * - * @param property the key of the property to set the value of - * @param value the value of the property - * @throws Exception when the underlying admin table cannot be writen - */ - public void setProperty( String property, String value ) throws Exception - { - synchronized ( adminTbl ) - { - adminTbl.put( property, value ); - } - } - - - /** * {@inheritDoc} */ public void resetCounter() throws Exception Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java (original) +++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java Thu Jun 23 11:37:22 2011 @@ -142,17 +142,9 @@ public class JdbmMasterTableTest assertNull( table.get( 0L ) ); assertEquals( 0, table.count() ); - assertEquals( 0, ( long ) table.getCurrentId( null ) ); assertEquals( 1, ( long ) table.getNextId( null ) ); - assertEquals( 1, ( long ) table.getCurrentId( null ) ); assertEquals( 0, table.count() ); - assertEquals( 1, ( long ) table.getCurrentId( null ) ); assertEquals( 2, ( long ) table.getNextId( null ) ); - assertEquals( 2, ( long ) table.getCurrentId( null ) ); - - assertNull( table.getProperty( "foo" ) ); - table.setProperty( "foo", "bar" ); - assertEquals( "bar", table.getProperty( "foo" ) ); } } Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original) +++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Thu Jun 23 11:37:22 2011 @@ -478,15 +478,6 @@ public class JdbmStoreTest @Test - public void testPersistentProperties() throws Exception - { - assertNull( store.getProperty( "foo" ) ); - store.setProperty( "foo", "bar" ); - assertEquals( "bar", store.getProperty( "foo" ) ); - } - - - @Test public void testFreshStore() throws Exception { Dn dn = new Dn( schemaManager, "o=Good Times Co." ); Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java (original) +++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java Thu Jun 23 11:37:22 2011 @@ -196,16 +196,6 @@ public abstract class AbstractLdifPartit * {@inheritDoc} */ @Override - public String getProperty( String propertyName ) throws Exception - { - return wrappedPartition.getProperty( propertyName ); - } - - - /** - * {@inheritDoc} - */ - @Override public Index getSubAliasIndex() { return wrappedPartition.getSubAliasIndex(); @@ -316,16 +306,6 @@ public abstract class AbstractLdifPartit * {@inheritDoc} */ @Override - public void setProperty( String propertyName, String propertyValue ) throws Exception - { - wrappedPartition.setProperty( propertyName, propertyValue ); - } - - - /** - * {@inheritDoc} - */ - @Override public void setSchemaManager( SchemaManager schemaManager ) { super.setSchemaManager( schemaManager ); Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Thu Jun 23 11:37:22 2011 @@ -499,12 +499,6 @@ public abstract class BTreePartition public abstract int getChildCount( ID id ) throws LdapException; - public abstract void setProperty( String key, String value ) throws Exception; - - - public abstract String getProperty( String key ) throws Exception; - - public abstract Iterator getUserIndices(); Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java Thu Jun 23 11:37:22 2011 @@ -342,24 +342,6 @@ public abstract class AbstractXdbmPartit /** * {@inheritDoc} */ - public final void setProperty( String propertyName, String propertyValue ) throws Exception - { - store.setProperty( propertyName, propertyValue ); - } - - - /** - * {@inheritDoc} - */ - public final String getProperty( String propertyName ) throws Exception - { - return store.getProperty( propertyName ); - } - - - /** - * {@inheritDoc} - */ public final void modify( ModifyOperationContext modifyContext ) throws LdapException { try Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Thu Jun 23 11:37:22 2011 @@ -243,24 +243,6 @@ public abstract class AbstractStore exte /** - * Gets the value of the id sequence from this MasterTable's sequence - * without affecting the value. - * - * @param entry the entry in case the id is derived from the entry. - * @return the current value of this MasterTable's sequence - * @throws Exception if the admin table storing sequences cannot be read - */ - ID getCurrentId( E entry ) throws Exception; - - - /** * Gets the next value from the sequence of this MasterTable. This has * the side-effect of incrementing the sequence values permanently. * @@ -84,26 +73,6 @@ public interface MasterTable exte * @throws Exception on failure to update the id sequence */ ID getNextId( E entry ) throws Exception; - - - /** - * Gets a persistent property associated with this MasterTable. - * - * @param property the key of the property to get the value of - * @return the value of the property - * @throws Exception on failure to read the property - */ - String getProperty( String property ) throws Exception; - - - /** - * Sets a persistent property associated with this MasterTable. - * - * @param property the key of the property to set the value of - * @param value the value of the property - * @throws Exception on failure to write the property - */ - void setProperty( String property, String value ) throws Exception; /** Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java Thu Jun 23 11:37:22 2011 @@ -529,12 +529,6 @@ public interface Store extends A } - public Long getCurrentId( E entry ) throws Exception - { - return counter.longValue(); - } - public Long getNextId( E entry ) throws Exception { return counter.incrementAndGet(); } - - - public String getProperty( String property ) throws Exception - { - return props.getProperty( property ); - } - - - public void setProperty( String property, String value ) throws Exception - { - props.setProperty( property, value ); - } /** Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java?rev=1138838&r1=1138837&r2=1138838&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java Thu Jun 23 11:37:22 2011 @@ -391,15 +391,6 @@ public class AvlStoreTest @Test - public void testPersistentProperties() throws Exception - { - assertNull( store.getProperty( "foo" ) ); - store.setProperty( "foo", "bar" ); - assertEquals( "bar", store.getProperty( "foo" ) ); - } - - - @Test public void testFreshStore() throws Exception { Dn dn = new Dn( schemaManager, "o=Good Times Co." );