Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
85dcf3a1
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
85dcf3a1
编写于
10月 06, 2016
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DB2 refresh refactoring.
Cache model improvement (full cache reset on remove).
上级
6527b196
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
37 addition
and
44 deletion
+37
-44
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/manager/DB2TriggerManager.java
.../org/jkiss/dbeaver/ext/db2/manager/DB2TriggerManager.java
+2
-1
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2MaterializedQueryTable.java
...kiss/dbeaver/ext/db2/model/DB2MaterializedQueryTable.java
+2
-3
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2Table.java
...ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2Table.java
+2
-16
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2TableBase.java
...db2/src/org/jkiss/dbeaver/ext/db2/model/DB2TableBase.java
+13
-2
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2View.java
....ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2View.java
+1
-3
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/fed/DB2Nickname.java
.../src/org/jkiss/dbeaver/ext/db2/model/fed/DB2Nickname.java
+1
-6
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataTypeCache.java
...ss/dbeaver/ext/postgresql/model/PostgreDataTypeCache.java
+2
-2
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/AbstractObjectCache.java
...src/org/jkiss/dbeaver/model/impl/AbstractObjectCache.java
+4
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/DBSObjectCache.java
...odel/src/org/jkiss/dbeaver/model/impl/DBSObjectCache.java
+2
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/edit/AbstractObjectManager.java
.../jkiss/dbeaver/model/impl/edit/AbstractObjectManager.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCCompositeCache.java
...iss/dbeaver/model/impl/jdbc/cache/JDBCCompositeCache.java
+2
-2
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCObjectLookupCache.java
.../dbeaver/model/impl/jdbc/cache/JDBCObjectLookupCache.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCStructCache.java
.../jkiss/dbeaver/model/impl/jdbc/cache/JDBCStructCache.java
+2
-2
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCStructLookupCache.java
.../dbeaver/model/impl/jdbc/cache/JDBCStructLookupCache.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/SQLObjectEditor.java
...rg/jkiss/dbeaver/model/impl/sql/edit/SQLObjectEditor.java
+1
-2
未找到文件。
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/manager/DB2TriggerManager.java
浏览文件 @
85dcf3a1
...
...
@@ -23,13 +23,14 @@ import org.jkiss.dbeaver.ext.db2.model.DB2Schema;
import
org.jkiss.dbeaver.ext.db2.model.DB2Trigger
;
import
org.jkiss.dbeaver.model.DBPEvaluationContext
;
import
org.jkiss.dbeaver.model.impl.DBSObjectCache
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
/**
* DB2 Trigger Manager
*
* @author Denis Forveille
*/
public
class
DB2TriggerManager
extends
DB2AbstractDropOnlyManager
<
DB2Trigger
,
DB
2Schema
>
{
public
class
DB2TriggerManager
extends
DB2AbstractDropOnlyManager
<
DB2Trigger
,
DB
SObject
>
{
private
static
final
String
SQL_DROP
=
"DROP TRIGGER %s"
;
...
...
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2MaterializedQueryTable.java
浏览文件 @
85dcf3a1
...
...
@@ -68,10 +68,9 @@ public class DB2MaterializedQueryTable extends DB2ViewBase implements DB2SourceO
@Override
public
DBSObject
refreshObject
(
@NotNull
DBRProgressMonitor
monitor
)
throws
DBException
{
super
.
refreshObject
(
monitor
);
getContainer
().
getMaterializedQueryTableCache
().
clearChildrenCache
(
this
);
return
this
;
return
super
.
refreshObject
(
monitor
);
}
@Override
...
...
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2Table.java
浏览文件 @
85dcf3a1
...
...
@@ -181,27 +181,13 @@ public class DB2Table extends DB2TableBase
@Override
public
DBSObject
refreshObject
(
@NotNull
DBRProgressMonitor
monitor
)
throws
DBException
{
super
.
refreshObject
(
monitor
);
getContainer
().
getTableCache
().
clearChildrenCache
(
this
);
tableTriggerCache
.
clearCache
();
if
(
partitionCache
!=
null
)
{
partitionCache
.
clearCache
();
}
if
(
periodCache
!=
null
)
{
periodCache
.
clearCache
();
}
getContainer
().
getConstraintCache
().
clearObjectCache
(
this
);
getContainer
().
getAssociationCache
().
clearObjectCache
(
this
);
getContainer
().
getReferenceCache
().
clearObjectCache
(
this
);
// DF: Clear base index/trigger cache. Not cheap but didn't found another way..
getContainer
().
getIndexCache
().
clearCache
();
getContainer
().
getTriggerCache
().
clearCache
();
super
.
refreshObject
(
monitor
);
return
this
;
return
getContainer
().
getTableCache
().
refreshObject
(
monitor
,
getContainer
(),
this
)
;
}
@NotNull
...
...
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2TableBase.java
浏览文件 @
85dcf3a1
...
...
@@ -20,6 +20,7 @@ package org.jkiss.dbeaver.ext.db2.model;
import
java.sql.ResultSet
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
...
...
@@ -112,8 +113,18 @@ public abstract class DB2TableBase extends JDBCTable<DB2DataSource, DB2Schema>
{
tableIndexCache
.
clearCache
();
// DF: Clear base index cache. Not cheap but didn't found another way..
getContainer
().
getIndexCache
().
clearCache
();
// DF: Clear base index/trigger cache manually.
// FIXME: use composite cache or something smart
for
(
DB2Index
index
:
new
ArrayList
<>(
getContainer
().
getIndexCache
().
getCachedObjects
()))
{
if
(
index
.
getTable
()
==
this
)
{
getContainer
().
getIndexCache
().
removeObject
(
index
,
true
);
}
}
for
(
DB2Trigger
trigger
:
new
ArrayList
<>(
getContainer
().
getTriggerCache
().
getCachedObjects
()))
{
if
(
trigger
.
getTable
()
==
this
)
{
getContainer
().
getTriggerCache
().
removeObject
(
trigger
,
true
);
}
}
return
this
;
}
...
...
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2View.java
浏览文件 @
85dcf3a1
...
...
@@ -68,9 +68,7 @@ public class DB2View extends DB2ViewBase implements DB2SourceObject {
public
DBSObject
refreshObject
(
@NotNull
DBRProgressMonitor
monitor
)
throws
DBException
{
super
.
refreshObject
(
monitor
);
getContainer
().
getViewCache
().
clearChildrenCache
(
this
);
return
this
;
return
getContainer
().
getViewCache
().
refreshObject
(
monitor
,
getContainer
(),
this
);
}
@Override
...
...
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/fed/DB2Nickname.java
浏览文件 @
85dcf3a1
...
...
@@ -121,13 +121,8 @@ public class DB2Nickname extends DB2TableBase implements DBPNamedObject2, DBPRef
@Override
public
DBSObject
refreshObject
(
@NotNull
DBRProgressMonitor
monitor
)
throws
DBException
{
super
.
refreshObject
(
monitor
);
getContainer
().
getNicknameCache
().
clearChildrenCache
(
this
);
// DF: Clear base index/trigger cache. Not cheap but didn't found
// another way..
getContainer
().
getIndexCache
().
clearCache
();
super
.
refreshObject
(
monitor
);
return
this
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataTypeCache.java
浏览文件 @
85dcf3a1
...
...
@@ -45,8 +45,8 @@ public class PostgreDataTypeCache extends JDBCObjectCache<PostgreSchema, Postgre
}
@Override
public
void
removeObject
(
@NotNull
PostgreDataType
object
)
{
super
.
removeObject
(
object
);
public
void
removeObject
(
@NotNull
PostgreDataType
object
,
boolean
resetFullCache
)
{
super
.
removeObject
(
object
,
resetFullCache
);
dataTypeMap
.
remove
(
object
.
getObjectId
());
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/AbstractObjectCache.java
浏览文件 @
85dcf3a1
...
...
@@ -108,7 +108,7 @@ public abstract class AbstractObjectCache<OWNER extends DBSObject, OBJECT extend
}
@Override
public
void
removeObject
(
@NotNull
OBJECT
object
)
public
void
removeObject
(
@NotNull
OBJECT
object
,
boolean
resetFullCache
)
{
synchronized
(
this
)
{
if
(
this
.
objectList
!=
null
)
{
...
...
@@ -118,6 +118,9 @@ public abstract class AbstractObjectCache<OWNER extends DBSObject, OBJECT extend
this
.
objectMap
.
remove
(
getObjectName
(
object
));
}
}
if
(
resetFullCache
)
{
fullCache
=
false
;
}
}
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/DBSObjectCache.java
浏览文件 @
85dcf3a1
...
...
@@ -67,8 +67,9 @@ public interface DBSObjectCache<OWNER extends DBSObject, OBJECT extends DBSObjec
/**
* Removes specified object from cache
* @param object object to remove
* @param resetFullCache if true resets fullyCached flag. May be used to refresh linked objects.
*/
void
removeObject
(
@NotNull
OBJECT
object
);
void
removeObject
(
@NotNull
OBJECT
object
,
boolean
resetFullCache
);
/**
* Clears all cache
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/edit/AbstractObjectManager.java
浏览文件 @
85dcf3a1
...
...
@@ -71,7 +71,7 @@ public abstract class AbstractObjectManager<OBJECT_TYPE extends DBSObject> imple
{
DBSObjectCache
<?
extends
DBSObject
,
OBJECT_TYPE
>
cache
=
objectMaker
.
getObjectsCache
(
object
);
if
(
cache
!=
null
)
{
cache
.
removeObject
(
object
);
cache
.
removeObject
(
object
,
false
);
}
}
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCCompositeCache.java
浏览文件 @
85dcf3a1
...
...
@@ -178,9 +178,9 @@ public abstract class JDBCCompositeCache<
}
@Override
public
void
removeObject
(
@NotNull
OBJECT
object
)
public
void
removeObject
(
@NotNull
OBJECT
object
,
boolean
resetFullCache
)
{
super
.
removeObject
(
object
);
super
.
removeObject
(
object
,
resetFullCache
);
objectCache
.
remove
(
getParent
(
object
));
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCObjectLookupCache.java
浏览文件 @
85dcf3a1
...
...
@@ -74,7 +74,7 @@ public abstract class JDBCObjectLookupCache<OWNER extends DBSObject, OBJECT exte
this
.
loadObjects
(
monitor
,
owner
);
}
else
{
OBJECT
newObject
=
this
.
reloadObject
(
monitor
,
owner
,
oldObject
,
null
);
removeObject
(
oldObject
);
removeObject
(
oldObject
,
false
);
if
(
newObject
!=
null
)
{
cacheObject
(
newObject
);
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCStructCache.java
浏览文件 @
85dcf3a1
...
...
@@ -171,9 +171,9 @@ public abstract class JDBCStructCache<OWNER extends DBSObject, OBJECT extends DB
}
@Override
public
void
removeObject
(
@NotNull
OBJECT
object
)
public
void
removeObject
(
@NotNull
OBJECT
object
,
boolean
resetFullCache
)
{
super
.
removeObject
(
object
);
super
.
removeObject
(
object
,
resetFullCache
);
clearChildrenCache
(
object
);
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/cache/JDBCStructLookupCache.java
浏览文件 @
85dcf3a1
...
...
@@ -79,7 +79,7 @@ public abstract class JDBCStructLookupCache<OWNER extends DBSObject, OBJECT exte
if
(
isChildrenCached
(
oldObject
))
{
clearChildrenCache
(
oldObject
);
}
removeObject
(
oldObject
);
removeObject
(
oldObject
,
false
);
if
(
newObject
!=
null
)
{
cacheObject
(
newObject
);
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/SQLObjectEditor.java
浏览文件 @
85dcf3a1
...
...
@@ -30,7 +30,6 @@ import org.jkiss.dbeaver.model.impl.edit.AbstractObjectManager;
import
org.jkiss.dbeaver.model.impl.edit.DBECommandAbstract
;
import
org.jkiss.dbeaver.model.messages.ModelMessages
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -328,7 +327,7 @@ public abstract class SQLObjectEditor<OBJECT_TYPE extends DBSObject, CONTAINER_T
OBJECT_TYPE
object
=
getObject
();
DBSObjectCache
<?
extends
DBSObject
,
OBJECT_TYPE
>
cache
=
getObjectsCache
(
object
);
if
(
cache
!=
null
)
{
cache
.
removeObject
(
object
);
cache
.
removeObject
(
object
,
false
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录