Author: sannegrinovero
Date: 2010-03-28 14:35:44 -0400 (Sun, 28 Mar 2010)
New Revision: 19123
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/AddLuceneWork.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/DeleteLuceneWork.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/OptimizeLuceneWork.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java
Log:
HSEARCH-432 Add logging to trace the WorkQueue before being processed
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/AddLuceneWork.java
===================================================================
---
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/AddLuceneWork.java 2010-03-28
15:48:54 UTC (rev 19122)
+++
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/AddLuceneWork.java 2010-03-28
18:35:44 UTC (rev 19123)
@@ -63,5 +63,10 @@
public <T> T getWorkDelegate(final WorkVisitor<T> visitor) {
return visitor.getDelegate( this );
}
+
+ @Override
+ public String toString() {
+ return "AddLuceneWork: " + this.getEntityClass().getName() + "#" +
this.getIdInString();
+ }
}
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/DeleteLuceneWork.java
===================================================================
---
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/DeleteLuceneWork.java 2010-03-28
15:48:54 UTC (rev 19122)
+++
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/DeleteLuceneWork.java 2010-03-28
18:35:44 UTC (rev 19123)
@@ -42,4 +42,9 @@
return visitor.getDelegate( this );
}
+ @Override
+ public String toString() {
+ return "DeleteLuceneWork: " + this.getEntityClass().getName() + "#"
+ this.getIdInString();
+ }
+
}
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/OptimizeLuceneWork.java
===================================================================
---
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2010-03-28
15:48:54 UTC (rev 19122)
+++
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2010-03-28
18:35:44 UTC (rev 19123)
@@ -45,4 +45,9 @@
return visitor.getDelegate( this );
}
+ @Override
+ public String toString() {
+ return "OptimizeLuceneWork: " + this.getEntityClass().getName();
+ }
+
}
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
===================================================================
---
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2010-03-28
15:48:54 UTC (rev 19122)
+++
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2010-03-28
18:35:44 UTC (rev 19123)
@@ -44,4 +44,9 @@
return visitor.getDelegate( this );
}
+ @Override
+ public String toString() {
+ return "PurgeAllLuceneWork: " + this.getEntityClass().getName();
+ }
+
}
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java
===================================================================
---
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java 2010-03-28
15:48:54 UTC (rev 19122)
+++
search/trunk/hibernate-search/src/main/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java 2010-03-28
18:35:44 UTC (rev 19123)
@@ -179,7 +179,16 @@
}
public void performWorks(WorkQueue workQueue) {
- Runnable processor = backendQueueProcessorFactory.getProcessor(
workQueue.getSealedQueue() );
+ List<LuceneWork> sealedQueue = workQueue.getSealedQueue();
+ if ( log.isDebugEnabled() ) {
+ StringBuilder sb = new StringBuilder( "Lucene WorkQueue to send to backend:
\n\t" );
+ for ( LuceneWork lw : sealedQueue ) {
+ sb.append( lw.toString() );
+ sb.append( "\n\t" );
+ }
+ log.debug( sb.toString() );
+ }
+ Runnable processor = backendQueueProcessorFactory.getProcessor( sealedQueue );
if ( sync ) {
processor.run();
}