Package org.apache.hadoop.lib.service

Examples of org.apache.hadoop.lib.service.Groups


        response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
        break;
      }
      case INSTRUMENTATION: {
        enforceRootPath(op.value(), path);
        Groups groups = HttpFSServerWebApp.get().get(Groups.class);
        List<String> userGroups = groups.getGroups(user.getName());
        if (!userGroups.contains(HttpFSServerWebApp.get().getAdminGroup())) {
          throw new AccessControlException(
            "User not in HttpFSServer admin group");
        }
        Instrumentation instrumentation =
View Full Code Here


        response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
        break;
      }
      case INSTRUMENTATION: {
        enforceRootPath(op.value(), path);
        Groups groups = HttpFSServerWebApp.get().get(Groups.class);
        List<String> userGroups = groups.getGroups(user.getName());
        if (!userGroups.contains(HttpFSServerWebApp.get().getAdminGroup())) {
          throw new AccessControlException(
            "User not in HttpFSServer admin group");
        }
        Instrumentation instrumentation =
View Full Code Here

    String dir = TestDirHelper.getTestDir().getAbsolutePath();
    Configuration conf = new Configuration(false);
    conf.set("server.services", StringUtils.join(",", Arrays.asList(GroupsService.class.getName())));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Groups groups = server.get(Groups.class);
    Assert.assertNotNull(groups);
    List<String> g = groups.getGroups(System.getProperty("user.name"));
    Assert.assertNotSame(g.size(), 0);
    server.destroy();
  }
View Full Code Here

    String dir = TestDirHelper.getTestDir().getAbsolutePath();
    Configuration conf = new Configuration(false);
    conf.set("server.services", StringUtils.join(",", Arrays.asList(GroupsService.class.getName())));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Groups groups = server.get(Groups.class);
    List<String> g = groups.getGroups(System.getProperty("user.name"));
    server.destroy();
    return g.get(0);
  }
View Full Code Here

          if (!path.value().equals("/")) {
            throw new UnsupportedOperationException(
              MessageFormat.format("Invalid path for {0}={1}, must be '/'",
                                   GetOpParam.NAME, HttpFSFileSystem.GetOpValues.INSTRUMENTATION));
          }
          Groups groups = HttpFSServerWebApp.get().get(Groups.class);
          List<String> userGroups = groups.getGroups(user.getName());
          if (!userGroups.contains(HttpFSServerWebApp.get().getAdminGroup())) {
            throw new AccessControlException("User not in HttpFSServer admin group");
          }
          Instrumentation instrumentation = HttpFSServerWebApp.get().get(Instrumentation.class);
          Map snapshot = instrumentation.getSnapshot();
View Full Code Here

        response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
        break;
      }
      case INSTRUMENTATION: {
        enforceRootPath(op.value(), path);
        Groups groups = HttpFSServerWebApp.get().get(Groups.class);
        List<String> userGroups = groups.getGroups(user.getName());
        if (!userGroups.contains(HttpFSServerWebApp.get().getAdminGroup())) {
          throw new AccessControlException(
            "User not in HttpFSServer admin group");
        }
        Instrumentation instrumentation =
View Full Code Here

          if (!path.value().equals("/")) {
            throw new UnsupportedOperationException(
              MessageFormat.format("Invalid path for {0}={1}, must be '/'",
                                   GetOpParam.NAME, HttpFSFileSystem.GetOpValues.INSTRUMENTATION));
          }
          Groups groups = HttpFSServerWebApp.get().get(Groups.class);
          List<String> userGroups = groups.getGroups(user.getName());
          if (!userGroups.contains(HttpFSServerWebApp.get().getAdminGroup())) {
            throw new AccessControlException("User not in HttpFSServer admin group");
          }
          Instrumentation instrumentation = HttpFSServerWebApp.get().get(Instrumentation.class);
          Map snapshot = instrumentation.getSnapshot();
View Full Code Here

        response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
        break;
      }
      case INSTRUMENTATION: {
        enforceRootPath(op.value(), path);
        Groups groups = HttpFSServerWebApp.get().get(Groups.class);
        List<String> userGroups = groups.getGroups(user.getName());
        if (!userGroups.contains(HttpFSServerWebApp.get().getAdminGroup())) {
          throw new AccessControlException(
            "User not in HttpFSServer admin group");
        }
        Instrumentation instrumentation =
View Full Code Here

    String dir = TestDirHelper.getTestDir().getAbsolutePath();
    Configuration conf = new Configuration(false);
    conf.set("server.services", StringUtils.join(",", Arrays.asList(GroupsService.class.getName())));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Groups groups = server.get(Groups.class);
    List<String> g = groups.getGroups(System.getProperty("user.name"));
    server.destroy();
    return g.get(0);
  }
View Full Code Here

    String dir = TestDirHelper.getTestDir().getAbsolutePath();
    Configuration conf = new Configuration(false);
    conf.set("server.services", StringUtils.join(",", Arrays.asList(GroupsService.class.getName())));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Groups groups = server.get(Groups.class);
    assertNotNull(groups);
    List<String> g = groups.getGroups(System.getProperty("user.name"));
    assertNotSame(g.size(), 0);
    server.destroy();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.lib.service.Groups

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.