[Swift-commit] r6399 - in branches/faster: libexec src src/org/griphyn/vdl/karajan/lib src/org/griphyn/vdl/karajan/lib/swiftscript src/org/griphyn/vdl/mapping

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Mon Mar 18 19:35:30 CDT 2013


Author: hategan
Date: 2013-03-18 19:35:30 -0500 (Mon, 18 Mar 2013)
New Revision: 6399

Added:
   branches/faster/src/org/griphyn/vdl/karajan/lib/SetDatasetValues.java
Modified:
   branches/faster/libexec/swift-lib.k
   branches/faster/libexec/swift.k
   branches/faster/src/
   branches/faster/src/org/griphyn/vdl/karajan/lib/AppendArray.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/GetFieldSubscript.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/New.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/PartialCloseDataset.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/SliceArray.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
   branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
   branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java
   branches/faster/src/org/griphyn/vdl/mapping/ArrayDataNode.java
   branches/faster/src/org/griphyn/vdl/mapping/DSHandle.java
   branches/faster/src/org/griphyn/vdl/mapping/DataNode.java
   branches/faster/src/org/griphyn/vdl/mapping/ExternalDataNode.java
   branches/faster/src/org/griphyn/vdl/mapping/OpenArrayEntries.java
   branches/faster/src/org/griphyn/vdl/mapping/RootDataNode.java
Log:
cleaned up field access a bit (a path object is not constructed if an immediate field is accessed) and added value checking to data sets: this allows the code to track whether a piece of data has been assigned a valid value when it is closed; this in turns avoid hangs such as the ones in bug 481

Modified: branches/faster/libexec/swift-lib.k
===================================================================
--- branches/faster/libexec/swift-lib.k	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/libexec/swift-lib.k	2013-03-19 00:35:30 UTC (rev 6399)
@@ -72,6 +72,7 @@
 	export(partialCloseDataset, def("org.griphyn.vdl.karajan.lib.PartialCloseDataset"))
 	export(setWaitCount, def("org.griphyn.vdl.karajan.lib.SetWaitCount"))
 	export(cleanDataset, def("org.griphyn.vdl.karajan.lib.CleanDataset"))
+	export(setDatasetValues, def("org.griphyn.vdl.karajan.lib.SetDatasetValues"))
 	export(range, def("org.griphyn.vdl.karajan.lib.Range"))
 
 	export(isLogged, def("org.griphyn.vdl.karajan.lib.IsLogged"))

Modified: branches/faster/libexec/swift.k
===================================================================
--- branches/faster/libexec/swift.k	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/libexec/swift.k	2013-03-19 00:35:30 UTC (rev 6399)
@@ -242,6 +242,7 @@
 									}
 								}
 							}
+							setDatasetValues(stageout)
 							mark(restartout, err=false, mapping=false)
 							log(LOG:INFO, "END_SUCCESS thread=", currentThread(), " tr={tr}")
 							setProgress(progress, "Finished successfully")


Property changes on: branches/faster/src
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/src:6214
   + /branches/release-0.94/src:6387
/trunk/src:6214

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/AppendArray.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/AppendArray.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/AppendArray.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -23,8 +23,6 @@
 import org.globus.cog.karajan.analyzer.Signature;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
-import org.griphyn.vdl.mapping.InvalidPathException;
-import org.griphyn.vdl.mapping.Path;
 
 public class AppendArray extends SetFieldValue {
     
@@ -40,11 +38,10 @@
         // while there isn't a way to avoid conflicts between auto generated indices
         // and a user manually using the same index, adding a "#" may reduce
         // the incidence of problems
-        Path path = Path.EMPTY_PATH.addFirst(getThreadPrefix(), true);
-        try {
-            deepCopy(var.getField(path), value, stack);
+       try {
+            deepCopy(var.getField(getThreadPrefix()), value, stack);
         }
-        catch (InvalidPathException e) {
+        catch (NoSuchFieldException e) {
             throw new ExecutionException(this, e);
         }
         return null;

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/GetFieldSubscript.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/GetFieldSubscript.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/GetFieldSubscript.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -17,8 +17,6 @@
 
 package org.griphyn.vdl.karajan.lib;
 
-import java.util.Collection;
-
 import k.rt.ExecutionException;
 import k.rt.Stack;
 
@@ -49,20 +47,12 @@
 		try {
 		    indexh.waitFor();
 		    Object index = indexh.getValue();
-			Path path;
 			if ("*".equals(index)) {
-			    path = Path.CHILDREN;
+			    return var.getFields(Path.CHILDREN);
 			}
 			else {
-				path = Path.EMPTY_PATH.addFirst((Comparable<?>) index, true);
+			    return var.getField(Path.EMPTY_PATH.addFirst((Comparable<?>) index, true));
 			}
-			Collection<DSHandle> fields = var.getFields(path);
-			if (fields.size() == 1) {
-				return fields.iterator().next();
-			}
-			else {
-				return fields;
-			}
 		}
 		catch (OOBYield y) {
 		    throw y.wrapped(this);

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/New.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/New.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/New.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -43,7 +43,6 @@
 import org.griphyn.vdl.mapping.MappingParam;
 import org.griphyn.vdl.mapping.MappingParamSet;
 import org.griphyn.vdl.mapping.OOBYield;
-import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.mapping.RootArrayDataNode;
 import org.griphyn.vdl.mapping.RootDataNode;
 import org.griphyn.vdl.mapping.file.ConcurrentMapper;
@@ -177,9 +176,8 @@
 							// TODO check type consistency of elements with
 							// the type of the array
 							Object n = i.next();
-							Path p = Path.EMPTY_PATH.addLast(index, true);
 							if (n instanceof DSHandle) {
-								handle.getField(p).set((DSHandle) n);
+								handle.getField(index).set((DSHandle) n);
 							}
 							else {
 								throw new RuntimeException(

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/PartialCloseDataset.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/PartialCloseDataset.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/PartialCloseDataset.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -41,11 +41,6 @@
 		if (logger.isDebugEnabled()) {
 			logger.debug("Partially closing " + var);
 		}
-
-		if (var.isClosed()) {
-			logger.debug("variable already closed - skipping partial close processing");
-			return null;
-		}
 		
 		int count = this.count.getValue(stack).intValue();
 		var.updateWriteRefCount(-count);

Added: branches/faster/src/org/griphyn/vdl/karajan/lib/SetDatasetValues.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/SetDatasetValues.java	                        (rev 0)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/SetDatasetValues.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2012 University of Chicago
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+ * Created on Jul 18, 2010
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.util.Collection;
+import java.util.List;
+
+import k.rt.ExecutionException;
+import k.rt.Stack;
+
+import org.globus.cog.karajan.analyzer.ArgRef;
+import org.globus.cog.karajan.analyzer.Signature;
+import org.griphyn.vdl.mapping.AbstractDataNode;
+import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.Path;
+
+public class SetDatasetValues extends SwiftFunction {
+    private ArgRef<List<List<Object>>> stageouts;
+    
+    @Override
+    protected Signature getSignature() {
+        return new Signature(params("stageouts"));
+    }
+
+    @Override
+    public Object function(Stack stack) {
+        Collection<List<Object>> files = this.stageouts.getValue(stack);
+        try {
+            for (List<Object> pv : files) {
+                Path p = parsePath(pv.get(0));
+                DSHandle handle = (DSHandle) pv.get(1);
+                DSHandle leaf = handle.getField(p);
+                leaf.setValue(AbstractDataNode.FILE_VALUE);
+            }
+        }
+        catch (Exception e) {
+            throw new ExecutionException(this, e);
+        }
+        return null;
+    }
+}

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -238,18 +238,17 @@
                 fname = fni.next();
                 se.value(fname);
             }
-            Path fpath = Path.EMPTY_PATH.addFirst(fname);
             try {
-                DSHandle dstf = dest.getField(fpath);
+                DSHandle dstf = dest.getField(fname);
                 try {
-                    DSHandle srcf = source.getField(fpath);
+                    DSHandle srcf = source.getField(fname);
                     deepCopy(dstf, srcf, state, level + 1);
                 }
-                catch (InvalidPathException e) {
+                catch (NoSuchFieldException e) {
                     // do nothing. It's an unused field in the source.
                 }
             }
-            catch (InvalidPathException e) {
+            catch (NoSuchFieldException e) {
                 throw new ExecutionException("Internal type inconsistency detected. " + 
                     dest + " claims not to have a " + fname + " field");
             }
@@ -330,13 +329,12 @@
             }
             Comparable<?> lhs = (Comparable<?>) pair.get(0);
             DSHandle rhs = (DSHandle) pair.get(1);
-            Path memberPath = Path.EMPTY_PATH.addLast(lhs, true);
             
             DSHandle field;
             try {
-                field = dest.getField(memberPath);
+                field = dest.getField(lhs);
             }
-            catch (InvalidPathException ipe) {
+            catch (NoSuchFieldException ipe) {
                 throw new ExecutionException("Could not get destination field",ipe);
             }
             deepCopy(field, rhs, state, level + 1);

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/SliceArray.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/SliceArray.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/SliceArray.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -87,12 +87,10 @@
     		for (List<?> pair : s) {
     			Object index = pair.get(0);
     			DSHandle sourceElement = (DSHandle) pair.get(1);
-    
-    			Path p = Path.EMPTY_PATH.addLast((Comparable<?>) index, true);
-    
+        
     			DSHandle n = sourceElement.getField(cutPath);
     
-    			destinationArray.getField(p).set(n);
+    			destinationArray.getField((Comparable<?>) index).set(n);
     		}
     
     		// all of the inputs should be closed, so
@@ -124,8 +122,11 @@
 		catch(NoSuchTypeException nste) {
 			throw new ExecutionException("No such type",nste);
 		}
-		catch (InvalidPathException e) {
+		catch (NoSuchFieldException e) {
 			throw new ExecutionException(this, e);
 		}
+		catch (InvalidPathException e) {
+            throw new ExecutionException(this, e);
+        }
 	}
 }

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -38,8 +38,6 @@
 import org.griphyn.vdl.mapping.AbsFile;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
-import org.griphyn.vdl.mapping.InvalidPathException;
-import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.mapping.RootArrayDataNode;
 import org.griphyn.vdl.mapping.RootDataNode;
 import org.griphyn.vdl.type.Types;
@@ -295,10 +293,10 @@
             for (int i = 0; i < split.length; i++) {
                 DSHandle el;
                 try {
-                    el = handle.getField(Path.EMPTY_PATH.addFirst(i, true));
+                    el = handle.getField(i);
                     el.setValue(split[i]);
                 }
-                catch (InvalidPathException e) {
+                catch (NoSuchFieldException e) {
                     throw new ExecutionException(this, e);
                 }
             }

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -38,8 +38,6 @@
 import org.griphyn.vdl.mapping.AbsFile;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
-import org.griphyn.vdl.mapping.InvalidPathException;
-import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.mapping.PhysicalFormat;
 import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.type.Types;
@@ -140,13 +138,13 @@
 		String line = br.readLine();
 		try {
 			while (line != null) {
-				DSHandle child = dest.getField(Path.EMPTY_PATH.addLast(index, true));
+				DSHandle child = dest.getField(index);
 				setValue(child, line);
 				line = br.readLine();
 				index++;
 			}
 		}
-		catch (InvalidPathException e) {
+		catch (NoSuchFieldException e) {
 			throw new ExecutionException(this, e);
 		}
 	}
@@ -160,14 +158,14 @@
 			while (line != null) {
 				line = line.trim();
 				if (!line.equals("")) {
-					DSHandle child = dest.getField(Path.EMPTY_PATH.addLast(index, true));
+					DSHandle child = dest.getField(index);
 					readStruct(child, line, header);
 					index++;
 				}
 				line = br.readLine();
 			}
 		}
-		catch (InvalidPathException e) {
+		catch (NoSuchFieldException e) {
 			throw new ExecutionException(this, e);
 		}
 	}
@@ -205,12 +203,12 @@
 			else {
 
 				for (int i = 0; i < cols.length; i++) {
-					DSHandle child = dest.getField(Path.EMPTY_PATH.addLast(header[i]));
+					DSHandle child = dest.getField(header[i]);
 					setValue(child, cols[i]);
 				}
 			}
 		}
-		catch (InvalidPathException e) {
+		catch (NoSuchFieldException e) {
 			throw new ExecutionException(this, e);
 		}
 	}

Modified: branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -36,6 +36,7 @@
 import org.globus.cog.karajan.compiled.nodes.Node;
 import org.globus.cog.karajan.futures.FutureNotYetAvailable;
 import org.griphyn.vdl.karajan.Loader;
+import org.griphyn.vdl.karajan.WaitingThreadsMonitor;
 import org.griphyn.vdl.type.Field;
 import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.util.VDL2Config;
@@ -43,6 +44,7 @@
 
 
 public abstract class AbstractDataNode implements DSHandle, FutureValue {
+    public static final Object FILE_VALUE = new Object();
 
     static final String DATASET_URI_PREFIX = "dataset:";
 
@@ -132,6 +134,8 @@
     protected Field getField() {
         return field;
     }
+    
+    protected abstract AbstractDataNode getParentNode();
 
     /**
      * create a String representation of this node. If the node has a value,
@@ -311,8 +315,7 @@
         handles.put(id, handle);
     }
 
-    protected synchronized DSHandle getField(Comparable<?> key)
-        throws NoSuchFieldException {
+    public synchronized DSHandle getField(Comparable<?> key) throws NoSuchFieldException {
         DSHandle handle = handles.get(key);
         if (handle == null) {
             if (closed) {
@@ -327,8 +330,7 @@
         return handles.isEmpty();
     }
 
-    public DSHandle createField(Comparable<?> key)
-    throws NoSuchFieldException {
+    public DSHandle createField(Comparable<?> key) throws NoSuchFieldException {
         if (closed) {
             throw new RuntimeException("Cannot write to closed handle: " + this + " (" + key + ")");
         }
@@ -336,6 +338,19 @@
         return addHandle(key, newNode(getChildField(key)));
     }
     
+    @Override
+    public DSHandle createField(Path path) throws InvalidPathException {
+        if (path.size() != 1) {
+            throw new InvalidPathException("Expected a path of size 1: " + path);
+        }
+        try {
+            return createField(path.getFirst());
+        }
+        catch (NoSuchFieldException e) {
+            throw new InvalidPathException("Invalid path (" + path + ") for " + this);
+        }
+    }
+
     protected synchronized DSHandle addHandle(Comparable<?> id, DSHandle handle) {
         Object o = handles.put(id, handle);
         if (o != null) {
@@ -384,6 +399,7 @@
     }
 
     public Object getValue() {
+        checkNoValue();
         checkDataException();
         if (field.getType().isArray()) {
             return handles;
@@ -637,6 +653,7 @@
             if (logger.isDebugEnabled()) {
                 logger.debug("Do not need to wait for " + this);
             }
+            checkNoValue();
             if (value instanceof RuntimeException) {
                 throw (RuntimeException) value;
             }
@@ -655,18 +672,36 @@
             if (logger.isDebugEnabled()) {
                 logger.debug("Do not need to wait for " + this);
             }
+            checkNoValue();
             if (value instanceof RuntimeException) {
                 throw (RuntimeException) value;
             }
         }
     }
     
+    protected void checkNoValue() {
+        if (value == null) {
+            if (getType().isComposite()) {
+                // composite types (arrays, structs) don't usually have a value
+                return;
+            }
+            AbstractDataNode parent = getParentNode();
+            if (parent != null && parent.getType().isArray()) {
+                throw new IndexOutOfBoundsException("Invalid index [" + field.getId() + "] for " + parent.getDisplayableName());
+            }
+            else {
+                throw new RuntimeException(getDisplayableName() + " has no value");
+            }
+        }
+    }
+
     public void addListener(DSHandleListener listener) {
         throw new UnsupportedOperationException();
     }
     
     public void addListener(FutureListener l) {
     	boolean closed;
+    	WaitingThreadsMonitor.addThread(l, this);
     	synchronized(this) {
         	if (this.listeners == null) {
         		this.listeners = new ArrayList<FutureListener>();
@@ -688,6 +723,7 @@
     	if (l != null) {
     		for (FutureListener ll : l) {
     			ll.futureUpdated(this);
+    			WaitingThreadsMonitor.removeThread(ll);
     		}
     	}
     }

Modified: branches/faster/src/org/griphyn/vdl/mapping/ArrayDataNode.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/ArrayDataNode.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/ArrayDataNode.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -27,10 +27,11 @@
 import org.globus.cog.karajan.futures.FutureNotYetAvailable;
 import org.griphyn.vdl.type.Field;
 
-public class ArrayDataNode extends DataNode {
+public class ArrayDataNode extends DataNode { 
+    
 	private List<Comparable<?>> keyList;
 	
-	protected ArrayDataNode(Field field, DSHandle root, DSHandle parent) {
+	protected ArrayDataNode(Field field, DSHandle root, AbstractDataNode parent) {
 		super(field, root, parent);
 	}
 	
@@ -151,4 +152,11 @@
             }
         }
     }
+
+    @Override
+    protected void checkNoValue() {
+        // lack of a value in an array node does not indicate an error
+    }
+    
+    
 }

Modified: branches/faster/src/org/griphyn/vdl/mapping/DSHandle.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/DSHandle.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/DSHandle.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -54,9 +54,13 @@
     public DSHandle getParent();
 
     /** returns the field below this node that is referred to by the
-     *  supplied path. The path must have no wildcards.
+     *  supplied path. The path must have no wildcards. If at any point
+     *  in the path the field does not exist and the parent to that field is
+     *  closed, an InvalidPathException will be thrown.
      */
     public DSHandle getField(Path path) throws InvalidPathException;
+    
+    public DSHandle getField(Comparable<?> key) throws NoSuchFieldException;
 
     /** returns a collection of fields below this node that are referred to
      *  by the supplied path. The path may contain wildcards. If it does not,
@@ -74,6 +78,8 @@
     /** create a new logical component */
     public DSHandle createField(Comparable<?> key) throws NoSuchFieldException;
  
+    public DSHandle createField(Path path) throws InvalidPathException;
+ 
     // special file oriented methods, not sure if these apply to 
     // all datasets
 

Modified: branches/faster/src/org/griphyn/vdl/mapping/DataNode.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/DataNode.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/DataNode.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -25,9 +25,9 @@
 
 public class DataNode extends AbstractDataNode {
 	private DSHandle root;
-	private DSHandle parent;
+	private AbstractDataNode parent;
 	
-	protected DataNode(Field field, DSHandle root, DSHandle parent) {
+	protected DataNode(Field field, DSHandle root, AbstractDataNode parent) {
 		super(field);
 		if (parent != null && field.getId() == null) {
 		    throw new IllegalArgumentException("Internal error: field id is null");
@@ -44,7 +44,11 @@
 		return parent;
 	}
 	
-	public void setParent(DSHandle parent) {
+	public AbstractDataNode getParentNode() {
+        return parent;
+    }
+	
+	public void setParent(AbstractDataNode parent) {
 		this.parent = parent;
 	}
 

Modified: branches/faster/src/org/griphyn/vdl/mapping/ExternalDataNode.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/ExternalDataNode.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/ExternalDataNode.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -113,6 +113,11 @@
 	    return null;
 	}
 
+    @Override
+    protected AbstractDataNode getParentNode() {
+        return null;
+    }
+
     public String getParam(MappingParam p) {
         if (params == null) {
             return null;

Modified: branches/faster/src/org/griphyn/vdl/mapping/OpenArrayEntries.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/OpenArrayEntries.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/OpenArrayEntries.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -56,7 +56,7 @@
                 synchronized(source) {
                     if (index < keyList.size()) {
                         Comparable<?> key = keyList.get(index++);
-                        return new Pair(key, array.get(key));
+                        return new Pair<Object>(key, array.get(key));
                     }
                     else {
                         if (source.isClosed()) {

Modified: branches/faster/src/org/griphyn/vdl/mapping/RootDataNode.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/RootDataNode.java	2013-03-19 00:28:44 UTC (rev 6398)
+++ branches/faster/src/org/griphyn/vdl/mapping/RootDataNode.java	2013-03-19 00:35:30 UTC (rev 6399)
@@ -175,7 +175,7 @@
 		for (Path p : mapper.existing()) {
             try {
                 DSHandle field = root.getField(p);
-                field.closeShallow();
+                field.setValue(FILE_VALUE);
                 if (tracer.isEnabled()) {
                     tracer.trace(root.getThread(), root.getDeclarationLine(), 
                         root.getDisplayableName() + " MAPPING " + p + ", " + mapper.map(p));
@@ -252,7 +252,12 @@
 		return null;
 	}
 
-	public synchronized Mapper getMapper() {
+	@Override
+    protected AbstractDataNode getParentNode() {
+        return null;
+    }
+
+    public synchronized Mapper getMapper() {
 		if (initialized) {
 			return mapper;
 		}




More information about the Swift-commit mailing list