Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
80512616
Commit
80512616
authored
14 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-1578] introduced FullTextIndexUpdater
SVN: 16384
parent
76c0c0a8
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/FullTextIndexerRunnable.java
+15
-1
15 additions, 1 deletion
.../server/dataaccess/db/search/FullTextIndexerRunnable.java
with
15 additions
and
1 deletion
openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/FullTextIndexerRunnable.java
+
15
−
1
View file @
80512616
...
...
@@ -39,7 +39,8 @@ import ch.systemsx.cisd.common.logging.LogFactory;
*/
public
final
class
FullTextIndexerRunnable
extends
HibernateDaoSupport
implements
Runnable
{
public
final
static
String
FULL_TEXT_INDEX_MARKER_FILENAME
=
Constants
.
MARKER_PREFIX
+
"full_index"
;
public
final
static
String
FULL_TEXT_INDEX_MARKER_FILENAME
=
Constants
.
MARKER_PREFIX
+
"full_index"
;
private
static
final
Logger
operationLog
=
LogFactory
.
getLogger
(
LogCategory
.
OPERATION
,
FullTextIndexerRunnable
.
class
);
...
...
@@ -51,6 +52,8 @@ public final class FullTextIndexerRunnable extends HibernateDaoSupport implement
private
final
IFullTextIndexer
fullTextIndexer
;
private
final
IFullTextIndexUpdater
fullTextIndexUpdater
;
private
final
IIndexedEntityFinder
indexedEntityFinder
;
public
FullTextIndexerRunnable
(
final
SessionFactory
sessionFactory
,
...
...
@@ -61,6 +64,8 @@ public final class FullTextIndexerRunnable extends HibernateDaoSupport implement
this
.
context
=
context
;
operationLog
.
debug
(
String
.
format
(
"Hibernate search context: %s."
,
context
));
fullTextIndexer
=
new
DefaultFullTextIndexer
(
context
.
getBatchSize
());
// TODO 2009-06-10, Piotr Buczek: use Spring injection
fullTextIndexUpdater
=
new
FullTextIndexUpdater
(
sessionFactory
,
context
);
// TODO 2008-11-25, Tomasz Pylak: maybe we could get rid of hardcoding package path by
// scanning Hibernate mapped entities?
indexedEntityFinder
=
...
...
@@ -76,6 +81,8 @@ public final class FullTextIndexerRunnable extends HibernateDaoSupport implement
final
IndexMode
indexMode
=
context
.
getIndexMode
();
if
(
indexMode
==
IndexMode
.
NO_INDEX
)
{
operationLog
.
debug
(
String
.
format
(
"Skipping indexing process as "
+
" '%s' mode was configured."
,
indexMode
));
return
;
}
final
Set
<
Class
<?>>
indexedEntities
=
indexedEntityFinder
.
getIndexedEntities
();
...
...
@@ -103,6 +110,9 @@ public final class FullTextIndexerRunnable extends HibernateDaoSupport implement
+
"marker file '%s' already exists."
,
markerFile
.
getAbsolutePath
()));
return
;
}
// full text index will be performed so updater queue can be cleared
fullTextIndexUpdater
.
clear
();
//
final
Session
session
=
getSession
();
final
StopWatch
stopWatch
=
new
StopWatch
();
for
(
final
Class
<?>
indexedEntity
:
indexedEntities
)
...
...
@@ -121,6 +131,10 @@ public final class FullTextIndexerRunnable extends HibernateDaoSupport implement
{
notificationLog
.
error
(
String
.
format
(
"A problem has occurred while indexing entity '%s'."
,
currentEntity
),
th
);
}
finally
// when index creation is finished start index updater thread
{
fullTextIndexUpdater
.
start
();
}
}
}
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