Examples of HDataStorage


Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

public class TypeCheckingTestUtil {

    public static LOLoad genDummyLOLoad(LogicalPlan plan)  {
        String pigStorage = PigStorage.class.getName() ;
        DataStorage dfs = new HDataStorage(new Properties());
        try {
            LOLoad load = new LOLoad(plan,
                                      genNewOperatorKey(),
                                      new FileSpec("pi", new FuncSpec(pigStorage)),
                                      null, dfs, true) ;
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        String pigStorage = PigStorage.class.getName() ;

        LOLoad load1 = new LOLoad(plan,
                                  genNewOperatorKey(),
                                  new FileSpec("pi", new FuncSpec(pigStorage)),
                                  null, new HDataStorage(new Properties()), true) ;

        // set schemas
        load1.setEnforcedSchema(null) ;

        // Create inner plan
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        String pigStorage = PigStorage.class.getName() ;

        LOLoad load1 = new LOLoad(plan,
                                  genNewOperatorKey(),
                                  new FileSpec("pi", new FuncSpec(pigStorage)),
                                  null, new HDataStorage(new Properties()), true) ;

        // set schemas
        load1.setEnforcedSchema(null) ;

        // Create inner plan
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        // working dir to /user/<userid>
        if(pigContext.getExecType() == ExecType.MAPREDUCE) {
            fs.setWorkingDirectory(new Path("/user", job.getUser()));
                }
       
        DataStorage store = new HDataStorage(ConfigurationUtil.toProperties(job));
       
        // Pass loader signature to slicer
          List<String> inpSignatureLists = (ArrayList<String>)ObjectSerializer.deserialize(job.get("pig.inpSignatures"));
                if (inpSignatureLists.get(i)!=null)
                    store.getConfiguration().setProperty("pig.loader.signature", inpSignatureLists.get(i));

        ValidatingInputFileSpec spec;
        if (inputs.get(i).first instanceof ValidatingInputFileSpec) {
            spec = (ValidatingInputFileSpec) inputs.get(i).first;
        } else {
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

    public void connect() throws ExecException {

        switch (execType) {
            case LOCAL:
            {
                lfs = new HDataStorage(URI.create("file:///"),
                                       new Properties());
               
                dfs = lfs;
                executionEngine = new LocalExecutionEngine(this);
            }
            break;

            case MAPREDUCE:
            {
                executionEngine = new HExecutionEngine (this);

                executionEngine.init();
               
                dfs = executionEngine.getDataStorage();
               
                lfs = new HDataStorage(URI.create("file:///"),
                                        new Properties());               
            }
            break;
           
            default:
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        return openDFSFile(fileName, ConfigurationUtil.toProperties(conf));

    }

    public static InputStream openDFSFile(String fileName, Properties properties) throws IOException{
        DataStorage dds = new HDataStorage(properties);
        ElementDescriptor elem = dds.asElement(fileName);
        return openDFSFile(elem);
    }
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        return getSize(fileName, ConfigurationUtil.toProperties(conf));
    }
   
    public static long getSize(String fileName, Properties properties) throws IOException {
      DataStorage dds = new HDataStorage(properties);
        ElementDescriptor elem = dds.asElement(fileName);
      
        // recursively get all the files under this path
        ElementDescriptor[] allElems = getFileElementDescriptors(elem);
       
        long size = 0;
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

    }

    @SuppressWarnings("unchecked")
    public RecordReader<Text, Tuple> makeReader(JobConf job) throws IOException {
        lastConf = job;       
        DataStorage store = new HDataStorage(ConfigurationUtil.toProperties(job));
        // if the execution is against Mapred DFS, set
        // working dir to /user/<userid>
        if(execType == ExecType.MAPREDUCE)
            store.setActiveContainer(store.asContainer("/user/" + job.getUser()));
        PigContext.setPackageImportList((ArrayList<String>)ObjectSerializer.deserialize(job.get("udf.import.list")));
        List<String> inpSignatureLists = (ArrayList<String>)ObjectSerializer.deserialize(job.get("pig.inpSignatures"));
        if (inpSignatureLists.get(index)!=null) {
            // Pass loader signature to slice
            store.getConfiguration().setProperty("pig.loader.signature", inpSignatureLists.get(index));
            job.set("pig.loader.signature", inpSignatureLists.get(index));
        }
       
        // Get the UDF specific context
        UDFContext udfc = UDFContext.getUDFContext();
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        return openDFSFile(fileName, ConfigurationUtil.toProperties(conf));

    }

    public static InputStream openDFSFile(String fileName, Properties properties) throws IOException{
        DataStorage dds = new HDataStorage(properties);
        ElementDescriptor elem = dds.asElement(fileName);
        return openDFSFile(elem);
    }
View Full Code Here

Examples of org.apache.pig.backend.hadoop.datastorage.HDataStorage

        return getSize(fileName, ConfigurationUtil.toProperties(conf));
    }
   
    public static long getSize(String fileName, Properties properties) throws IOException {
      DataStorage dds = new HDataStorage(properties);
        ElementDescriptor elem = dds.asElement(fileName);
      
        // recursively get all the files under this path
        ElementDescriptor[] allElems = getFileElementDescriptors(elem);
       
        long size = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.