Skip to content

Commit

Permalink
Use LinkedBlockingQueue instead of ArrayBlockingQueue.
Browse files Browse the repository at this point in the history
  • Loading branch information
riversand9 committed Aug 21, 2017
1 parent 7270199 commit 1fa43a5
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -6,7 +6,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import javax.annotation.concurrent.ThreadSafe;

Expand All @@ -17,12 +17,12 @@ public final class AsyncUserAccessAuditLogWriter {
private static final Logger LOG = LoggerFactory.getLogger(AsyncUserAccessAuditLogWriter.class);
private final boolean mEnabled;
private volatile boolean mStopped;
private ArrayBlockingQueue<AuditContext> mAuditLogEntries;
private LinkedBlockingQueue<AuditContext> mAuditLogEntries;

public AsyncUserAccessAuditLogWriter() {
mEnabled = Boolean.parseBoolean(Configuration.get(PropertyKey.MASTER_AUDIT_LOGGING_ENABLED));
if (mEnabled) {
mAuditLogEntries = new ArrayBlockingQueue<>(QUEUE_SIZE);
mAuditLogEntries = new LinkedBlockingQueue<>(QUEUE_SIZE);
}
mStopped = true;
}
Expand Down

0 comments on commit 1fa43a5

Please sign in to comment.