Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8E120200BD0 for ; Tue, 15 Nov 2016 19:01:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8AEE0160B03; Tue, 15 Nov 2016 18:01:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DDBAC160AF2 for ; Tue, 15 Nov 2016 19:01:04 +0100 (CET) Received: (qmail 58230 invoked by uid 500); 15 Nov 2016 18:01:04 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 58213 invoked by uid 99); 15 Nov 2016 18:01:04 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2016 18:01:04 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E313D2C4C76 for ; Tue, 15 Nov 2016 18:01:03 +0000 (UTC) Date: Tue, 15 Nov 2016 18:01:03 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-4990) Use new HDFS API access instead of listStatus to check if users have permissions to access workspace. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 15 Nov 2016 18:01:05 -0000 [ https://issues.apache.org/jira/browse/DRILL-4990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15667810#comment-15667810 ] ASF GitHub Bot commented on DRILL-4990: --------------------------------------- Github user sohami commented on a diff in the pull request: https://github.com/apache/drill/pull/652#discussion_r88072322 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java --- @@ -151,15 +152,11 @@ public WorkspaceSchemaFactory( public boolean accessible(final String userName) throws IOException { final FileSystem fs = ImpersonationUtil.createFileSystem(userName, fsConf); try { - // We have to rely on the listStatus as a FileSystem can have complicated controls such as regular unix style - // permissions, Access Control Lists (ACLs) or Access Control Expressions (ACE). Hadoop 2.7 version of FileSystem --- End diff -- Also can we please replace the comments with why we are using "fs.access" api instead. Will be good for future use. > Use new HDFS API access instead of listStatus to check if users have permissions to access workspace. > ----------------------------------------------------------------------------------------------------- > > Key: DRILL-4990 > URL: https://issues.apache.org/jira/browse/DRILL-4990 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 1.8.0 > Reporter: Padma Penumarthy > Assignee: Sorabh Hamirwasia > Fix For: 1.9.0 > > > For every query, we build the schema tree (runSQL->getPlan->getNewDefaultSchema->getRootSchema). All workspaces in all storage plugins are checked and are added to the schema tree if they are accessible by the user who initiated the query. For file system plugin, listStatus API is used to check if the workspace is accessible or not (WorkspaceSchemaFactory.accessible) by the user. The idea seem to be if the user does not have access to file(s) in the workspace, listStatus will generate an exception and we return false. But, listStatus (which lists all the entries of a directory) is an expensive operation when there are large number of files in the directory. A new API is added in Hadoop 2.6 called access (HDFS-6570) which provides the ability to check if the user has permissions on a file/directory. Use this new API instead of listStatus. -- This message was sent by Atlassian JIRA (v6.3.4#6332)