10 Oct, 2013
9 commits
-
* Introduce two new maven modules, resulting from splitting functionality of module opendj-ldap-sdk : opendj-core : core APIs opendj-grizzly : implementation classes for Grizzly transport provider These modules produce a jar with the same name (opendj-core and opendj-grizzly) The opendj-ldap-sdk module is kept for compatibility. It contains no more source code, but it provides a opendj-ldap-sdk jar built from the two new maven modules. * Move classes in opendj-grizzly module to org.forgerock.opendj.grizzly package * Move some classes in opendj-core module to the org.forgerock.opendj.ldap.spi package Modify visibility of some constructors and methods of these classes to allow use by classes in opendj-grizzly Classes : - AbstractLDAPFutureResultImpl - LDAPFutureResultImpl - LDAPSearchFutureResultImpl - LDAPBindFutureResultImpl - LDAPCompareFutureResultImpl - LDAPExtendedFutureResultImpl * Duplicated methods in opendj-grizzly module - LDAPReader#decodeEntry - LDAPWriter#encodeEntry to methods in opendj-core module - LDAPUtils#encodeSearchResultEntry - LDAPUtils#decodeSearchResultEntry to avoid sharing or exposing too much code from these classes. git-svn-id: https://svn.forgerock.org/opendj/trunk@9705 41b1ffd8-f28e-4786-ab96-9950f0a78031 -
DBCursor.java: Added usage example to the javadocs. DraftCNDB.java: Replaced catch (Exception) by catch (DatabaseException), or removed them altogether where unapplicable. In next(), first wiped the current record + reverted the if condition and clauses. git-svn-id: https://svn.forgerock.org/opendj/trunk@9704 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Changes after review from Matthew Swift. Renamed CNIndexRecord to ChangeNumberIndexRecord to be consistent with ChangeNumberIndexDB name. git-svn-id: https://svn.forgerock.org/opendj/trunk@9703 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Removed ChangeNumberIndexDB.getRecord(long). ECLServerHandler.java: Replaced calls to ChangeNumberIndexDB.getRecord() by calls to ChangeNumberIndexDB.getCursorFrom(). Inlined all the crossDomainStartState local variables. Added getCursorFrom() to preserve old behaviour from JEChangeNumberIndexDBCursor ctor. ChangeNumberIndexDB.java: Removed getRecord(). JEChangeNumberIndexDB.java: Removed getReadCursor(), getRecord() + some surprising and never used code like lock field, hasLock(), lock() and release(). JEChangeNumberIndexDBCursor.java: In ctor, do not throw ChangelogException if the changeNumber cannot be found. JEChangeNumberIndexDBTest.java: Used JEChangeNumberIndexDB.getCursorFrom() instead of JEChangeNumberIndexDB.getReadCursor(). Renamed a few variables. git-svn-id: https://svn.forgerock.org/opendj/trunk@9702 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Added tests on the CSNs returned by changelog and on their order too. Removed stupid for loops. Extracted methods readCookie() and commonAssert(). Renamed: - getCookie() to assertContainsAndReadCookie() - assertEntries() to assertFourEntries() - assertDnEquals() to assertDNEquals() Added getCSNs(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9701 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9700 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Changes after review from Matthew Swift. Consolidated ChangeNumberIndexDBCursor and ReplicaDBCursor into a single interface named DBCursor. DBCursor.java: ADDED It does not implement Comparable like ReplicaDBCursor. Instead a Comparator has been extracted to JEChangelogDB.CrossReplicaDBCursor . ChangeNumberIndexDBCursor.java, ReplicaDBCursor.java: DELETED - replaced by DBCursor *.java: Used DBCursor instead of removed cursor interfaces. git-svn-id: https://svn.forgerock.org/opendj/trunk@9699 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Here is the failure scenario for this test (with one CPU): t1 (test thread) t2 (CNIndexDB purge thread) ---------------- --------------------------- | | | v | JEChangeNumberIndexDB | run() | trim() | clear(null) <- entered, but not completed v ChangeNumberIndexDB setPurgeDelay(0); addRecord(1) addRecord(2) addRecord(3) | | | +--> executes the clear() v getFirstRecord() <- BOOM NullPointerException! Ensured the CNIndexDB is not trimmed until we explicitly test it: to do this, ensured the thread is only started when needed by the test. Also took the occasion to ensure a faster shutdown for the CNIndexDB trimming thread. JEChangeNumberIndexDB.java: Ensured we use volatile and AtomicBoolean. Renamed thread field to trimmingThread. Extracted method startTrimmingThread(). In trim(), added an AtomicBoolean parameter. Added methods clear(DN, AtomicBoolean shutdown) and mustShutdown() to ensure faster shutdown. JEChangelogDB.java: Called JEChangeNumberIndexDB.startTrimmingThread() after creating the JEChangeNumberIndexDB instance. JEChangeNumberIndexDBTest.java: Extracted constants. In testTrim(), called JEChangeNumberIndexDB.startTrimmingThread(). In testClear(), removed git-svn-id: https://svn.forgerock.org/opendj/trunk@9698 41b1ffd8-f28e-4786-ab96-9950f0a78031 -
Code cleanup. Used InternalClientConnection.process*() methods. git-svn-id: https://svn.forgerock.org/opendj/trunk@9697 41b1ffd8-f28e-4786-ab96-9950f0a78031
09 Oct, 2013
8 commits
-
Improved javadocs. git-svn-id: https://svn.forgerock.org/opendj/trunk@9696 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Change after review from Matthew Swift. ReplicaDBCursor.java: In next(), added thrown ChangelogException. ReplicaDBCursor.java, JEChangelogDB.java: In next(), let ChangelogException go up. *.java: Consequence of the change to ReplicaDBCursor. git-svn-id: https://svn.forgerock.org/opendj/trunk@9695 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
More code cleanups. git-svn-id: https://svn.forgerock.org/opendj/trunk@9694 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Partially reverted r9691 which was: "In getECLChangeNumberLimits(), brought the database empty code to the top of the method: to get something more readable." This code is more complex than I thought. git-svn-id: https://svn.forgerock.org/opendj/trunk@9693 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Added 'eclipse' target that does a job similar to "mvn eclipse:eclipse". In particular, there is not need to call the ignominious cp -r build/classes/admin build/classes/messages .eclipse-build # then hit F5 in Eclipse git-svn-id: https://svn.forgerock.org/opendj/trunk@9692 41b1ffd8-f28e-4786-ab96-9950f0a78031 -
ReplicationServerDomain.java: Renamed getStartState() to getOldestState(). ServerState.java: In duplicateOnlyOlderThan(), changed parameter from CSN to long. ReplicationServer.java: Consequence of the change to ServerState and ReplicationServerDomain. In getECLChangeNumberLimits(), brought the database empty code to the top of the method: to get something more readable. ECLServerHandler.java: Consequence of the change to ServerState and ReplicationServerDomain. Changed a few names / comments. JEChangeNumberIndexDB.java Consequence of the change to ReplicationServerDomain. ExternalChangeLogTest.java Consequence of the change to ReplicationServerDomain. Code cleanup: - removed gblCSN instance field - inlined sleep() - used connection.process*() + inlined runModifyOperation() and runDeleteOperation(). - renamed getReplicationDomainStartState() to getDomainOldestState() + added better asserts git-svn-id: https://svn.forgerock.org/opendj/trunk@9691 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
JEChangeNumberIndexDBTest.java: Fixed the build. ChangeNumberIndexDB.java, JEChangeNumberIndexDB.java: Improved the javadocs. Made instance variables volatile. *.java: First => Oldest Last => Newest git-svn-id: https://svn.forgerock.org/opendj/trunk@9690 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Changes after review from Matthew Swift. ChangeNumberIndexDB.java: In addRecord(), added a precision to the javadoc. ReplicationDomainDB.java In getDomainLatestTrimDate(), added a precision to the javadoc. Added replicaHeartbeat() and replicaOffline(). JEChangelogDB.java: Added empty implementation for replicaHeartbeat() and replicaOffline(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9689 41b1ffd8-f28e-4786-ab96-9950f0a78031
08 Oct, 2013
12 commits
-
…uesting transport implementations As a consequence of fix of issue with StaticUtils#getProvider, reverted change in tests: there is no need for a specific class loader. git-svn-id: https://svn.forgerock.org/opendj/trunk@9688 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
…uesting transport implementations As a consequence of fix of issue with StaticUtils#getProvider, reverted change in tests: there is no need for a specific class loader. git-svn-id: https://svn.forgerock.org/opendj/trunk@9687 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
…uesting transport implementations Fixed an issue in StaticUtils#getProvider : passing a null class loader to ServiceLoader#load(Class<T>, ClassLoader) has unexpected effect, ie it is not throwing a NPE and has not the same behavior that ServiceLoader#load(Class<T>). Now code explicitely checks for null class loader and use the appropriate load method. As a consequence : * Reverted in all tests of opendj-ldap-sdk the use of a specific LDAPOption to provide a specific class loader, as it is not necessary any more with the fix. * Removed utility methods in TestCaseUtils class to ease the use of custom class loader, they're not needed anymore git-svn-id: https://svn.forgerock.org/opendj/trunk@9686 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Changes after review from Matthew Swift. Hid ChangeNumberIndexDB.nextChangeNumber() from client code. ChangeNumberIndexDB.java, JEChangeNumberIndexDB.java: Removed nextChangeNumber(). Changed addRecord() to return the assigned changeNumber. ECLServerHandler.java, CNIndexRecord.java: Consequence of the change above. git-svn-id: https://svn.forgerock.org/opendj/trunk@9685 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Big code cleanup to remove as much useless variables and useless code as possible to only leave the important parts of the tests. There's more to do but I am tired now, I'll see later for the rest. git-svn-id: https://svn.forgerock.org/opendj/trunk@9684 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
… requesting transport implementations This a a part of OPENDJ-175 - Decouple OpenDJ LDAP SDK from Grizzly CR-2440 * LDAPConnectionFactory/LDAPListener load its implementation via java.util.ServiceLoader, the JDK loader facility. An implementation is given by a transport provider. Common code to load a provider is implemented in StaticUtils#getProvider * New package org.forgerock.opendj.ldap.spi that contains interfaces for providers and implementations. TransportProvider interface which provides: - LDAPConnectionFactoryImpl, implementation for LDAPConnectionFactory - LDAPListenerImpl, implementation for LDAPListener * There is one transport provider based on Grizzly: GrizzlyTransportProvider class which provides the two implementation classes - GrizzlyLDAPConnectionFactory - GrizzlyLDAPListener In order to locate transport provider to use, the file 'org.forgerock.opendj.ldap.spi.TransportProvider' must be available in the classpath in META-INF/services directory. That file is included with the value "com.forgerock.opendj.ldap.GrizzlyTransportProvider" to have Grizzly as the default provider * LDAPOptions and LDAPListenerOptions: - have no more TCPNIOTransport option, - have two new options transportProvider and providerClassLoader to tune loading of providers. - transportProvider allow to require a given provider (eg, "Grizzly"), otherwise the first provider found will be used. - providerClassLoader allow to provide a class loader to use when several class loaders are used by an application. ServiceLoader needs to load both provider-configuration file and provider class from the same class loader, so there are case where you must provide the correct class loader to find the provider class. * Fixed all the tests in opendj-ldap-sdk, because they suffer from the class loader problem if not providing the right class loader - Systematically provide the class loader used by test class when creating LDAPConnectionFactory or LDAPListener - Added utility methods in TestCaseUtils class to ease the use of custom class loader * Fixed tests in modules: opendj-ldap-toolkit and opendj-server2x-adapter - Same fix than for opendj-ldap-sdk - Added new TestCaseUtils.java class in both modules to hold utility methods git-svn-id: https://svn.forgerock.org/opendj/trunk@9683 41b1ffd8-f28e-4786-ab96-9950f0a78031 -
Leveraged the ReplicaDBCursor interface to hide iterations cross replica DBs from client code. Net benefit: more coherent code + reduced coupling between changelogDB and ECL code. There is an added benefit: searching on cn=changelog now returns changes in order. The change was implemented by moving code from MessageHandler to JEChangelogDB. MessageHandler.java: Removed nextOldestUpdateMsg(), addCursorIfNotEmpty() and collectAllCursorsWithChanges(). Extracted method isLateQueueBelowThreshold(). ReplicationServerDomain.java Removed getServerIds() and getCursorFrom(int, CSN) Added getCursorFrom(CSN) and getCursorFrom(ServerState). ReplicationDomainDB.java: Removed getDomainServerIds() and getCursorFrom(DN, int, CSN) Added getCursorFrom(DN, CSN) and getCursorFrom(DN, ServerState). JEChangelogDB.java Added inenr class CrossReplicaDBCursor + moved getCursorFrom(DN, int, CSN) here from enclosing type. Removed getDomainServerIds(). Added getCursorFrom(DN, CSN) and getCursorFrom(DN, ServerState). ReplicationBackend.java: In writeChangesAfterCSN(), removed loop on the serverIds + renamed "rsd" to "rsDomain". JEReplicaDB.java, JEReplicaDBCursor.java: Implemented toString(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9682 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9681 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
MultiDomainServerState.java In update() removed the call to ServerState.duplicate() and let client code decide whether it needs to call it. In toString(), use dSTringBuilder. Code cleanup, removed use of "this" and useless parentheses. ReplicationServer.java: In getLastECLCookie(), made the code more efficient: called ReplicationServerDomain.getLatestServerState() only if the baseDN is not excluded. ECLServerHandler.java: In buildDomainContexts(), Call ServerState.duplicate() before calling MultiDomainServerState.update(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9680 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Extracted methods isMsgQueueAboveThreshold() and isMsgQueueBelowThreshold(). Extracted MsgQueue.consumeUpTo(UpdateMsg). Updated javadocs. MsgQueue.java: Added method consumeUpTo(UpdateMsg). git-svn-id: https://svn.forgerock.org/opendj/trunk@9679 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Tightening up the interfaces after review from Matthew Swift CNIndexRecord.java: Now final, removed a useless call to super(). ChangeNumberIndexDB.java, JEChangeNumberIndexDB.java: Removed methods from the interface that ought not to be exposed to clients but remain internal to the implementation. Moved javadocs to the implementation. JEChangelogDB.java: Reference JEChangeNumberIndexDB instead of ChangeNumberIndexDB due to the change above. git-svn-id: https://svn.forgerock.org/opendj/trunk@9678 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ECLServerHandler.java: Renamed clDomCtxtsToString() to domaimCtxtsToString(). In waitAndProcessStartSessionECLFromRemoteServer(), removed the many declared exceptions. Extracted method buildDomainContexts(). Renamed findOldestChangeFromDomainCtxts() to findDomainCtxtWithOldestChange(). Removed useless comments git-svn-id: https://svn.forgerock.org/opendj/trunk@9677 41b1ffd8-f28e-4786-ab96-9950f0a78031
07 Oct, 2013
7 commits
-
Renamed "rsd" variable and field to "domain" and "rsDomain". git-svn-id: https://svn.forgerock.org/opendj/trunk@9675 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ECLServerHandler.java: In getNextMessage(), forgot to revert one condition. Changed domainCtxts from DomainContext[] to Set<DomainContext>. git-svn-id: https://svn.forgerock.org/opendj/trunk@9674 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ECLServerHandler.java: Moved fields to the top of the file. Extracted method asDate(), toString(CSN), isEligible(), debugInfo(), getNextMessage(), newECLUpdateMsg(). Renamed getNextEligibleMessageForDomain() to computeNextEligibleMessageForDomain(). Renamed initializeCLSearchFromGenState() to initializeCLSearchFromCookie(). In initializeChangelogDomainCtxts(), used foreach + extracted local variable "latestServerState" (no need to duplicate it) + collapsed one if statement. Removed commented out code. ECLServerWriter.java: Minor code cleanup: - Removed useless parentheses - Collapsed if statements git-svn-id: https://svn.forgerock.org/opendj/trunk@9673 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
* rename CSN comparison methods to make them easier to understand. git-svn-id: https://svn.forgerock.org/opendj/trunk@9672 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Slayered walking dead code. Walking dead code is code that looks it is alive, tastes just like if it was alive, but there is funny smell about it, and actually... it turns out this code is dead. ReplicationServerDomain.getEligibleState() is walking dead code because: - JEChangelogDB.getCSNAfter() always returns null: the API of ReplicaDBCursor mandates to call call next() before calling getChange(), however getCSNAfter() fails to do so, hence getChange() always returns null, which means getCSNAfter() always returns null. - the "result" local variable is a duplicate of "latestState", which means it starts of with the exact same state. The code iterates through "latestState" to get its CSNs, calling update() on "result" with these CSNs. But... since "result" duplicates "latestState", it has the exact same CSNs, which means calling update() will have no effect on "result", leaving it on the same state as it was before the iterations. ECLServerHandler.java, ReplicationServer.java: Replaced ReplicationServerDomain.getEligibleState() with ReplicationServerDomain.getLatestServerState().duplicate() where applicable. ReplicationServerDomain.java: Removed getEligibleState() which does literally nothing, but in a very inneficient way. ReplicationDomainDB.java, JEChangelogDB.java: Removed getCSNAfter(), now become unused. git-svn-id: https://svn.forgerock.org/opendj/trunk@9671 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
* remove serverId parameter from ReplicationDomainDB#publishUpdateMsg(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9670 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Fixing this test: the main problem was in classCleanUp() that was trying to remove non leaves entries, which ended up in a failure. git-svn-id: https://svn.forgerock.org/opendj/trunk@9669 41b1ffd8-f28e-4786-ab96-9950f0a78031
05 Oct, 2013
3 commits
-
Fixing this test: the main problem was in afterTest() that was trying to remove non leaves entries, which ended up in a failure. Renamed all the "changelog" to "replServer". Extracted a few methods. Removed useless parameters from other methods. Removed useless methods. Removed unneeded try / catch / log. Made better use of assertions and assertj. git-svn-id: https://svn.forgerock.org/opendj/trunk@9668 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
I think it was invalid to think that we might want to call getCount() for a given serverId (hence replicaDB) by using the serverId from one of the CSNs. We can very well call getCount() with from and to CSNs that are not present on the targeted replicaDB. git-svn-id: https://svn.forgerock.org/opendj/trunk@9667 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Fixed problem introduced in tests at r9648. HeartBeatMsg.java: Added toString(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9666 41b1ffd8-f28e-4786-ab96-9950f0a78031
04 Oct, 2013
1 commit
-
… it helps with CI that runs on single CPU machine. git-svn-id: https://svn.forgerock.org/opendj/trunk@9665 41b1ffd8-f28e-4786-ab96-9950f0a78031