Package com.cloudera.kitten.util

Examples of com.cloudera.kitten.util.LocalDataHelper


    extras.putEnv(LuaFields.KITTEN_LOCAL_FILE_TO_URI, LocalDataHelper.serialize(localToUris));
    return new LuaContainerLaunchParameters(env.getTable(LuaFields.MASTER), conf, localToUris, extras);
  }

  private Map<String, URI> mapLocalFiles(ApplicationId applicationId) {
    LocalDataHelper lfh = new LocalDataHelper(applicationId, conf);
   
    // Map the configuration object as an XML file.
    try {
      lfh.copyConfiguration(LuaFields.KITTEN_JOB_XML_FILE, conf);
    } catch (IOException e) {
      LOG.error("Error copying configuration object", e);
    }
   
    // Map the files that were specified by the framework itself.
    for (String localFileName : extras.getResources().values()) {
      try {
        lfh.copyToHdfs(localFileName);
      } catch (IOException e) {
        LOG.error("Error copying local file " + localFileName + " to hdfs", e);
      }
    }
   
    // Map all of the local files that the appmaster will need.
    mapLocalFiles(env.getTable(LuaFields.MASTER), lfh);
   
    // Map all of the files that the containers will need.  
    if (!env.isNil(LuaFields.CONTAINERS)) {
      Iterator<LuaPair> iter = env.getTable(LuaFields.CONTAINERS).arrayIterator();
      while (iter.hasNext()) {
        mapLocalFiles(new LuaWrapper(iter.next().value.checktable()), lfh);
      }
    } else if (!env.isNil(LuaFields.CONTAINER)) {
      mapLocalFiles(env.getTable(LuaFields.CONTAINER), lfh);
    }
    return lfh.getFileMapping();
  }
View Full Code Here

TOP

Related Classes of com.cloudera.kitten.util.LocalDataHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.