Package org.apache.pig

Examples of org.apache.pig.PigServer.deleteFile()


        pig.registerQuery("A = LOAD 'file:" + Util.encodeEscape(tmpFile.getAbsolutePath().toString()) + "' USING "
                        + DummyLoadFunc.class.getName() + "();");

        String file1 = "/tmp/testPigOutput" ;
        if (pig.existsFile(file1)) {
            pig.deleteFile(file1) ;
        }
       
        pig.store("A", file1, DummyStoreFunc.class.getName() + "()");
       
        String file2 = "/tmp/testPigOutput2" ;
View Full Code Here


       
        pig.store("A", file1, DummyStoreFunc.class.getName() + "()");
       
        String file2 = "/tmp/testPigOutput2" ;
        if (pig.existsFile(file2)) {
            pig.deleteFile(file2) ;
        }
        pig.store("A", file2, DummyStoreFunc.class.getName() + "()");
       
        // for this test the plan will not be reused so:-
        // - initial temp file has to be read 10 times
View Full Code Here

        // - DummyLoadStoreFunc has to be written 10 times
       
        assertEquals(10, DummyLoadFunc.readCounterMap.get("file:"+tmpFile.getAbsolutePath()).intValue()) ;
        assertEquals(10, DummyStoreFunc.writeCounter) ;
       
        pig.deleteFile(file1) ;
        pig.deleteFile(file2) ;
       
    }
   
    public void testReuse() throws Exception {
View Full Code Here

       
        assertEquals(10, DummyLoadFunc.readCounterMap.get("file:"+tmpFile.getAbsolutePath()).intValue()) ;
        assertEquals(10, DummyStoreFunc.writeCounter) ;
       
        pig.deleteFile(file1) ;
        pig.deleteFile(file2) ;
       
    }
   
    public void testReuse() throws Exception {
       
View Full Code Here

        pig.registerQuery("A = LOAD 'file:" + Util.encodeEscape(tmpFile.getAbsolutePath().toString()) + "' USING "
                        + DummyLoadStoreFunc.class.getName() + "();");

        String file1 = "/tmp/testPigOutput" ;
        if (pig.existsFile(file1)) {
            pig.deleteFile(file1) ;
        }
       
        pig.store("A", file1, DummyLoadStoreFunc.class.getName() + "()");
       
        String file2 = "/tmp/testPigOutput2" ;
View Full Code Here

       
        pig.store("A", file1, DummyLoadStoreFunc.class.getName() + "()");
       
        String file2 = "/tmp/testPigOutput2" ;
        if (pig.existsFile(file2)) {
            pig.deleteFile(file2) ;
        }
        pig.store("A", file2, DummyLoadStoreFunc.class.getName() + "()");
       
        // for this test the plan will be reused so:-
        // - initial temp file has to be read 5 times
View Full Code Here

        assertEquals(5, DummyLoadStoreFunc.readCounterMap.get("file:"+tmpFile.getAbsolutePath()).intValue()) ;
        assertEquals(5, DummyLoadStoreFunc.readCounterMap.get("/tmp/testPigOutput").intValue()) ;
        assertEquals(10, DummyLoadStoreFunc.writeCounter) ;
       
       
        pig.deleteFile(file1) ;
        pig.deleteFile(file2) ;
       
    }
   
    private File createTempFile() throws Exception {
View Full Code Here

        assertEquals(5, DummyLoadStoreFunc.readCounterMap.get("/tmp/testPigOutput").intValue()) ;
        assertEquals(10, DummyLoadStoreFunc.writeCounter) ;
       
       
        pig.deleteFile(file1) ;
        pig.deleteFile(file2) ;
       
    }
   
    private File createTempFile() throws Exception {
        File tmpFile =  File.createTempFile("test", ".txt");
View Full Code Here

    @Test(expected = FrontendException.class)
    public void testBlacklistRemoveWithPigServer() throws Exception {
        ctx.getProperties().setProperty(PigConfiguration.PIG_BLACKLIST, "rm");
        PigServer pigServer = new PigServer(ctx);

        pigServer.deleteFile("foo");
    }

    /**
     * Test mkdirs fails if its disallowed via the blacklist
     */
 
View Full Code Here

     */
    @Test
    public void testBzipInPig() throws Exception {
        PigServer pig = new PigServer(MAPREDUCE);
        try {
            pig.deleteFile("junit-out.bz");
        } catch (Exception e) {
        }
        File in = File.createTempFile("junit", ".bz");
        in.deleteOnExit();
        File out = File.createTempFile("junit", ".bz");
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.