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

Matthew Swift
03.13.2012 fe7ff363f1eb8957286d14d1580917caed449d30
Fix OPENDJ-462: Spinning threads in JE backend importer

Use Queue.take() instead of Queue.poll(). Thanks to Radiant Logic for spotting this.
1 files modified
7 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
@@ -2683,16 +2683,14 @@
     * {@inheritDoc}
     */
    @Override
    public Void call() throws IOException
    public Void call() throws IOException, InterruptedException
    {
      long offset = 0;
      List<IndexOutputBuffer> l = new LinkedList<IndexOutputBuffer>();
      try {
        while(true)
        {
          IndexOutputBuffer indexBuffer = queue.poll();
          if(indexBuffer != null)
          {
          final IndexOutputBuffer indexBuffer = queue.take();
            long beginOffset = offset;
            long bufferLen;
            if(!queue.isEmpty())
@@ -2738,7 +2736,6 @@
            }
          }
        }
      }
      catch (IOException e)
      {
        Message message = ERR_JEB_IMPORT_LDIF_INDEX_FILEWRITER_ERR.get(indexMgr