Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CD22B18867 for ; Sat, 20 Feb 2016 17:41:22 +0000 (UTC) Received: (qmail 68962 invoked by uid 500); 20 Feb 2016 17:41:18 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 68821 invoked by uid 500); 20 Feb 2016 17:41:18 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 68775 invoked by uid 99); 20 Feb 2016 17:41:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Feb 2016 17:41:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 828281A0529 for ; Sat, 20 Feb 2016 17:41:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.429 X-Spam-Level: * X-Spam-Status: No, score=1.429 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Vry3-UekimjA for ; Sat, 20 Feb 2016 17:41:16 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 632E95F1E7 for ; Sat, 20 Feb 2016 17:41:15 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id m1so72661255lfg.0 for ; Sat, 20 Feb 2016 09:41:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bzfBUCsexZpeZyIb/8R0U7/o8kGOWLIqwr7WZVznN00=; b=r57ubiffN1djelxe+pkeaYIfy3hHfBnzN5jagRtl4xVdNbQTlOJbuRQaT9j7XzS7rf U3qWlataMStQg1gGqvqPWcTqxsFajSPESfvq36cFSk6I/Wx06YEgEsl9m7Yy4oZ0YgBG cTKpZFOMYt4KIp4lulicRIX96FraHICCfCrffC7xup31TOQB1rn0brTjVr29GX5UNtbA 5EnywFF+rTvg5v9Wd4Ru2a0t7jrPZ4l3NkE4fyy0alOPRlWjl5/hWFno5UfXB4n5OZpm 7pVVgt2bx23NCB5m33E0YDWk+Q8NxS/LtOMt/EGqafn7dop1Kol1ww4PtqdILWeAsVp5 F84w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=bzfBUCsexZpeZyIb/8R0U7/o8kGOWLIqwr7WZVznN00=; b=H7ftNxRPPVygJEDqLTwld+74AQKvGdsQX/UwK7wFSwfBn7RtvK9hWU3VVl7JwAxEFq IwiL3G+q5b2qZEudnvNgV3X3db4NbwGl66jSw4HwqNJCXVJ1fconDCw7cDZSJPKfeNek PuAIRo83ar3e+0ncTFl4iDxjeOu5vN//aeNhh6+HuLeWWNA3UmX/amQTI3vV613TKje1 qPbk+uPYgpHrV7LLfdjN16f/vE16upDHzpitzd7p5Ss893P9NhGfjSYOTVQUnxXVwC+i lcKVknd2OQuAURL7fSsIY5aTvMdqmo+wvugYViMHHrZ8748+JxsYslJ5lzQtRUrmSNaX UKuQ== X-Gm-Message-State: AG10YOR/ctcBGc10Irdf52cznWMJXl4JiZcix4lqYGxyriMSIzFou8u4KKr1U0D/wZlnNvTqo8MbAEFntJvLlQ== MIME-Version: 1.0 X-Received: by 10.25.168.138 with SMTP id r132mr6233077lfe.77.1455990074890; Sat, 20 Feb 2016 09:41:14 -0800 (PST) Received: by 10.25.162.131 with HTTP; Sat, 20 Feb 2016 09:41:14 -0800 (PST) Received: by 10.25.162.131 with HTTP; Sat, 20 Feb 2016 09:41:14 -0800 (PST) In-Reply-To: References: Date: Sat, 20 Feb 2016 23:11:14 +0530 Message-ID: Subject: Re: Get member list of group in HDFS using Java/Script From: Shashi Vishwakarma To: Chris Nauroth Cc: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001a1140769c35e2ed052c371b86 --001a1140769c35e2ed052c371b86 Content-Type: text/plain; charset=UTF-8 Thanks Chris. Information you provided is very much helpful.. On 20 Feb 2016 12:18 am, "Chris Nauroth" wrote: > Hello Shashi, > > HDFS itself doesn't have any knowledge of membership of users in groups. > The user and group field of an HDFS file or directory are just arbitrary > strings. For consulting a user's group memberships, HDFS runs a group > mapping provider [1]. This is pluggable, but the common case is either > querying the underlying OS directly or querying an LDAP server. > > For a given username, you can check what HDFS thinks its group memberships > are by running the "hdfs groups" command [2]. For example: > > > hdfs groups chris > chris : staff everyone localaccounts _appserverusr admin _appserveradm > _lpadmin _appstore _lpoperator _developer com.apple.access_screensharing > com.apple.access_ssh > > However, there is no way to query a list of all users in a group through > HDFS. HDFS doesn't have a use case for this kind of query, so it doesn't > implement one. For that, I'd expect you'd need to query directly whatever > your group membership infrastructure is (i.e. run the "groups" command at > the OS layer or query an LDAP server). > > I hope this helps. > > --Chris Nauroth > > [1] > http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html#Group_Mapping > [2] > http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#groups > > > From: Shashi Vishwakarma > Date: Thursday, February 18, 2016 at 11:29 PM > To: "user@hadoop.apache.org" > Subject: Get member list of group in HDFS using Java/Script > > Hi > > I need to find how many users belong to particular group in HDFS using > Java/Script. > > Let's say I have a directory /user/data in HDFS and it belongs to a group > 'abc' . > > I need to find how may other users belongs to 'abc' group. > > Can anyone suggest something. > > Thanks > --001a1140769c35e2ed052c371b86 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Thanks Chris. Information you provided is very much helpful.= .

On 20 Feb 2016 12:18 am, "Chris Nauroth&quo= t; <cnauroth@hortonworks.com= > wrote:
Hello Shashi,

HDFS itself doesn't have any knowledge of membership of users in g= roups.=C2=A0 The user and group field of an HDFS file or directory are just= arbitrary strings.=C2=A0 For consulting a user's group memberships, HD= FS runs a group mapping provider [1].=C2=A0 This is pluggable, but the common case is either querying the underlying OS directly or query= ing an LDAP server.

For a given username, you can check what HDFS thinks its group members= hips are by running the "hdfs groups" command [2].=C2=A0 For exam= ple:

> hdfs groups chris
chris : staff everyone localaccounts _appserverusr admin _appserveradm= _lpadmin _appstore _lpoperator _developer com.apple.access_screensharing c= om.apple.access_ssh

However, there is no way to query a list of all users in a group throu= gh HDFS.=C2=A0 HDFS doesn't have a use case for this kind of query, so = it doesn't implement one.=C2=A0 For that, I'd expect you'd need= to query directly whatever your group membership infrastructure is (i.e. run the "groups" command at the OS layer or query an LD= AP server).

I hope this helps.

--Chris Nauroth<= /font>



From: Shashi Vishwakarma <shashi.vish123@gmai= l.com>
Date: Thursday, February 18, 2016 a= t 11:29 PM
To: "user@hadoop.apache.org" <user@hadoop.apache= .org>
Subject: Get member list of group i= n HDFS using Java/Script

Hi

I need to find how many users belong to particular group in HDFS using= Java/Script.

Let's say I have a directory /user/data in HDFS and it belongs to = a group 'abc' .

I need to find how may other users belongs to 'abc' group.

Can anyone suggest something.

Thanks
--001a1140769c35e2ed052c371b86--