[ 
https://issues.apache.org/jira/browse/JAMES-2298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16555292#comment-16555292
 ] 

ASF GitHub Bot commented on JAMES-2298:
---------------------------------------

Github user mbaechler commented on a diff in the pull request:

    https://github.com/apache/james-project/pull/129#discussion_r205001258
  
    --- Diff: 
server/queue/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
 ---
    @@ -62,34 +79,40 @@
     /**
      * {@link ManageableMailQueue} implementation which use the fs to store 
{@link Mail}'s
      * <p/>
    - * On create of the {@link FileMailQueue} the {@link #init()} will get 
called. This takes care of
    - * loading the needed meta-data into memory for fast access.
    + * On create of the {@link FileMailQueue} the {@link #init()} will get 
called. This takes care of loading the needed
    + * meta-data into memory for fast access.
      */
     public class FileMailQueue implements ManageableMailQueue {
    +    private static final String FILE_PATH_KEY = "key";
    +    private static final Set<String> FIELDS_TO_LOAD = 
Collections.singleton(FILE_PATH_KEY);
         private static final Logger LOGGER = 
LoggerFactory.getLogger(FileMailQueue.class);
    +    private static final AtomicLong COUNTER = new AtomicLong();
    +    private static final String MSG_EXTENSION = ".msg";
    +    private static final String OBJECT_EXTENSION = ".obj";
    +    private static final String NEXT_DELIVERY = "FileQueueNextDelivery";
    +    private static final int SPLITCOUNT = 8;
    +    private static final SecureRandom RANDOM = new SecureRandom();
     
         private final Map<String, FileItem> keyMappings = 
Collections.synchronizedMap(new LinkedHashMap<>());
         private final BlockingQueue<String> inmemoryQueue = new 
LinkedBlockingQueue<>();
         private final ScheduledExecutorService scheduler = 
Executors.newSingleThreadScheduledExecutor();
    -    private static final AtomicLong COUNTER = new AtomicLong();
         private final String queueDirName;
         private final File queueDir;
    -
         private final MailQueueItemDecoratorFactory 
mailQueueItemDecoratorFactory;
         private final boolean sync;
    -    private static final String MSG_EXTENSION = ".msg";
    -    private static final String OBJECT_EXTENSION = ".obj";
    -    private static final String NEXT_DELIVERY = "FileQueueNextDelivery";
    -    private static final int SPLITCOUNT = 10;
    -    private static final SecureRandom RANDOM = new SecureRandom();
         private final String queueName;
    +    private final IndexWriter indexWriter;
     
         public FileMailQueue(MailQueueItemDecoratorFactory 
mailQueueItemDecoratorFactory, File parentDir, String queuename, boolean sync) 
throws IOException {
             this.mailQueueItemDecoratorFactory = mailQueueItemDecoratorFactory;
             this.sync = sync;
             this.queueName = queuename;
             this.queueDir = new File(parentDir, queueName);
             this.queueDirName = queueDir.getAbsolutePath();
    +        StandardAnalyzer analyzer = new StandardAnalyzer();
    +        this.indexWriter = new IndexWriter(FSDirectory.open(new 
File(queueDir, "index").toPath()),
    --- End diff --
    
    maybe we could name the field so that we now what is actually indexed ?


> FileMailQueue do not support remove
> -----------------------------------
>
>                 Key: JAMES-2298
>                 URL: https://issues.apache.org/jira/browse/JAMES-2298
>             Project: James Server
>          Issue Type: Bug
>          Components: Queue
>    Affects Versions: master
>            Reporter: Tellier Benoit
>            Priority: Major
>
> An exception is thrown or the code badly modify the state of the queue



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to