mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
04.50.2013 8ae079e04b6596f6b393840df19dce2627d5bfaf
OPENDJ-1116 Introduce abstraction for the changelog DB

* remove serverId parameter from ReplicationDomainDB.getCount(DN, int, CSN, CSN)
3 files modified
25 ■■■■■ changed files
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java 19 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -1313,7 +1313,7 @@
  */
  public long getCount(CSN from, CSN to)
  {
    return domainDB.getCount(baseDN, from.getServerId(), from, to);
    return domainDB.getCount(baseDN, from, to);
  }
  /**
opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java
@@ -136,8 +136,7 @@
   * </ol>
   * <h6>Example</h6>
   * <p>
   * Given the following replica database for baseDN "dc=example,dc=com" and
   * serverId 1:
   * Given the following replica database for baseDN "dc=example,dc=com":
   *
   * <pre>
   * CSN1  <=  Oldest
@@ -150,25 +149,23 @@
   * Then:
   *
   * <pre>
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, CSN1), 1);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, CSN2), 2);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, CSN5), 5);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, null, CSN5), 5);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, null), 0);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, null, null), 5);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, CSN1), 1);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, CSN2), 2);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, CSN5), 5);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, null, CSN5), 5);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, null), 0);
   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, null, null), 5);
   * </pre>
   *
   * @param baseDN
   *          the replication domain baseDN
   * @param serverId
   *          the serverId on which to act
   * @param from
   *          The older CSN where to start the count
   * @param to
   *          The newer CSN where to end the count
   * @return The computed number of changes
   */
  long getCount(DN baseDN, int serverId, CSN from, CSN to);
  long getCount(DN baseDN, CSN from, CSN to);
  /**
   * Returns the {@link CSN} situated immediately after the specified
opends/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java
@@ -375,9 +375,9 @@
  /** {@inheritDoc} */
  @Override
  public long getCount(DN baseDN, int serverId, CSN from, CSN to)
  public long getCount(DN baseDN, CSN from, CSN to)
  {
    DbHandler dbHandler = getDbHandler(baseDN, serverId);
    DbHandler dbHandler = getDbHandler(baseDN, from.getServerId());
    if (dbHandler != null)
    {
      return dbHandler.getCount(from, to);