Browse Source
Merge in DESIGN/design from ~YVAN/design:feature/x to feature/x * commit '68a134524b80de65cd6b546fd1f9827c90d12b70': REPORT-66457 原数据集管理优化 【问题原因】跟产品确定了在搜索过程中做数据集的编辑、删除、粘贴时,需要中断搜索,展示原数据集树 【改动思路】编辑、删除、粘贴处添加跳出搜索的逻辑 【review建议】无 REPORT-68727 【迭代】【数据集管理优化】搜索数据列未加载的数据集,该数据集未被搜索 【问题原因】测试用sleep来模拟取数慢,在取列名的时候会造成一些奇怪的错误 【改动思路】1.因为计算列名里做了异常处理,所以跟产品沟通后确定逻辑为列名为空时,就不展示整个数据集节点了;2.产品让把最大搜索时间的限制去掉 【review建议】无feature/x
Yvan
3 years ago
5 changed files with 16 additions and 99 deletions
@ -1,64 +0,0 @@
|
||||
package com.fr.design.data.datapane.management.search.time; |
||||
|
||||
import com.fr.concurrent.NamedThreadFactory; |
||||
import com.fr.general.ComparatorUtils; |
||||
|
||||
import java.util.concurrent.Executors; |
||||
import java.util.concurrent.ScheduledExecutorService; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
/** |
||||
* 搜索任务定时器 |
||||
* |
||||
* @author Yvan |
||||
*/ |
||||
public class TableDataSearchTimer { |
||||
|
||||
/** |
||||
* 定时器 |
||||
*/ |
||||
private static ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(TableDataSearchTimer.class)); |
||||
|
||||
/** |
||||
* 定时任务 |
||||
*/ |
||||
private TableDataSearchTimerTask timeTask; |
||||
|
||||
/** |
||||
* 最大单次startSearch的时间 |
||||
*/ |
||||
public static final long MAX_SEARCH_TIME = 5000; |
||||
|
||||
private TableDataSearchTimer() { |
||||
} |
||||
|
||||
private static class Holder { |
||||
private static final TableDataSearchTimer INSTANCE = new TableDataSearchTimer(); |
||||
} |
||||
|
||||
public static TableDataSearchTimer getInstance() { |
||||
return Holder.INSTANCE; |
||||
} |
||||
|
||||
public void startClock() { |
||||
this.timeTask = new TableDataSearchTimerTask(); |
||||
scheduler.schedule(timeTask, MAX_SEARCH_TIME, TimeUnit.MILLISECONDS); |
||||
} |
||||
|
||||
public void stopClock() { |
||||
this.timeTask = null; |
||||
} |
||||
|
||||
public void shutdown() { |
||||
scheduler.shutdown(); |
||||
} |
||||
|
||||
/** |
||||
* 判断是不是当前的Timer中的task,为了避免shutdownNow()之后原task仍在执行,可能会 |
||||
* @param task |
||||
* @return |
||||
*/ |
||||
public boolean isCurrentTask(TableDataSearchTimerTask task) { |
||||
return ComparatorUtils.equals(this.timeTask, task); |
||||
} |
||||
} |
@ -1,22 +0,0 @@
|
||||
package com.fr.design.data.datapane.management.search.time; |
||||
|
||||
import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager; |
||||
import com.fr.design.data.datapane.management.search.searcher.TreeSearchStatus; |
||||
|
||||
/** |
||||
* @author Yvan |
||||
*/ |
||||
public class TableDataSearchTimerTask implements Runnable { |
||||
|
||||
public TableDataSearchTimerTask() { |
||||
} |
||||
|
||||
@Override |
||||
public void run() { |
||||
// 最大单次搜索时间过后,将结束搜索
|
||||
if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() == TreeSearchStatus.SEARCHING && |
||||
TableDataSearchTimer.getInstance().isCurrentTask(this)) { |
||||
TableDataTreeSearchManager.getInstance().completeSearch(); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue