Examples of open()


Examples of org.apache.hadoop.hbase.io.HFileLink.open()

              // check whether this path is a reference.
              if (StoreFileInfo.isReference(storeFilePath)) continue;
              // check whether this path is a HFileLink.
              else if (HFileLink.isHFileLink(storeFilePath)) {
                HFileLink fileLink = new HFileLink(getConf(), storeFilePath);
                fsdis = fileLink.open(fs);
                lenToRead = fileLink.getFileStatus(fs).getLen();
              } else {
                // a regular hfile
                fsdis = fs.open(storeFilePath);
                lenToRead = storeFile.getLen();
View Full Code Here

Examples of org.apache.hadoop.hdfs.DFSClient.open()

    } catch (InterruptedException e) {
      response.sendError(400, e.getMessage());
      return;
    }
   
    FSInputStream in = dfs.open(filename);
    OutputStream os = response.getOutputStream();
    response.setHeader("Content-Disposition", "attachment; filename=\"" +
                       filename + "\"");
    response.setContentType("application/octet-stream");
    byte buf[] = new byte[4096];
View Full Code Here

Examples of org.apache.hadoop.hdfs.DistributedFileSystem.open()

    ClientContext getClientContext = ClientContext.getFromConf(conf);
    if (legacyShortCircuitFails) {
      assertFalse(getClientContext.getDisableLegacyBlockReaderLocal());
    }
   
    FSDataInputStream stm = fs.open(name);
    byte[] actual = new byte[expected.length-readOffset];
    stm.readFully(readOffset, actual);
    checkData(actual, readOffset, expected, "Read 2");
    stm.close();
    // Now read using a different API.
View Full Code Here

Examples of org.apache.hadoop.hdfs.DistributedRaidFileSystem.open()

    RaidDFSUtil.reportCorruptBlocks((DistributedFileSystem)fileSys, srcPath,
                         corruptBlockIdxs, blockSize);
   
    // verify the partial read
    byte[] buffer = new byte[bufferSize];
    FSDataInputStream in = raidFs.open(srcPath);
   
    long numRead = 0;
    CRC32 newcrc = new CRC32();
   
    int num = 0;
View Full Code Here

Examples of org.apache.hadoop.hdfs.HftpFileSystem.open()

    HftpFileSystem hftpFs = null;

    setupAuditLogs();
    try {
      hftpFs = (HftpFileSystem) new Path(hftpUri).getFileSystem(conf);
      InputStream istream = hftpFs.open(file);
      int val = istream.read();
      istream.close();

      verifyAuditLogs(true);
    } finally {
View Full Code Here

Examples of org.apache.hadoop.hdfs.SnapshotClient.open()

    assertTrue(in.read() == 1);
    assertTrue(in.read() == 2);
    assertTrue(in.read() == -1); //eof

    // Checking test snapshot
    in = ssClient.open("test", "/foo");
    assertTrue(in.getFileLength() == 1);
    assertTrue(in.read() == 0);
    assertTrue(in.read() == -1); //eof
    in = ssClient.open("test", "/bar");
    assertTrue(in.getFileLength() == 1);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FSEditLog.open()

    FileNameGenerator nameGenerator = new FileNameGenerator(BASE_PATH, 100);


    FSEditLog editLog = fsImage.getEditLog();
    editLog.createEditLogFile(fsImage.getFsEditName());
    editLog.open();
    addFiles(editLog, numFiles, replication, numBlocksPerFile, startingBlockId,
             nameGenerator);
    editLog.logSync();
    editLog.close();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.web.HftpFileSystem.open()

    HftpFileSystem hftpFs = null;

    setupAuditLogs();
    try {
      hftpFs = (HftpFileSystem) new Path(hftpUri).getFileSystem(conf);
      InputStream istream = hftpFs.open(file);
      @SuppressWarnings("unused")
      int val = istream.read();
      istream.close();

      verifyAuditLogs(true);
View Full Code Here

Examples of org.apache.hadoop.hdfs.web.WebHdfsFileSystem.open()

    fs.setOwner(file, "root", null);

    setupAuditLogs();

    WebHdfsFileSystem webfs = WebHdfsTestUtil.getWebHdfsFileSystemAs(userGroupInfo, conf, WebHdfsFileSystem.SCHEME);
    InputStream istream = webfs.open(file);
    int val = istream.read();
    istream.close();

    verifyAuditLogsRepeat(true, 3);
    assertTrue("failed to read from file", val >= 0);
View Full Code Here

Examples of org.apache.hadoop.hive.common.metrics.Metrics.MetricsScope.open()

    });
    // cannot open scope that is already open:
    expectIOE(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        fooScope.open();
        return null;
      }
    });
   
    assertSame(fooScope, Metrics.getScope(scopeName));
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.