Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.LocalFileSystem


     * compressed output.
     * @throws Exception if failed
     */
    @Test
    public void output_no_compressed() throws Exception {
        LocalFileSystem fs = FileSystem.getLocal(conf);
        Path path = new Path(folder.newFile("testing.gz").toURI());
        ModelOutput<StringOption> out = format.codec(null)
            .createOutput(StringOption.class, fs, path, new Counter());
        try {
            out.write(new StringOption("Hello, world!"));
View Full Code Here


     * compressed output.
     * @throws Exception if failed
     */
    @Test
    public void output_compressed_conf() throws Exception {
        LocalFileSystem fs = FileSystem.getLocal(conf);
        Path path = new Path(folder.newFile("testing").toURI());
        format.getConf().set(SequenceFileFormat.KEY_COMPRESSION_CODEC, DefaultCodec.class.getName());
        ModelOutput<StringOption> out = format.createOutput(StringOption.class, fs, path, new Counter());
        try {
            out.write(new StringOption("Hello, world!"));
View Full Code Here

     * invalid compressed output.
     * @throws Exception if failed
     */
    @Test
    public void output_compressed_invalid() throws Exception {
        LocalFileSystem fs = FileSystem.getLocal(conf);
        Path path = new Path(folder.newFile("testing").toURI());
        format.getConf().set(SequenceFileFormat.KEY_COMPRESSION_CODEC, "__INVALID__");
        ModelOutput<StringOption> out = format.createOutput(StringOption.class, fs, path, new Counter());
        try {
            out.write(new StringOption("Hello, world!"));
View Full Code Here

        };
    }

    private FileSystem getTempFileSystem() throws IOException {
        Configuration conf = new Configuration();
        LocalFileSystem local = FileSystem.getLocal(conf);
        return local;
    }
View Full Code Here

    conf.setInt("table.output.tfile.minBlock.size", 64 * 1024);
    conf.setInt("table.input.split.minSize", 64 * 1024);
    conf.set("table.output.tfile.compression", "none");

    RawLocalFileSystem rawLFS = new RawLocalFileSystem();
    fs = new LocalFileSystem(rawLFS);
    path = new Path(fs.getWorkingDirectory(), "TestBasicTableSplits");
    fs = path.getFileSystem(conf);
    // drop any previous tables
    BasicTable.drop(path, conf);

View Full Code Here

    conf.setInt("table.output.tfile.minBlock.size", 64 * 1024);
    conf.setInt("table.input.split.minSize", 64 * 1024);
    conf.set("table.output.tfile.compression", "none");

    RawLocalFileSystem rawLFS = new RawLocalFileSystem();
    fs = new LocalFileSystem(rawLFS);
    path = new Path(fs.getWorkingDirectory(), "TestBasicTableMapSplits");
    fs = path.getFileSystem(conf);
    // drop any previous tables
    BasicTable.drop(path, conf);

View Full Code Here

          + "," + "/user/" + System.getenv("USER") + "/" + "india" + ","
          + "/user/" + System.getenv("USER") + "/" + "japan");
      fs = new Path(inputPath).getFileSystem(conf);
    } else {
      RawLocalFileSystem rawLFS = new RawLocalFileSystem();
      fs = new LocalFileSystem(rawLFS);
      workingDir = fs.getWorkingDirectory().toString().split(":")[1];
      inputPath = new String(workingDir + "/" + inputFileName);
      System.out.println("inputPath: " + inputPath);
      multiLocs = new String(workingDir + "/" + "us" + "," + workingDir + "/"
          + "india" + "," + workingDir + "/" + "japan");
View Full Code Here

                + "others" + methodName);     
        paths.add(new Path(new String("/user/" + System.getenv("USER") + "/" + "us" + methodName)));
        paths.add(new Path(new String("/user/" + System.getenv("USER") + "/" + "others" + methodName)));
    } else {
      RawLocalFileSystem rawLFS = new RawLocalFileSystem();
      fs = new LocalFileSystem(rawLFS);
      myMultiLocs = new String(fs.getWorkingDirectory() + "/" + "us"
              + methodName + "," + fs.getWorkingDirectory() + "/" + "others"
              + methodName);
     
      paths.add(new Path(new String(fs.getWorkingDirectory() + "/" + "us" + methodName)));
View Full Code Here

    conf.setInt("table.output.tfile.minBlock.size", 64 * 1024);
    conf.setInt("table.input.split.minSize", 64 * 1024);
    conf.set("table.output.tfile.compression", "none");

    RawLocalFileSystem rawLFS = new RawLocalFileSystem();
    fs = new LocalFileSystem(rawLFS);
    path = new Path(fs.getWorkingDirectory(), "TestMapSplitSchemaStorageColumnOutOfOrder");
    fs = path.getFileSystem(conf);
    // drop any previous tables
    BasicTable.drop(path, conf);
    BasicTable.Writer writer = new BasicTable.Writer(path, STR_SCHEMA,
View Full Code Here

          + "/user/" + System.getenv("USER") + "/" + "japan");
      fs = new Path(inputPath).getFileSystem(conf);

    } else {
      RawLocalFileSystem rawLFS = new RawLocalFileSystem();
      fs = new LocalFileSystem(rawLFS);
      workingDir = fs.getWorkingDirectory().toString().split(":")[1];
      inputPath = new String(workingDir + "/" + inputFileName);
      System.out.println("inputPath: " + inputPath);
      multiLocs = new String(workingDir + "/" + "us" + "," + workingDir + "/"
          + "india" + "," + workingDir + "/" + "japan");
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.LocalFileSystem

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.