Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FileSystem.create()


        fs.create(new Path(testPath, "1_0_0.data"));
        fs.create(new Path(testPath, "1_0"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 1);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 0).length, 1);

        fs.create(new Path(testPath, "1_0_1.data"));
        fs.create(new Path(testPath, "1_0_1data"));
        fs.create(new Path(testPath, "1_0_1.index"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 2);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 1).length, 1);
View Full Code Here


        fs.create(new Path(testPath, "1_0"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 1);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 0).length, 1);

        fs.create(new Path(testPath, "1_0_1.data"));
        fs.create(new Path(testPath, "1_0_1data"));
        fs.create(new Path(testPath, "1_0_1.index"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 2);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 1).length, 1);

        fs.create(new Path(testPath, "1_0_2.data"));
View Full Code Here

        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 1);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 0).length, 1);

        fs.create(new Path(testPath, "1_0_1.data"));
        fs.create(new Path(testPath, "1_0_1data"));
        fs.create(new Path(testPath, "1_0_1.index"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 2);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 1).length, 1);

        fs.create(new Path(testPath, "1_0_2.data"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 3);
View Full Code Here

        fs.create(new Path(testPath, "1_0_1data"));
        fs.create(new Path(testPath, "1_0_1.index"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 2);
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0, 1).length, 1);

        fs.create(new Path(testPath, "1_0_2.data"));
        assertEquals(HadoopStoreBuilderUtils.getDataChunkFiles(fs, testPath, 1, 0).length, 3);
    }

    @Test
    public void testGetDataFileChunkSet() throws IOException {
View Full Code Here

        Path testPath = new Path(headPath, "0_0_100.data");
        Path junkPath = new Path(headPath, "1_1_100.data");
        FileSystem fs = testPath.getFileSystem(new Configuration());

        // 1) Just one correct file
        fs.create(testPath);
        fs.create(junkPath);
        writeRandomData(testPath, 100);
        DataFileChunkSet set = HadoopStoreBuilderUtils.getDataFileChunkSet(fs,
                                                                           HadoopStoreBuilderUtils.getDataChunkFiles(fs,
                                                                                                                     headPath,
View Full Code Here

        Path junkPath = new Path(headPath, "1_1_100.data");
        FileSystem fs = testPath.getFileSystem(new Configuration());

        // 1) Just one correct file
        fs.create(testPath);
        fs.create(junkPath);
        writeRandomData(testPath, 100);
        DataFileChunkSet set = HadoopStoreBuilderUtils.getDataFileChunkSet(fs,
                                                                           HadoopStoreBuilderUtils.getDataChunkFiles(fs,
                                                                                                                     headPath,
                                                                                                                     0,
View Full Code Here

        assertEquals(set.getNumChunks(), 1);
        assertEquals(set.getDataFileSize(0), 100);

        // 2) Another correct file
        testPath = new Path(headPath, "0_0_99.data");
        fs.create(testPath);
        writeRandomData(testPath, 99);
        set = HadoopStoreBuilderUtils.getDataFileChunkSet(fs,
                                                          HadoopStoreBuilderUtils.getDataChunkFiles(fs,
                                                                                                    headPath,
                                                                                                    0,
View Full Code Here

        assertEquals(set.getDataFileSize(0), 99);
        assertEquals(set.getDataFileSize(1), 100);

        // 3) Add some more files
        testPath = new Path(headPath, "0_0_1.data");
        fs.create(testPath);
        writeRandomData(testPath, 1);

        testPath = new Path(headPath, "0_0_10.data");
        fs.create(testPath);
        writeRandomData(testPath, 10);
View Full Code Here

        testPath = new Path(headPath, "0_0_1.data");
        fs.create(testPath);
        writeRandomData(testPath, 1);

        testPath = new Path(headPath, "0_0_10.data");
        fs.create(testPath);
        writeRandomData(testPath, 10);

        testPath = new Path(headPath, "0_0_999.data");
        fs.create(testPath);
        writeRandomData(testPath, 999);
View Full Code Here

        testPath = new Path(headPath, "0_0_10.data");
        fs.create(testPath);
        writeRandomData(testPath, 10);

        testPath = new Path(headPath, "0_0_999.data");
        fs.create(testPath);
        writeRandomData(testPath, 999);

        testPath = new Path(headPath, "0_0_101.data");
        fs.create(testPath);
        writeRandomData(testPath, 101);
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.