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

Jean-Noël Rouvignac
06.41.2015 3d755209dc2cab1dad0cf00843fbd3af009ecf62
Removed the ParallelTextWriter experiment (never achieved?, never a success?)

This follows Matthew Swift's advice.
1 files deleted
5 files modified
464 ■■■■■ changed files
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/FileBasedAccessLogPublisherConfiguration.xml 18 ●●●● patch | view | raw | blame | history
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/FileBasedAuditLogPublisherConfiguration.xml 18 ●●●● patch | view | raw | blame | history
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/FileBasedHTTPAccessLogPublisherConfiguration.xml 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java 250 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextAccessLogPublisher.java 80 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java 80 ●●●● patch | view | raw | blame | history
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/FileBasedAccessLogPublisherConfiguration.xml
@@ -74,27 +74,13 @@
      The maximum number of log records that can be stored in the
      asynchronous queue.
    </adm:synopsis>
    <adm:description>
      Setting the queue size to zero activates parallel log writer
      implementation which has no queue size limit and as such the
      parallel log writer should only be used on a very well tuned
      server configuration to avoid potential out of memory errors.
    </adm:description>
    <adm:requires-admin-action>
      <adm:other>
        <adm:synopsis>
          The <adm:user-friendly-name /> must be restarted if this property
          is changed and the asynchronous property is set to true.
        </adm:synopsis>
      </adm:other>
    </adm:requires-admin-action>
        <adm:default-behavior>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>5000</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:integer lower-limit="0" />
      <adm:integer lower-limit="1" />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/FileBasedAuditLogPublisherConfiguration.xml
@@ -73,27 +73,13 @@
      The maximum number of log records that can be stored in the
      asynchronous queue.
    </adm:synopsis>
    <adm:description>
      Setting the queue size to zero activates parallel log writer
      implementation which has no queue size limit and as such the
      parallel log writer should only be used on a very well tuned
      server configuration to avoid potential out of memory errors.
    </adm:description>
    <adm:requires-admin-action>
      <adm:other>
        <adm:synopsis>
          The <adm:user-friendly-name /> must be restarted if this property
          is changed and the asynchronous property is set to true.
        </adm:synopsis>
      </adm:other>
    </adm:requires-admin-action>
        <adm:default-behavior>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>5000</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:integer lower-limit="0" />
      <adm:integer lower-limit="1" />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/FileBasedHTTPAccessLogPublisherConfiguration.xml
@@ -73,27 +73,13 @@
      The maximum number of log records that can be stored in the
      asynchronous queue.
    </adm:synopsis>
    <adm:description>
      Setting the queue size to zero activates parallel log writer
      implementation which has no queue size limit and as such the
      parallel log writer should only be used on a very well tuned
      server configuration to avoid potential out of memory errors.
    </adm:description>
    <adm:requires-admin-action>
      <adm:other>
        <adm:synopsis>
          The <adm:user-friendly-name /> must be restarted if this property
          is changed and the asynchronous property is set to true.
        </adm:synopsis>
      </adm:other>
    </adm:requires-admin-action>
        <adm:default-behavior>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>5000</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:integer lower-limit="0" />
      <adm:integer lower-limit="1" />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
opendj-server-legacy/src/main/java/org/opends/server/loggers/ParallelTextWriter.java
File was deleted
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextAccessLogPublisher.java
@@ -102,10 +102,6 @@
      {
        currentWriter = ((AsynchronousTextWriter) writer).getWrappedWriter();
      }
      else if (writer instanceof ParallelTextWriter)
      {
        currentWriter = ((ParallelTextWriter) writer).getWrappedWriter();
      }
      else
      {
        currentWriter = writer;
@@ -118,67 +114,25 @@
        if (config.isAsynchronous())
        {
          if (useAsyncWriter(config))
          if (writer instanceof AsynchronousTextWriter)
          {
            if (writer instanceof AsynchronousTextWriter)
            if (hasAsyncConfigChanged(config))
            {
              if (hasAsyncConfigChanged(config))
              {
                // reinstantiate
                final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
                writer = newAsyncWriter(mfWriter, config);
                previousWriter.shutdown(false);
              }
            }
            else if (writer instanceof ParallelTextWriter)
            {
              // convert parallel to async
              final ParallelTextWriter previousWriter = (ParallelTextWriter) writer;
              // reinstantiate
              final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
              writer = newAsyncWriter(mfWriter, config);
              previousWriter.shutdown(false);
            }
            else
            {
              // turn async text writer on
              writer = newAsyncWriter(mfWriter, config);
            }
          }
          else
          {
            if (writer instanceof AsynchronousTextWriter)
            {
              // convert async to parallel
              final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
              writer = newParallelWriter(mfWriter, config);
              previousWriter.shutdown(false);
            }
            else if (writer instanceof ParallelTextWriter)
            {
              if (hasParallelConfigChanged(config))
              {
                // reinstantiate
                final ParallelTextWriter previousWriter = (ParallelTextWriter) writer;
                writer = newParallelWriter(mfWriter, config);
                previousWriter.shutdown(false);
              }
            }
            else
            {
              // turn parallel text writer on
              writer = newParallelWriter(mfWriter, config);
            }
            // turn async text writer on
            writer = newAsyncWriter(mfWriter, config);
          }
        }
        else
        {
          if (writer instanceof ParallelTextWriter)
          {
            // asynchronous is being turned off, remove parallel text writers.
            final ParallelTextWriter previousWriter = (ParallelTextWriter) writer;
            writer = mfWriter;
            previousWriter.shutdown(false);
          }
          else if (writer instanceof AsynchronousTextWriter)
          if (writer instanceof AsynchronousTextWriter)
          {
            // asynchronous is being turned off, remove async text writers.
            final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
@@ -276,14 +230,7 @@
      if (cfg.isAsynchronous())
      {
        if (useAsyncWriter(cfg))
        {
          this.writer = newAsyncWriter(theWriter, cfg);
        }
        else
        {
          this.writer = newParallelWriter(theWriter, cfg);
        }
        this.writer = newAsyncWriter(theWriter, cfg);
      }
      else
      {
@@ -311,11 +258,6 @@
    cfg.addFileBasedAccessChangeListener(this);
  }
  private boolean useAsyncWriter(FileBasedAccessLogPublisherCfg config)
  {
    return config.getQueueSize() > 0;
  }
  private boolean hasAsyncConfigChanged(FileBasedAccessLogPublisherCfg newConfig)
  {
    return hasParallelConfigChanged(newConfig) && cfg.getQueueSize() != newConfig.getQueueSize();
@@ -332,12 +274,6 @@
    return new AsynchronousTextWriter(name, config.getQueueSize(), config.isAutoFlush(), mfWriter);
  }
  private ParallelTextWriter newParallelWriter(MultifileTextWriter mfWriter, FileBasedAccessLogPublisherCfg config)
  {
    String name = "Parallel Text Writer for " + config.dn();
    return new ParallelTextWriter(name, config.isAutoFlush(), mfWriter);
  }
  @Override
  public boolean isConfigurationAcceptable(
      final FileBasedAccessLogPublisherCfg configuration,
opendj-server-legacy/src/main/java/org/opends/server/loggers/TextHTTPAccessLogPublisher.java
@@ -124,10 +124,6 @@
      {
        currentWriter = ((AsynchronousTextWriter) writer).getWrappedWriter();
      }
      else if (writer instanceof ParallelTextWriter)
      {
        currentWriter = ((ParallelTextWriter) writer).getWrappedWriter();
      }
      else
      {
        currentWriter = writer;
@@ -140,67 +136,25 @@
        if (config.isAsynchronous())
        {
          if (useAsyncWriter(config))
          if (writer instanceof AsynchronousTextWriter)
          {
            if (writer instanceof AsynchronousTextWriter)
            if (hasAsyncConfigChanged(config))
            {
              if (hasAsyncConfigChanged(config))
              {
                // reinstantiate
                final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
                writer = newAsyncWriter(mfWriter, config);
                previousWriter.shutdown(false);
              }
            }
            else if (writer instanceof ParallelTextWriter)
            {
              // convert parallel to async
              final ParallelTextWriter previousWriter = (ParallelTextWriter) writer;
              // reinstantiate
              final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
              writer = newAsyncWriter(mfWriter, config);
              previousWriter.shutdown(false);
            }
            else
            {
              // turn async text writer on
              writer = newAsyncWriter(mfWriter, config);
            }
          }
          else
          {
            if (writer instanceof AsynchronousTextWriter)
            {
              // convert async to parallel
              final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
              writer = newParallelWriter(mfWriter, config);
              previousWriter.shutdown(false);
            }
            else if (writer instanceof ParallelTextWriter)
            {
              if (hasParallelConfigChanged(config))
              {
                // reinstantiate
                final ParallelTextWriter previousWriter = (ParallelTextWriter) writer;
                writer = newParallelWriter(mfWriter, config);
                previousWriter.shutdown(false);
              }
            }
            else
            {
              // turn parallel text writer on
              writer = newParallelWriter(mfWriter, config);
            }
            // turn async text writer on
            writer = newAsyncWriter(mfWriter, config);
          }
        }
        else
        {
          if (writer instanceof ParallelTextWriter)
          {
            // asynchronous is being turned off, remove parallel text writers.
            final ParallelTextWriter previousWriter = (ParallelTextWriter) writer;
            writer = mfWriter;
            previousWriter.shutdown(false);
          }
          else if (writer instanceof AsynchronousTextWriter)
          if (writer instanceof AsynchronousTextWriter)
          {
            // asynchronous is being turned off, remove async text writers.
            final AsynchronousTextWriter previousWriter = (AsynchronousTextWriter) writer;
@@ -275,11 +229,6 @@
    return getFileForPath(config.getLogFile());
  }
  private boolean useAsyncWriter(FileBasedHTTPAccessLogPublisherCfg config)
  {
    return config.getQueueSize() > 0;
  }
  private boolean hasAsyncConfigChanged(FileBasedHTTPAccessLogPublisherCfg newConfig)
  {
    return hasParallelConfigChanged(newConfig) && cfg.getQueueSize() != newConfig.getQueueSize();
@@ -296,12 +245,6 @@
    return new AsynchronousTextWriter(name, config.getQueueSize(), config.isAutoFlush(), mfWriter);
  }
  private ParallelTextWriter newParallelWriter(MultifileTextWriter mfWriter, FileBasedHTTPAccessLogPublisherCfg config)
  {
    String name = "Parallel Text Writer for " + config.dn();
    return new ParallelTextWriter(name, config.isAutoFlush(), mfWriter);
  }
  private List<String> extractFieldsOrder(String logFormat)
  {
    // there will always be at least one field value due to the regexp
@@ -386,14 +329,7 @@
      if (cfg.isAsynchronous())
      {
        if (useAsyncWriter(cfg))
        {
          this.writer = newAsyncWriter(theWriter, cfg);
        }
        else
        {
          this.writer = newParallelWriter(theWriter, cfg);
        }
        this.writer = newAsyncWriter(theWriter, cfg);
      }
      else
      {