Examples of create()


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

    Configuration conf = new Configuration();
    URI uri = URI.create("ramfs://mapoutput" + "_tmp");
    InMemoryFileSystem inMemFs =  (InMemoryFileSystem)FileSystem.get(uri, conf);
    Path testPath = new Path("/file_1");
    inMemFs.reserveSpaceWithCheckSum(testPath, 1024);
    FSDataOutputStream fout = inMemFs.create(testPath);
    fout.write("testing".getBytes());
    fout.close();
    assertTrue("checksum exists", inMemFs.exists(inMemFs.getChecksumFile(testPath)));
    inMemFs.delete(testPath, true);
    assertTrue("checksum deleted", !inMemFs.exists(inMemFs.getChecksumFile(testPath)));

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

     */
    @Test
    public void input_empty() throws Exception {
        LocalFileSystem fs = FileSystem.getLocal(conf);
        Path path = new Path(folder.newFile("testing").toURI());
        fs.create(path).close();
        ModelInput<StringOption> in = format.createInput(
                StringOption.class,
                fs,
                path,
                0,

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

      Path historyFilePath = new Path (historyDir.toString(), historyFileName);

      RawLocalFileSystem fs = (RawLocalFileSystem)
        FileSystem.getLocal(conf).getRaw();

      FSDataOutputStream out = fs.create(historyFilePath, true);
      byte[] corruptData = new byte[32];
      new Random().nextBytes(corruptData);
      out.write (corruptData, 0, 32);
      out.close();

Examples of org.apache.hadoop.hbase.client.UserProvider.create()

      UserProvider provider = UserProvider.instantiate(conf);
      if (realUserNamePresent) {
        String realUserName = in.readUTF();
        UserGroupInformation realUserUgi =
            UserGroupInformation.createRemoteUser(realUserName);
        user = provider.create(
            UserGroupInformation.createProxyUser(username, realUserUgi));
      } else {
        user = provider.create(UserGroupInformation.createRemoteUser(username));
      }
    } else {

Examples of org.apache.hadoop.hbase.master.MetricsMasterSourceFactory.create()

  @Test
  public void testGetInstance() throws Exception {
    MetricsMasterSourceFactory metricsMasterSourceFactory = CompatibilitySingletonFactory
        .getInstance(MetricsMasterSourceFactory.class);
    MetricsMasterSource masterSource = metricsMasterSourceFactory.create(null);
    assertTrue(masterSource instanceof MetricsMasterSourceImpl);
    assertSame(metricsMasterSourceFactory, CompatibilitySingletonFactory.getInstance(MetricsMasterSourceFactory.class));
  }

}

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

            fos = null;
          }
          continue;
        }
        if (fos == null) {
          fos = dfs.create(target + "/" + chain, true);
          if (fos != null) chain++;
          else {
            LOG.warn(errmsg + ": could not store chain " + chain);
            // perhaps we should bail out here...
            // return;

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

    cluster.waitActive();
    DistributedFileSystem fs = (DistributedFileSystem) cluster.getFileSystem();
    OutputStream out = null;
    try {
      fs.mkdirs(new Path("/test-target"));
      out = fs.create(new Path("/test-source/foo")); // don't close
      fs.rename(new Path("/test-source/"), new Path("/test-target/"));

      fs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
      cluster.getNameNodeRpc().saveNamespace();
      fs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE);

Examples of org.apache.hadoop.hdfs.protocol.ClientProtocol.create()

    cluster.clearZooKeeperNode(0);
    ClientProtocol namenode = ((DistributedAvatarFileSystem) fs).getClient()
        .getNameNodeRPC();
    new FailoverThread().start();
    FsPermission perm = new FsPermission((short) 0264);
    namenode.create("/test", perm, ((DistributedAvatarFileSystem) fs)
        .getClient().getClientName(), true, true, (short) 3, (long) 1024);
    LOG.info("Done with create");
    assertTrue(fs.exists(new Path("/test")));
    assertTrue(pass);
  }

Examples of org.apache.hadoop.hdfs.server.namenode.AvatarNode.create()

    FsPermission perm = new FsPermission((short) 0264);
    String clientName = ((DistributedAvatarFileSystem) fs)
        .getClient().getClientName();
   
    // create a file directly and add one block
    nn.create("/test", perm, clientName, true, true, (short) 3, (long) 1024);
    nn.addBlock("/test", clientName);

    assertEquals(1,
        cluster.getPrimaryAvatar(0).avatar.namesystem.getBlocksTotal());
   

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream.create()

    File fstime = getFileWithCurrent(editsDir, "fstime");

    if (!edits.createNewFile())
      throw new IOException("Failed to create edits file");
    EditLogFileOutputStream out = new EditLogFileOutputStream(edits, null);
    out.create();
    if (!fstime.createNewFile())
      throw new IOException("Failed to create fstime file");
   
    return out;
  }
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.