Package com.cloudera.lib.service

Examples of com.cloudera.lib.service.Hadoop$JobClientExecutor


   * exceptions are handled by {@link HoopExceptionProvider}.
   */
  private <T> T fsExecute(Principal user, String doAs, Hadoop.FileSystemExecutor<T> executor)
    throws IOException, HadoopException {
    String hadoopUser = getEffectiveUser(user, doAs);
    Hadoop hadoop = HoopServer.get().get(Hadoop.class);
    Configuration conf = HoopServer.get().get(Hadoop.class).getDefaultConfiguration();
    return hadoop.execute(hadoopUser, conf, executor);
  }
View Full Code Here


   * @throws HadoopException thrwon if a Hadoop releated error occurred. Thrown
   * exceptions are handled by {@link HoopExceptionProvider}.
   */
  private FileSystem createFileSystem(Principal user, String doAs) throws IOException, HadoopException {
    String hadoopUser = getEffectiveUser(user, doAs);
    Hadoop hadoop = HoopServer.get().get(Hadoop.class);
    Configuration conf = HoopServer.get().get(Hadoop.class).getDefaultConfiguration();
    FileSystem fs = hadoop.createFileSystem(hadoopUser, conf);
    FileSystemReleaseFilter.setFileSystem(fs);
    return fs;
  }
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);
    FileSystem fs = hadoop.createFileSystem("u", getHadoopConf());
    Assert.assertNotNull(fs);
    fs.mkdirs(new Path("/tmp/foo"));
    hadoop.releaseFileSystem(fs);
    try {
      fs.mkdirs(new Path("/tmp/foo"));
      Assert.fail();
    }
    catch (IOException ex) {
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    final FileSystem fsa[] = new FileSystem[1];

    hadoop.execute("u", getHadoopConf(), new Hadoop.FileSystemExecutor<Void>() {
      @Override
      public Void execute(FileSystem fs) throws IOException {
        fs.mkdirs(new Path("/tmp/foo"));
        fsa[0] = fs;
        return null;
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    JobConf jobConf = getHadoopConf();
    jobConf.set("fs.default.name", "");
    hadoop.execute("u", jobConf, new Hadoop.FileSystemExecutor<Void>() {
      @Override
      public Void execute(FileSystem fs) throws IOException {
        return null;
      }
    });
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    final FileSystem fsa[] = new FileSystem[1];
    try {
      hadoop.execute("u", getHadoopConf(), new Hadoop.FileSystemExecutor<Void>() {
        @Override
        public Void execute(FileSystem fs) throws IOException {
          fsa[0] = fs;
          throw new IOException();
        }
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    JobConf jobConf = getHadoopConf();
    jobConf.set("fs.default.name", "");
    hadoop.execute("u", jobConf, new Hadoop.JobClientExecutor<Void>() {
      @Override
      public Void execute(JobClient jobClient, FileSystem fs) throws IOException {
        return null;
      }
    });
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    JobConf jobConf = getHadoopConf();
    jobConf.set("mapred.job.tracker", "");
    hadoop.execute("u", jobConf, new Hadoop.JobClientExecutor<Void>() {
      @Override
      public Void execute(JobClient jobClient, FileSystem fs) throws IOException {
        return null;
      }
    });
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    final JobClient jca[] = new JobClient[1];
    final FileSystem fsa[] = new FileSystem[1];

    hadoop.execute("u", getHadoopConf(), new Hadoop.JobClientExecutor<Void>() {
      @Override
      public Void execute(JobClient jc, FileSystem fs) throws IOException {
        fs.mkdirs(new Path("/tmp/foo"));
        jc.getQueues();
        jca[0] = jc;
View Full Code Here

                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);

    final JobClient jca[] = new JobClient[1];
    final FileSystem fsa[] = new FileSystem[1];

    try {
      hadoop.execute("u", getHadoopConf(), new Hadoop.JobClientExecutor<Void>() {
        @Override
        public Void execute(JobClient jc, FileSystem fs) throws IOException {
          jca[0] = jc;
          fsa[0] = fs;
          throw new IOException();
View Full Code Here

TOP

Related Classes of com.cloudera.lib.service.Hadoop$JobClientExecutor

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.