Package org.apache.pig.backend.datastorage

Examples of org.apache.pig.backend.datastorage.ContainerDescriptor


        pigContext.rename(source, target);
        return true;
    }
   
    public boolean mkdirs(String dirs) throws IOException {
        ContainerDescriptor container = pigContext.getDfs().asContainer(dirs);
        container.create();
        return true;
    }
View Full Code Here


        return true;
    }
   
    public String[] listPaths(String dir) throws IOException {
        Collection<String> allPaths = new ArrayList<String>();
        ContainerDescriptor container = pigContext.getDfs().asContainer(dir);
        Iterator<ElementDescriptor> iter = container.iterator();
           
        while (iter.hasNext()) {
            ElementDescriptor elem = iter.next();
            allPaths.add(elem.toString());
        }
View Full Code Here

                sb.append(" does not exist.");
                throw new IOException(sb.toString());
            }
   
            if (mDfs.isContainer(path)) {
                ContainerDescriptor dfsDir = (ContainerDescriptor) dfsPath;
                Iterator<ElementDescriptor> paths = dfsDir.iterator();
               
                while (paths.hasNext()) {
                    ElementDescriptor curElem = paths.next();
                   
                    if (mDfs.isContainer(curElem.toString())) {
View Full Code Here

        }
    }

    protected void processCD(String path) throws IOException
    {   
        ContainerDescriptor container;

        try {
            if (path == null) {
                container = mDfs.asContainer("/user/" + System.getProperty("user.name"));
                mDfs.setActiveContainer(container);
            }
            else
            {
                container = mDfs.asContainer(path);
   
                if (!container.exists()) {
                    StringBuilder sb = new StringBuilder();
                    sb.append("Directory ");
                    sb.append(path);
                    sb.append(" does not exist.");
                    throw new IOException(sb.toString());
View Full Code Here

                sb.append(" does not exist.");
                throw new IOException(sb.toString());
            }
           
            if (mDfs.isContainer(pathDescriptor.toString())) {
                ContainerDescriptor container = (ContainerDescriptor) pathDescriptor;
                Iterator<ElementDescriptor> elems = container.iterator();
               
                while (elems.hasNext()) {
                    ElementDescriptor curElem = elems.next();
                   
                    if (mDfs.isContainer(curElem.toString())) {
View Full Code Here

        }
    }
   
    protected void processMkdir(String dir) throws IOException
    {
        ContainerDescriptor dirDescriptor = mDfs.asContainer(dir);
        dirDescriptor.create();
    }
View Full Code Here

        try {
            while (elems.hasNext()) {
                ElementDescriptor curElem = elems.next();
              
                if (curElem instanceof ContainerDescriptor) {
                    ContainerDescriptor dst =
                        dstName.getDataStorage().asContainer(dstName,
                                                             ((LocalPath)curElem).getPath().getName());
                      
                    curElem.copy(dst, dstConfiguration, removeSrc);
                      
View Full Code Here

     * @param dirs directory to make
     * @return true
     * @throws IOException
     */
    public boolean mkdirs(String dirs) throws IOException {
        ContainerDescriptor container = pigContext.getDfs().asContainer(dirs);
        container.create();
        return true;
    }
View Full Code Here

     * @return array of strings, one for each file name
     * @throws IOException
     */
    public String[] listPaths(String dir) throws IOException {
        Collection<String> allPaths = new ArrayList<String>();
        ContainerDescriptor container = pigContext.getDfs().asContainer(dir);
        Iterator<ElementDescriptor> iter = container.iterator();

        while (iter.hasNext()) {
            ElementDescriptor elem = iter.next();
            allPaths.add(elem.toString());
        }
View Full Code Here

        lp.connect( input, store );
    }

    static Path getCurrentDir(PigContext pigContext) throws IOException {
        DataStorage dfs = pigContext.getDfs();
        ContainerDescriptor desc = dfs.getActiveContainer();
        ElementDescriptor el = dfs.asElement(desc);
        return new Path(el.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.datastorage.ContainerDescriptor

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.