mcardle 2005/08/30 17:47:23 CEST
Modified files:
core/src/java/org/jahia/services/esi EsiService.java
Log:
* added fast check for objects to invalidate
* added more debugging info
Revision Changes Path
1.7 +26 -0
jahia/core/src/java/org/jahia/services/esi/EsiService.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/esi/EsiService.java.diff?r1=1.6&r2=1.7&f=h
Index: EsiService.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/services/esi/EsiService.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- EsiService.java 25 Aug 2005 18:32:34 -0000 1.6
+++ EsiService.java 30 Aug 2005 15:47:23 -0000 1.7
@@ -517,6 +517,32 @@
//TODO: getFragmentsToInvalidate is very similar to
getTemplatesToInvalidate, merge them!!
+ static int empty_count = 0;//for debugging
+ static int notempty_count = 0;//for debugging
+ /**
+ * quick check to see if any content is waiting for invalidation
+ */
+ public boolean checkForAnyContentToInvalidate() {
+ if (notempty_count > 0 && notempty_count > empty_count)
+ logger.error("A Content object probably cannot be invalidated.
(probable cause: it is not attached to a Template/Fragment)");
+
+ logger.debug("checkForAnyContentToInvalidate :
EMPTY["+empty_count+"] / NOT_EMPTY["+notempty_count+"]");
+
+ //TODO: Need to make sure no junk orphaned content stays in these
lists
+ //otherwise it will mess up performance
+ if (!ctnsToInvalidate.isEmpty()
+ || !ctnListsToInvalidate.isEmpty()
+ || !pagesToInvalidate.isEmpty()
+ || !fieldsToInvalidate.isEmpty() ) {
+ notempty_count++;
+ return true;
+ }
+ else {
+ empty_count++;
+ return false;
+ }
+ }
+
/**
* return the list of Fragments which need to be invalidated. A
Fragment is considered
* invalid when one of its content objects is marked for invalidation.
Content can be