@Override protected void writeBlobToHDFS(String fname,String ofmt,int rep,FileFormatProperties fprop) throws IOException, DMLRuntimeException {
  long begin=0;
  if (LOG.isTraceEnabled()) {
    LOG.trace(" Writing matrix to HDFS...  " + getVarName() + "  Path: "+ fname+ ", Format: "+ (ofmt != null ? ofmt : "inferred from metadata"));
    begin=System.currentTimeMillis();
  }
  MatrixFormatMetaData iimd=(MatrixFormatMetaData)_metaData;
  if (_data != null) {
    MatrixCharacteristics mc=iimd.getMatrixCharacteristics();
    OutputInfo oinfo=(ofmt != null ? OutputInfo.stringToOutputInfo(ofmt) : InputInfo.getMatchingOutputInfo(iimd.getInputInfo()));
    if (oinfo == OutputInfo.BinaryBlockOutputInfo && DMLScript.rtplatform == RUNTIME_PLATFORM.SINGLE_NODE && (mc.getRowsPerBlock() != ConfigurationManager.getBlocksize() || mc.getColsPerBlock() != ConfigurationManager.getBlocksize())) {
      DataConverter.writeMatrixToHDFS(_data,fname,oinfo,new MatrixCharacteristics(mc.getRows(),mc.getCols(),ConfigurationManager.getBlocksize(),ConfigurationManager.getBlocksize(),mc.getNonZeros()),rep,fprop);
    }
 else {
      DataConverter.writeMatrixToHDFS(_data,fname,oinfo,mc,rep,fprop);
    }
    if (LOG.isTraceEnabled())     LOG.trace("Writing matrix to HDFS (" + fname + ") - COMPLETED... "+ (System.currentTimeMillis() - begin)+ " msec.");
  }
 else   if (LOG.isTraceEnabled()) {
    LOG.trace("Writing matrix to HDFS (" + fname + ") - NOTHING TO WRITE (_data == null).");
  }
  if (DMLScript.STATISTICS)   CacheStatistics.incrementHDFSWrites();
}

@ Override protected void writeBlobToHDFS ( String fname , String ofmt , int rep , FileFormatProperties fprop ) throws IOException , DMLRuntimeException { long begin = 0 ; if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( " Writing matrix to HDFS...  " + getVarName ( ) + "  Path: " + fname + ", Format: " + ( ofmt != null ? ofmt : "inferred from metadata" ) ) ; begin = System . currentTimeMillis ( ) ; } MatrixFormatMetaData iimd = ( MatrixFormatMetaData ) _metaData ; if ( _data != null ) { MatrixCharacteristics mc = iimd . getMatrixCharacteristics ( ) ; OutputInfo oinfo = ( ofmt != null ? OutputInfo . stringToOutputInfo ( ofmt ) : InputInfo . getMatchingOutputInfo ( iimd . getInputInfo ( ) ) ) ; if ( oinfo == OutputInfo . BinaryBlockOutputInfo && DMLScript . rtplatform == RUNTIME_PLATFORM . SINGLE_NODE && ( mc . getRowsPerBlock ( ) != ConfigurationManager . getBlocksize ( ) || mc . getColsPerBlock ( ) != ConfigurationManager . getBlocksize ( ) ) ) { DataConverter . writeMatrixToHDFS ( _data , fname , oinfo , new MatrixCharacteristics ( mc . getRows ( ) , mc . getCols ( ) , ConfigurationManager . getBlocksize ( ) , ConfigurationManager . getBlocksize ( ) , mc . getNonZeros ( ) ) , rep , fprop ) ; } else { DataConverter . writeMatrixToHDFS ( _data , fname , oinfo , mc , rep , fprop ) ; } if ( LOG . isTraceEnabled ( ) ) LOG . trace ( "Writing matrix to HDFS (" + fname + ") - COMPLETED... " + ( System . currentTimeMillis ( ) - begin ) + " msec." ) ; } else if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "Writing matrix to HDFS (" + fname + ") - NOTHING TO WRITE (_data == null)." ) ; } if ( DMLScript . STATISTICS ) CacheStatistics . incrementHDFSWrites ( ) ; }
writes in - memory matrix to hdfs in a specified format .
