Hi,

I have completed the issue. The PR link is 
https://github.com/apache/incubator-iotdb/pull/495.


> -----原始邮件-----
> 发件人: "田原" <[email protected]>
> 发送时间: 2019-10-31 09:46:52 (星期四)
> 收件人: [email protected]
> 抄送: 
> 主题: Re: Duplicate fields in EngineDataSetWithoutValueFilter.java
> 
> Hi,
> 
> I am working on this issue, I will replace the two fields with one TreeSet. 
> As we don't use multiple threads in querying now, there is no need to use 
> ConcurrentSkipListSet. But Whenever there is a thread safe need, we only need 
> to simply switch it to ConcurrentSkipListSet.
> 
> 
> > -----原始邮件-----
> > 发件人: "Yuan Tian (Jira)" <[email protected]>
> > 发送时间: 2019-10-31 09:41:00 (星期四)
> > 收件人: [email protected]
> > 抄送: 
> > 主题: [jira] [Created] (IOTDB-285) Duplicate fields in 
> > EngineDataSetWithoutValueFilter.java
> > 
> > Yuan Tian created IOTDB-285:
> > -------------------------------
> > 
> >              Summary: Duplicate fields in 
> > EngineDataSetWithoutValueFilter.java
> >                  Key: IOTDB-285
> >                  URL: https://issues.apache.org/jira/browse/IOTDB-285
> >              Project: Apache IoTDB
> >           Issue Type: Improvement
> >             Reporter: Yuan Tian
> > 
> > 
> > There two fields in EngineDataSetWithoutValueFilter.java used to fetch the 
> > minimum time.
> > 
> > {code:java}
> > // Some comments here
> > private PriorityQueue<Long> timeHeap;
> > private Set<Long> timeSet;
> > {code}
> > the Set is used to keep heap from storing duplicate time.
> > 
> > However, a TreeSet field can do both things. No duplicate time and ensure 
> > the time order. There is no need to use these two. 
> > Especially, when we want to change to multiThread version, to keep the 
> > timeHeapPut thread safe, we have to add a synchronized onto the method, 
> > like this:
> > 
> > {code:java}
> > private synchronized void timeHeapPut(long time) {
> >    if (!timeSet.contains(time)) {
> >      timeSet.add(time);
> >      timeHeap.add(time);
> >    }
> >  }
> > {code}
> > 
> > But, if we only use TreeSet, we can simply use the corresponding version, 
> > ConcurrentSkipListSet, to replace it.
> > 
> > 
> > 
> > 
> > 
> > --
> > This message was sent by Atlassian Jira
> > (v8.3.4#803005)

Reply via email to