Examples of UnixUserGroupInformation


Examples of org.apache.hadoop.security.UnixUserGroupInformation

   *   </listing>
   * }
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    final UnixUserGroupInformation ugi = getUGI(request);
    final PrintWriter out = response.getWriter();
    final XMLOutputter doc = new XMLOutputter(out, "UTF-8");
    try {
      final Map<String, String> root = buildRoot(request, doc);
      final String path = root.get("path");
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

   * GET http://<nn>:<port>/data[/<path>] HTTP/1.1
   * }
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException {
    final UnixUserGroupInformation ugi = getUGI(request);
    final ClientProtocol nnproxy = createNameNodeProxy(ugi);

    try {
      final String path = request.getPathInfo() != null
        ? request.getPathInfo() : "/";
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

  static Configuration createConf4Testing(String username) throws Exception {
    Configuration conf = new Configuration();
    UnixUserGroupInformation.saveToConf(conf,
        UnixUserGroupInformation.UGI_PROPERTY_NAME,
        new UnixUserGroupInformation(username, new String[]{"group"}));
    return conf;   
  }
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

 
  public void testSubmitJobUsername() throws Exception {
    FileSystem.LOG.info("TEST_ROOT_DIR=" + TEST_ROOT_DIR);
    FileSystem fs = FileSystem.get(conf);
    try {
      UnixUserGroupInformation ugi = UnixUserGroupInformation.login(conf);
 
      JobConf conf = createJobConf(fs);
      JobClient jc = new JobClient(conf);
      assertEquals(null, conf.getUser());
      RunningJob rj = jc.submitJob(conf);
      assertEquals(ugi.getUserName(), conf.getUser());
      for(; !rj.isComplete(); Thread.sleep(500));
    }
    finally {
      FileUtil.fullyDelete(fs, TEST_ROOT_DIR);
    }
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

  static interface TestGetRunner {
    String run(int exitcode, String... options) throws IOException;
  }

  public void testRemoteException() throws Exception {
    UnixUserGroupInformation tmpUGI = new UnixUserGroupInformation("tmpname",
        new String[] {
        "mygroup"});
    MiniDFSCluster dfs = null;
    PrintStream bak = null;
    try {
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

      final Path sub = new Path(root, "sub");
      dfs.setPermission(sub, new FsPermission((short)0));

      final UserGroupInformation ugi = UserGroupInformation.getCurrentUGI();
      final String tmpusername = ugi.getUserName() + "1";
      UnixUserGroupInformation tmpUGI = new UnixUserGroupInformation(
          tmpusername, new String[] {tmpusername});
      UnixUserGroupInformation.saveToConf(conf,
            UnixUserGroupInformation.UGI_PROPERTY_NAME, tmpUGI);
      String results = runLsr(new FsShell(conf), root, -1);
      assertTrue(results.contains("zzz"));
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

    myAddress.setHost(serverSocket.getInetAddress().getHostAddress());
    myAddress.setPort(serverSocket.getLocalPort());
    LOG.info("My serverSocketPort " + serverSocket.getLocalPort());
    LOG.info("My Address " + myAddress.getHost() + ":" + myAddress.getPort());

    UnixUserGroupInformation ugi = getUGI(conf);
    String userName = ugi.getUserName();
    String sessionName = userName +
        "@" + myAddress.getHost() + ":" + myAddress.getPort() +
        "-" + new java.util.Date().toString();
    if (null != conf.get("hive.query.source")) {
      sessionName += " [" + conf.get("hive.query.source")+ "]";
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

   * @return the {@link UnixUserGroupInformation} of the owner of the process
   * @throws IOException
   */
  private static UnixUserGroupInformation getUGI(Configuration conf)
    throws IOException {
    UnixUserGroupInformation ugi = null;
    try {
      ugi = UnixUserGroupInformation.login(conf, true);
    } catch (LoginException e) {
      throw (IOException) (new IOException(
          "Failed to get the current user's information.").initCause(e));
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

                 (Long.MAX_VALUE/1024/1024 + 1024) + "m", args[2]);
     
      // 17:  setQuota by a non-administrator
      UnixUserGroupInformation.saveToConf(conf,
          UnixUserGroupInformation.UGI_PROPERTY_NAME,
          new UnixUserGroupInformation(new String[]{"userxx\n", "groupyy\n"}));
      DFSAdmin userAdmin = new DFSAdmin(conf);
      args[1] = "100";
      runCommand(userAdmin, args, true);
      runCommand(userAdmin, true, "-setSpaceQuota", "1g", args[2]);
     
View Full Code Here

Examples of org.apache.hadoop.security.UnixUserGroupInformation

      job.setWorkingDirectory(fs.getWorkingDirectory());
    }
  }

  private static UnixUserGroupInformation getUGI(Configuration job) throws IOException {
    UnixUserGroupInformation ugi = null;
    try {
      ugi = UnixUserGroupInformation.login(job, true);
    } catch (LoginException e) {
      throw (IOException)(new IOException(
          "Failed to get the current user's information.").initCause(e));
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.