23 May, 2014

6 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@10759 41b1ffd8-f28e-4786-ab96-9950f0a78031
    mark
     
  • The downside of this change is that now there could be superfluous byte array copies when appending to a ByteArrayBuilder while code before was building the final byte array once after the final size was known.
    If this proves to be a performance hit, it could be optimized later by building the final byte array on the call to ByteArrayBuilder.toByteArray().
    
    Since OpenDJ 2.8 will introduce a protocol version change, it could be a good time to further cleanup the protocol by always encoding ints, longs, CSNs and booleans in their most compact representations. It should also be possible to remove zero terminated madness for anything else than strings.
    
    
    
    ByteArrayBuilder.java, ByteArrayScanner.java:
    Changed existing code to exactly match legacy behaviour.
    Added methods to simplify protocol (de)serialization.
    In ByteArrayBuilder ctor, set the default byte array size to 256 to avoid too copying byte arrays too many times initially.
    
    ByteArrayTest.java:
    Added tests for new functionalities.
    Increased coverage.
    
    
    AckMsg.java:
    In errorsToString(), used List.toString().
    
    MonitorMsg.java:
    In ctor, used setServerState().
    
    ReplicationMsg.java:
    Removed now unused methods getNextLength() and addByteArray().
    
    StartSessionMsg.java:
    Removed ctor only called from tests.
    
    ReplicationServerTest.java:
    Consequence of removing a ctor for StartSessionMsg.
    
    NotAssuredUpdateMsg.java:
    Extracted methods getRealUpdateMsgBytes(), findNthZeroByte(),
    
    
    ServerState.java:
    Moved ctor code to ByteArrayScanner.nextServerState() + removed getNextLength().
    Moved getBytes() code to ByteArrayBuilder.append(ServerState) + removed addByteArray().
    Added method getServerIdToCSNMap().
    
    ServerStateTest.java:
    Consequence of the change to ServerState class.
    
    
    ReplicationData.java: REMOVED, not used anymore
    
    ReplicationDB.java:
    Consequence of removing ReplicationData.
    Removed dead methods getPreviousCSN() and getRegularRecord().
    
    
    *Msg.java:
    Inlined a few methods (getBytes_V1() for example) to make the code clearer.
    
    *.java:
    Removed comments paraphrasing the code.
    Removed now unnecessary exception handling + declarations for UnsupportedEncodingExceptions.
    Added final keywords.
    Reduced visibility of class members.
    Fixed javadocs.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10757 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • FileChangeNumberIndexDB.java, JEChangeNumberIndexDB.java:
    Renamed DbMonitorProvider.getChangeNumber() to readChangeNumber() + reused getChangeNumber(Record) + used NO_KEY constant.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10755 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    SynchronizationMsgTest.java:
    In DataProvider methods, inlined + renamed local variables.
    Used assertj.
    Removed empty messages in assertions.
    Aligned assertAttributesEqual() with ProtocolCompatibilityTest's version.
    
    ProtocolCompatibilityTest.java:
    In assertAttributesEqual(), improved the code.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10754 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    ProtocolCompatibilityTest.java:
    Factorized code by extracting method assertAttributesEqual().
    Used TestCaseUtils.newList().
    Used assertj.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10753 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    ServerShutdownMonitor.java:
    Factorized code by extracting methods waitAllThreadsDied() and removeDeadThreads().
    Used StaticUtils.sleep(10).
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10752 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

22 May, 2014

4 commits


21 May, 2014

1 commit

  • Implemented a log based on multiple log files 
    
    * Add Log class that manage a log as a set of log files:
    ** it contains at least one log file, the head log file, 
         where new records are appended
    ** it contains from zero to multiple read-only log files, 
        issued from rotation of the head log file when it reaches
        a given size
    * Update LogFile class to act as part of a Log.
    * Add purging feature
    * Update other classes from file package with minor changes
    * Add unit tests for new Log class and purging feature
    
    * Update MeteredStream class to use it in changelog
    * Add new interface RotatableLogFile (to be used later by changelog)
    * Update Policy classes to use this new interface
    
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10746 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     

20 May, 2014

3 commits

  • Used UCDetector and AutoRefactor Eclipse plugins to:
    * reduce visibility of class members,
    * add final keywords to fields,
    * convert comments to javadocs,
    * etc.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10745 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Thanks to Chris Ridd for helpful suggestions as well as his review.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10744 41b1ffd8-f28e-4786-ab96-9950f0a78031
    mark
     
  • …rily leaving the topology
    
    
    Added more tests about how changeNumber computation is performed WRT replicas offline messages and RS restarts.
    
    
    ChangeNumberIndexerTest.java:
    Tested additional scenarios: emptyDBTwoDSsOneInitiallyOffline(), emptyDBTwoDSsOneInitiallyWithChangesThenOffline(), emptyDBTwoDSsOneInitiallyPersistedOfflineThenChanges().
    In several tests, called assertExternalChangelogContent() after calling startCNIndexer().
    Renamed setDBInitialRecords() to setCNIndexDBInitialRecords().
    Added more javadocs.
    Used @Mock + MockitoAnnotations.initMocks() instead of several calls to Mockito.mock().
    
    ChangeNumberIndexer.java:
    Changed the code to support the additional scenarios.
    Renamed allInitialReplicasArePastOldestPossibleCSN() to allInitialReplicasAreOfflineOrAlive().
    Changed removeCursor() into getCursor().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10736 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

18 May, 2014

1 commit


16 May, 2014

1 commit

  • JE was throwing exception when the thread accessing it had been interrupted which happens frequently on single core machines.
    The solution is to replace the use of Thread.sleep(long) + Thread.interrupt() with Object.wait(long) + Object.notify() on thread shutdown.
    
    
    
    JEChangelogDB.java:
    Replaces the use of Thread.sleep(long) + Thread.interrupt() with Object.wait(long) + Object.notify() on thread shutdown.
    Created method jeFriendlySleep(long) to emulate Thread.sleep(long).
    
    ReplicationServer.java:
    Code cleanup.
    Changed shutdown field from boolean to AtomicBoolean.
    Added final keyword to fields.
    Reduced visibility of waitConnections() from public to default.
    In shutdown(), used StaticUtils.close().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10733 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

15 May, 2014

3 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@10730 41b1ffd8-f28e-4786-ab96-9950f0a78031
    ludo
     
  • …s expired even if the expired provided password is wrong
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10729 41b1ffd8-f28e-4786-ab96-9950f0a78031
    cjr
     
  • 
    ExternalChangeLogTest.java:
    Fixed (?) random failures by comparing LDIF values (rightly line ordering insensitive) rather than String values (wrongly line ordering sensitive).
    Added checkLDIF() and toLDIFEntries().
    In checkValues(), changed assert.
    
    LDAPReplicationDomain.java:
    Changed shutdown field from boolean to AtomicBoolean.
    Removed shutdown field and initiateShutdown() from RSUpdater.
    In buildAndPublishMissingChanges(), removed AtomicBoolean parameter.
    
    HistoricalCsnOrderingTest.java:
    Consequence of the change to LDAPReplicationDomain.buildAndPublishMissingChanges().
    Reduced visibilities + added final keyword to fields.
    
    DomainFakeCfg.java:
    Removed 2 unused ctors, addECLDomainAddListener(), removeECLDomainAddListener(), addECLDomainDeleteListener(), removeECLDomainDeleteListener().
    
    CryptoManagerImpl.java:
    Fixed javadocs.
    Removed useless StringBuilder uses.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10728 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

14 May, 2014

4 commits

  • LDAPReplicationDomain.java:
    Removed generator field, duplicated with super class.
    Extracted method getFirstResult(InternalSearchOperation).
    In findAndRenameChild(), removed useless null check.
    
    PersistentServerState.java
    Changed visibilities to default or private.
    Removed conn field + used static import instead.
    Removed on ctor only used by tests.
    In save() simplified the code a lot.
    In checkAndUpdateServerState(), reduced local variable scope + renamed a few of them.
    Extracted method getFirstResult(InternalSearchOperation).
    
    PersistentServerStateTest.java:
    Consequence of removing one ctor from PersistentServerState.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10727 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@10724 41b1ffd8-f28e-4786-ab96-9950f0a78031
    cjr
     
  • 
    LDAPReplicationDomain.java:
    Changed numReplayedPostOpCalled field from int to AtomicInteger.
    Extracted methods newSet(), newList(), exists(), canRemoveAttribute().
    Inlined getPendingUpdatesCount(), getNumReplayedPostOpCalled(), getNumResolvedModifyConflicts(), getNumResolvedNamingConflicts() and getNumUnresolvedNamingConflicts().
    In contains(), changed parameter names.
    Added javadocs to instance variables.
    Reduced visibilities to default or private.
    Added braces to if statements.
    Used static imports.
    Fixed Eclipse warnings.
    Replaced unnecessary use of MessageBuilder by adding arguments to replication messages.
    
    replication*.properties:
    Modified messages to include arguments.
    
    PendingChanges.java:
    Updated copyright year after r10722.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10723 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • PendingChanges.java:
    Removed unused commit(CSN).
    In remove(CSN), now return void.
    Reduced visibilities to default or private.
    Used final keyword.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10722 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

13 May, 2014

3 commits


12 May, 2014

1 commit


08 May, 2014

1 commit


07 May, 2014

1 commit

  • * Add new package org.opends.server.replication.server.changelog.file 
     containing the log file implementation 
    
    * The new package contains the following classes :
    ** Classes implementing the log - independant from changelog and built from scratch
      - LogFile : implementation of log based on a single file
      - LogWriter : writer for the log
      - LogReaderPool : pool of readers for the log
      - Record : a (key, value) log record
      - RecordParser : interface for the convertion from record to bytes and bytes to record
      - DecodingException : exception thrown when record decoding fails
    ** Classes implementing the changelog API, based on the log implementation. 
     - FileChangelogDB
     - FileChangeNumberIndexDB
     - FileChangeNumberIndexDBCursor
     - FileReplicaDB
     - FileReplicaDBCursor
     - ReplicationEnvironment
    
    * Add unit tests for org.opends.server.replication.server.changelog.file package
    
    * Add new attribute 'ds-cfg-replication-db-implementation' in 
     ds-cfg-replication-server (ServerReplicationConfig class), allowing
     to choose the db implementation to use for changelog in directory server: 
     either je or log file. Default is 'je'.
    
    * Add new option 'org.opends.test.replicationDbImpl' for test target in build.xml
     to choose the db implementation to for changelog when running the tests.
     Default is 'log' (log file).
    
    * Update all replication unit tests to allow the selection of changelog db implementation
     to use in tests.
     
    * Fix the ReferentialIntegerityPluginTestCase to do better cleanup at end of test in
     order to avoid side-effect on other tests.
    
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10713 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     

06 May, 2014

1 commit


05 May, 2014

2 commits


01 May, 2014

1 commit

  • * OPENDJ-1429: Access log filtering criterion request-target-dn-not-equal-to does not work
    * OPENDJ-1432: Access log filtering criterion on etime property does not work
    * OPENDJ-1433: Access log filtering criterion on result code property does not work
    * OPENDJ-1434: Access log filtering criteria user-dn-not-equal-to does not work
    * OPENDJ-1435: Access log filtering criteria user-is-not-member-of does not work.
    
    Also added unit tests. Use a single commit because a) the fixes are very small and closely related, and b) some of the bugs have a common cause.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10705 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     

30 Apr, 2014

5 commits

  • Done. Removed a lot of code.
    Noticeable changes:
    
    
    ReplicationCliMain.java:
    Extracted a few methods to factorize code.
    
    GenerationIdTest.java:
    Please note the strange case of checkChangelogSize().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10703 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Preliminary work, also needed by Nicolas for OPENDJ-1177.
    
    
    ByteSequenceReader.java:
    Added peek() and peek(int offset).
    
    ByteSequenceReaderTest.java:
    Added a test.
    Added method b() to ease reading in int -> byte conversion.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10696 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • - Removed System.getProperty("user.dir") from the initialization of the configuration framework and replaced it with the System.getenv(["INSTALL_ROOT"]["INSTANCE_ROOT"]).
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10689 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • …rily leaving the topology
    
    Changed ChangeTimeHeartbeatMsg to be able to send timestamps for a replica stopping. This is done by adding an event type to cover both normal heartbeat and temporarily offline replica.
    This allows RSs to compute medium consistency accurately by using the stop time from the originating server.
    Because of this change, incremented protocol version to v8.
    
    
    
    ProtocolVersion.java:
    Added REPLICATION_PROTOCOL_V8.
    Fixed javadocs by using lists.
    
    ByteArrayBuilder.java, ByteArrayScanner.java, ByteArrayTest.java: ADDED
    
    ChangeTimeHeartbeatMsg.java:
    Added eventType field + added isReplicaOfflineMsg().
    Made ctor private + added factory methods heartbeatMsg() and replicaOfflineMsg().
    Used ByteArrayBuilder and ByteArrayScanner.
    
    CTHeartbeatPublisherThread.java:
    In run(), on shutdown, handle sending a replica offline message.
    
    
    
    SynchronizationMsgTest.java:
    Added changeTimeHeartbeatMsgTest() and assertCTHearbeatMsg().
    Code cleanup + used static import for ProtocolVersion.
    
    
    
    DataServerHandler.java:
    Consequence of the change to StopMsg ctor.
    Extracted method publishStopMsg() for increased readability.
    
    ReplicationServerDomain.java:
    In processChangeTimeHeartbeatMsg(), added support for offline replica messages + declared DirectoryException checked exception.
    
    ServerHandler.java:
    Consequence of the change to ReplicationServerDomain.processChangeTimeHeartbeatMsg() checked exception.
    
    
    
    ChangeNumberIndexer.java:
    In initialize(), handle offline replicas.
    In moveForwardMediumConsistencyPoint(), now throw ChangelogException.
    In removeCursor(), now call resetNextChangeForInsertDBCursor().
    
    ChangeNumberIndexerTest.java:
    Expanded the emptyDBTwoDSsOneGoingOffline() test.
    
    
    
    JEChangelogDB.java, ReplicationDomainDB.java:
    In replicaOffline(), now throw ChangelogException and call ReplicationDbEnv.addOfflineReplica()
    Added ChangelogDBPurger.initiateShutdown().
    
    ReplicationDbEnv.java:
    Added OFFLINE_TAG constant, toReplicaOfflineEntry(), addOfflineReplica() and putInChangelogStateDB(), toByteArray()().
    In decodeChangelogState(), handle offline replica information.
    Changed several method signature to use Entry<byte[], byte[]> instead of Entry<String, String>.
    
    ReplicationDbEnvTest.java:
    Fixed indentation + added tests.
    
    ChangelogState.java:
    Added offlineReplicas field + addOfflineReplica() and getOfflineReplicas() + changed toString() to display it.
    
    
    
    StopMsg.java:
    Added toString().
    
    JEReplicaDBCursor.java:
    Improved comments and javadocs.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10688 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@10687 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

29 Apr, 2014

2 commits

  • - Fixed copyright(s) and replaced OID for fullVendorVersion to 1.3.6.1.4.1.36733.2.1.1.141
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10686 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • ** Dsconfig.java
    - Removed FiXMe and unused comment.
    
    ** dsconfig.properties
    - Fixed typo.
    
    ** BuildVersion.java
    - gets now the version from the "fullVendorVersion" (RootDSEBackend) instead of the cn=monitor.
    
    ** CoreSchema.java
    - Added FULL_VENDOR_VERSION_ATTRIBUTE_TYPE.
    
    ** RootDSE.java
    - Added ATTR_FULL_VENDOR_VERSION.
    - Added getFullVendorVersion().
    - Modified SEARCH_REQUEST to add the ATTR_FULL_VENDOR_VERSION.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10683 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette