Examples of doAs()


Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

                ticket = ticket.getRealUser();
              }
            }
            boolean continueSasl = false;
            try {
              continueSasl = ticket
                  .doAs(new PrivilegedExceptionAction<Boolean>() {
                    @Override
                    public Boolean run() throws IOException {
                      return setupSaslConnection(in2, out2);
                    }
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    try {
      if (StringUtils.hasText(user)) {
        UserGroupInformation ugi = UserGroupInformation.createProxyUser(user,
            UserGroupInformation.getLoginUser());
        pigServer = ugi.doAs(new PrivilegedExceptionAction<PigServer>() {
          @Override
          public PigServer run() throws Exception {
            return new PigServer(ctx, true);
          }
        });
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    // add recurring arguments
    addArgument(input, "-input", argsList);

    if (StringUtils.hasText(user)) {
      UserGroupInformation ugi = UserGroupInformation.createProxyUser(user, UserGroupInformation.getLoginUser());
      ugi.doAs(new PrivilegedExceptionAction<Void>() {

        @Override
        public Void run() throws Exception {
          job = new Job(createStreamJob(cfg, argsList.toArray(new String[argsList.size()])));
          return null;
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    buildGenericOptions(cfg);

    if (StringUtils.hasText(user)) {
      UserGroupInformation ugi = UserGroupInformation.createProxyUser(user, UserGroupInformation.getLoginUser());
      ugi.doAs(new PrivilegedExceptionAction<Void>() {

        @Override
        public Void run() throws Exception {
          job = new Job(cfg);
          return null;
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    }

    try {
      if (StringUtils.hasText(user)) {
        UserGroupInformation ugi = UserGroupInformation.createProxyUser(user, UserGroupInformation.getLoginUser());
        ugi.doAs(new PrivilegedExceptionAction<Void>() {
          @Override
          public Void run() throws Exception {
            invokeCopy(configuration, parsedArguments.toArray(new String[parsedArguments.size()]));
            return null;
          }
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

      if (StringUtils.hasText(user)) {
        UserGroupInformation ugi = UserGroupInformation.createProxyUser(user,
            UserGroupInformation.getLoginUser());

        return ugi.doAs(new PrivilegedExceptionAction<Integer>() {
          @Override
          public Integer run() throws Exception {
            return invokeTarget(cfg, target, type, arguments);
          }
        });
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

      throw new HadoopException(HadoopException.ERROR.H06, NAME_NODE_PROPERTY);
    }
    try {
      validateNamenode(new URI(conf.get(NAME_NODE_PROPERTY)).getAuthority());
      UserGroupInformation ugi = getUGI(user);
      return ugi.doAs(new PrivilegedExceptionAction<T>() {
        public T run() throws Exception {
          Configuration namenodeConf = createNameNodeConf(conf);
          FileSystem fs = createFileSystem(namenodeConf);
          Instrumentation instrumentation = getServer().get(Instrumentation.class);
          Instrumentation.Cron cron = instrumentation.createCron();
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    }
    try {
      validateJobtracker(new URI(conf.get(JOB_TRACKER_PROPERTY)).getAuthority());
      validateNamenode(new URI(conf.get(NAME_NODE_PROPERTY)).getAuthority());
      UserGroupInformation ugi = getUGI(user);
      return ugi.doAs(new PrivilegedExceptionAction<T>() {
        public T run() throws Exception {
          JobConf jobtrackerConf = createJobTrackerConf(conf);
          Configuration namenodeConf = createNameNodeConf(conf);
          JobClient jobClient = createJobClient(jobtrackerConf);
          try {
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    Check.notEmpty(user, "user");
    Check.notNull(conf, "conf");
    try {
      validateNamenode(new URI(conf.get(NAME_NODE_PROPERTY)).getAuthority());
      UserGroupInformation ugi = getUGI(user);
      return ugi.doAs(new PrivilegedExceptionAction<FileSystem>() {
        public FileSystem run() throws Exception {
          Configuration namenodeConf = createNameNodeConf(conf);
          return createFileSystem(namenodeConf);
        }
      });
View Full Code Here

Examples of org.apache.hadoop.security.UserGroupInformation.doAs()

    }

    private void createHadoopTempDir(String user, final Path testDir) throws Exception {
      UserGroupInformation ugi = UserGroupInformation.createProxyUser(user,
                                                                      UserGroupInformation.getCurrentUser());
      ugi.doAs(new PrivilegedExceptionAction<Void>() {
        @Override
        public Void run() throws Exception {
          FileSystem fs = FileSystem.get(HADOOP_CONF);
          fs.delete(testDir, true);
          fs.mkdirs(testDir);
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.