[Swift-commit] r7066 - trunk/src/org/griphyn/vdl/mapping

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Mon Sep 16 02:01:04 CDT 2013


Author: hategan
Date: 2013-09-16 02:01:03 -0500 (Mon, 16 Sep 2013)
New Revision: 7066

Modified:
   trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
   trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
   trunk/src/org/griphyn/vdl/mapping/RootDataNode.java
Log:
use a single tracer for VARIABLE traces in swift data and move the "all partial closes have happened" to a trace

Modified: trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2013-09-13 01:48:14 UTC (rev 7065)
+++ trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2013-09-16 07:01:03 UTC (rev 7066)
@@ -37,6 +37,7 @@
 import org.globus.cog.karajan.futures.FutureNotYetAvailable;
 import org.griphyn.vdl.karajan.Loader;
 import org.griphyn.vdl.karajan.WaitingThreadsMonitor;
+import org.griphyn.vdl.karajan.lib.Tracer;
 import org.griphyn.vdl.type.Field;
 import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.util.VDL2Config;
@@ -88,6 +89,8 @@
     
     private int writeRefCount;
     private List<FutureListener> listeners;
+    
+    protected static final Tracer variableTracer = Tracer.getTracer("VARIABLE");
 
     protected AbstractDataNode(Field field) {
         this.field = field;
@@ -789,9 +792,8 @@
             logger.debug(this + " writeRefCount " + this.writeRefCount);
         }
         if (this.writeRefCount == 0) {
-            if(logger.isInfoEnabled()) {
-                logger.info("All partial closes for " + this + 
-                             " have happened. Closing fully.");
+            if (variableTracer.isEnabled()) {
+                variableTracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " CLOSE write ref count is zero");
             }
             closeDeep();
         }

Modified: trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java	2013-09-13 01:48:14 UTC (rev 7065)
+++ trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java	2013-09-16 07:01:03 UTC (rev 7066)
@@ -34,9 +34,7 @@
 	private Mapper mapper;
 	private MappingParamSet params;
 	private AbstractDataNode waitingMapperParam;
-	private DuplicateMappingChecker dmc;
-	
-	private static final Tracer tracer = Tracer.getTracer("VARIABLE");
+	private DuplicateMappingChecker dmc;
 
 	/**
 	 * Instantiate a root array data node with specified type.
@@ -68,8 +66,8 @@
 		waitingMapperParam = params.getFirstOpenParamValue();
         if (waitingMapperParam != null) {
             waitingMapperParam.addListener(this);
-            if (tracer.isEnabled()) {
-                tracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " WAIT " 
+            if (variableTracer.isEnabled()) {
+                variableTracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " WAIT " 
                     + Tracer.getVarName(waitingMapperParam));
             }
             return;
@@ -163,8 +161,8 @@
     private synchronized void initialized() {
         initialized = true;
         waitingMapperParam = null;
-        if (tracer.isEnabled()) {
-            tracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " INITIALIZED " + params);
+        if (variableTracer.isEnabled()) {
+            variableTracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " INITIALIZED " + params);
         }
     }
 }

Modified: trunk/src/org/griphyn/vdl/mapping/RootDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/RootDataNode.java	2013-09-13 01:48:14 UTC (rev 7065)
+++ trunk/src/org/griphyn/vdl/mapping/RootDataNode.java	2013-09-16 07:01:03 UTC (rev 7066)
@@ -39,8 +39,6 @@
 	private AbstractDataNode waitingMapperParam;
 	private DuplicateMappingChecker dmc;
 	
-	private static final Tracer tracer = Tracer.getTracer("VARIABLE");
-
 	public RootDataNode(Type type, DuplicateMappingChecker dmc) {
 		super(Field.Factory.createField(null, type));
 		this.dmc = dmc;
@@ -73,8 +71,8 @@
 	    waitingMapperParam = params.getFirstOpenParamValue();
 	    if (waitingMapperParam != null) {
             waitingMapperParam.addListener(this);
-            if (tracer.isEnabled()) {
-                tracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " WAIT " 
+            if (variableTracer.isEnabled()) {
+                variableTracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " WAIT " 
                     + Tracer.getVarName(waitingMapperParam));
             }
             return;
@@ -149,8 +147,8 @@
 					// Try to get the path in order to check that the 
 				    // path is valid - we'll get an exception if not
 					DSHandle h = root.getField(p);
-					if (tracer.isEnabled()) {
-					    tracer.trace(root.getThread(), root.getDeclarationLine(), 
+					if (variableTracer.isEnabled()) {
+					    variableTracer.trace(root.getThread(), root.getDeclarationLine(), 
 					        root.getDisplayableName() + " MAPPING " + p + ", " + mapper.map(p));
 					}
 				}
@@ -174,8 +172,8 @@
             try {
                 DSHandle field = root.getField(p);
                 field.setValue(FILE_VALUE);
-                if (tracer.isEnabled()) {
-                    tracer.trace(root.getThread(), root.getDeclarationLine(), 
+                if (variableTracer.isEnabled()) {
+                    variableTracer.trace(root.getThread(), root.getDeclarationLine(), 
                         root.getDisplayableName() + " MAPPING " + p + ", " + mapper.map(p));
                 }
                 any = true;
@@ -191,8 +189,8 @@
             }
         }
         root.closeDeep();
-        if (!any && tracer.isEnabled()) {
-            tracer.trace(root.getThread(), root.getDeclarationLine(), 
+        if (!any && variableTracer.isEnabled()) {
+            variableTracer.trace(root.getThread(), root.getDeclarationLine(), 
                 root.getDisplayableName() + " MAPPING no files found");
         }
     }
@@ -288,8 +286,8 @@
 	private synchronized void initialized() {
 		initialized = true;
 		waitingMapperParam = null;
-		if (tracer.isEnabled()) {
-            tracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " INITIALIZED " + params);
+		if (variableTracer.isEnabled()) {
+            variableTracer.trace(getThread(), getDeclarationLine(), getDisplayableName() + " INITIALIZED " + params);
         }
 	}
 }




More information about the Swift-commit mailing list