SilverNarcissus commented on a change in pull request #2358:
URL: https://github.com/apache/iotdb/pull/2358#discussion_r559882590
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
##########
@@ -43,18 +46,23 @@
private static final Logger LOGGER =
LoggerFactory.getLogger(MemTableFlushTask.class);
private static final FlushSubTaskPoolManager SUB_TASK_POOL_MANAGER =
FlushSubTaskPoolManager
.getInstance();
+ private static IoTDBConfig config =
IoTDBDescriptor.getInstance().getConfig();
private final Future<?> encodingTaskFuture;
private final Future<?> ioTaskFuture;
private RestorableTsFileIOWriter writer;
- private final ConcurrentLinkedQueue<Object> ioTaskQueue = new
ConcurrentLinkedQueue<>();
- private final ConcurrentLinkedQueue<Object> encodingTaskQueue = new
ConcurrentLinkedQueue<>();
+ private final LinkedBlockingQueue<Object> encodingTaskQueue = new
LinkedBlockingQueue<>();
+ private final LinkedBlockingQueue<Object> ioTaskQueue =
(config.isEnableMemControl()
+ && SystemInfo.getInstance().isEncodingFasterThanIo())
+ ? new LinkedBlockingQueue<>(config.getIoTaskQueueSizeForFlushing())
+ : new LinkedBlockingQueue<>();
+
private String storageGroup;
private IMemTable memTable;
- private volatile boolean noMoreEncodingTask = false;
- private volatile boolean noMoreIOTask = false;
+ private long memSerializeTime = 0L;
+ private long ioTime = 0L;
Review comment:
These two variable will be written and read by different thread without
locking. The situation is only one thread to write, so no locking is
reasonable, but they should be volatile so they can be seen by another thread.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]