Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
750885bc
Commit
750885bc
authored
8 years ago
by
Thomas Mortagne
Browse files
Options
Downloads
Patches
Plain Diff
[misc] Remove useless stuff
parent
8d9acba4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java
+4
-44
4 additions, 44 deletions
...re/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java
with
4 additions
and
44 deletions
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java
+
4
−
44
View file @
750885bc
...
...
@@ -64,10 +64,6 @@ public class XWikiCacheStore implements XWikiCacheStoreInterface, EventListener
private
Cache
<
Boolean
>
pageExistCache
;
private
int
cacheCapacity
=
500
;
private
int
pageExistCacheCapacity
=
10000
;
/**
* Used to know if a received event is a local or remote one.
*/
...
...
@@ -105,34 +101,12 @@ public List<Event> getEvents()
new
WikiDeletedEvent
());
}
// FIXME: init cache only at init and when asked for it instead of lazily in each method
public
void
maybeInitCache
(
XWikiContext
context
)
throws
XWikiException
public
void
initCache
(
XWikiContext
context
)
throws
XWikiException
{
if
((
this
.
cache
==
null
)
||
(
this
.
pageExistCache
==
null
))
{
initCache
(
context
);
}
}
int
cacheCapacity
=
(
int
)
context
.
getWiki
().
ParamAsLong
(
"xwiki.store.cache.capacity"
,
500
);
int
pageExistCacheCapacity
=
(
int
)
context
.
getWiki
().
ParamAsLong
(
"xwiki.store.cache.pageexistcapacity"
,
10000
);
public
synchronized
void
initCache
(
XWikiContext
context
)
throws
XWikiException
{
if
((
this
.
cache
==
null
)
||
(
this
.
pageExistCache
==
null
))
{
try
{
String
capacity
=
context
.
getWiki
().
Param
(
"xwiki.store.cache.capacity"
);
if
(
capacity
!=
null
)
{
this
.
cacheCapacity
=
Integer
.
parseInt
(
capacity
);
}
}
catch
(
Exception
e
)
{
}
try
{
String
capacity
=
context
.
getWiki
().
Param
(
"xwiki.store.cache.pageexistcapacity"
);
if
(
capacity
!=
null
)
{
this
.
pageExistCacheCapacity
=
Integer
.
parseInt
(
capacity
);
}
}
catch
(
Exception
e
)
{
}
initCache
(
this
.
cacheCapacity
,
this
.
pageExistCacheCapacity
,
context
);
}
initCache
(
cacheCapacity
,
pageExistCacheCapacity
,
context
);
}
@Override
...
...
@@ -179,9 +153,6 @@ public void saveXWikiDoc(XWikiDocument doc, XWikiContext context, boolean bTrans
doc
.
setStore
(
this
.
store
);
// Make sure cache is initialized
maybeInitCache
(
context
);
// We need to flush so that caches
// on the cluster are informed about the change
String
key
=
getKey
(
doc
,
context
);
...
...
@@ -284,11 +255,6 @@ public XWikiDocument loadXWikiDoc(XWikiDocument doc, XWikiContext context) throw
// Calculate the cache key
String
key
=
getKey
(
doc
,
context
);
LOGGER
.
debug
(
"Cache: begin for doc {} in cache"
,
key
);
// Make sure cache is initialized
maybeInitCache
(
context
);
LOGGER
.
debug
(
"Cache: Trying to get doc {} from cache"
,
key
);
XWikiDocument
cachedoc
;
...
...
@@ -351,9 +317,6 @@ public void deleteXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWiki
this
.
store
.
deleteXWikiDoc
(
doc
,
context
);
// Make sure cache is initialized
maybeInitCache
(
context
);
getCache
().
remove
(
key
);
getPageExistCache
().
remove
(
key
);
getPageExistCache
().
set
(
key
,
Boolean
.
FALSE
);
...
...
@@ -663,9 +626,6 @@ public boolean exists(XWikiDocument doc, XWikiContext context) throws XWikiExcep
// Calculate the cache key
String
key
=
getKey
(
doc
,
context
);
// Make sure cache is initialized
maybeInitCache
(
context
);
try
{
Boolean
result
=
getPageExistCache
().
get
(
key
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment