[SYSTEMML-927] Fix cp write frame (schema handling on export)

Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/80a72d7c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/80a72d7c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/80a72d7c

Branch: refs/heads/master
Commit: 80a72d7c01888141aacd5172c53ae3bd654d30dc
Parents: 0750f35
Author: Matthias Boehm <mbo...@us.ibm.com>
Authored: Wed Sep 21 15:18:36 2016 -0700
Committer: Matthias Boehm <mbo...@us.ibm.com>
Committed: Wed Sep 21 15:18:36 2016 -0700

----------------------------------------------------------------------
 .../runtime/controlprogram/caching/CacheableData.java     | 10 +++++++++-
 .../sysml/runtime/controlprogram/caching/FrameObject.java |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/80a72d7c/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
 
b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
index 9a136cd..3e2f6c1 100644
--- 
a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
+++ 
b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
@@ -22,6 +22,7 @@ package org.apache.sysml.runtime.controlprogram.caching;
 import java.io.File;
 import java.io.IOException;
 import java.lang.ref.SoftReference;
+import java.util.List;
 
 import org.apache.commons.lang.mutable.MutableBoolean;
 import org.apache.commons.logging.Log;
@@ -972,6 +973,10 @@ public abstract class CacheableData<T extends CacheBlock> 
extends Data
                return (_data.getInMemorySize() <= CACHING_THRESHOLD);
        }
        
+       protected List<ValueType> getSchema() {
+               return null;
+       }
+       
        /**
         * 
         */
@@ -1074,7 +1079,10 @@ public abstract class CacheableData<T extends 
CacheBlock> extends Data
                        {
                                mc = new MatrixCharacteristics(mc.getRows(), 
mc.getCols(), ConfigurationManager.getBlocksize(), 
ConfigurationManager.getBlocksize(), mc.getNonZeros());
                        }
-                       MapReduceTool.writeMetaDataFile (filePathAndName + 
".mtd", valueType, null, dataType, mc, oinfo, formatProperties);
+                       
+                       //write the actual meta data file
+                       MapReduceTool.writeMetaDataFile (filePathAndName + 
".mtd", valueType, 
+                                       getSchema(), dataType, mc, oinfo, 
formatProperties);
                }
        }
        

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/80a72d7c/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
 
b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
index bfccdf1..1209064 100644
--- 
a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
+++ 
b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
@@ -87,6 +87,7 @@ public class FrameObject extends CacheableData<FrameBlock>
                super(fo);
        }
        
+       @Override
        public List<ValueType> getSchema() {
                return _schema;
        }

Reply via email to