Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6B2F9192 for ; Tue, 18 Oct 2011 01:58:31 +0000 (UTC) Received: (qmail 1724 invoked by uid 500); 18 Oct 2011 01:58:31 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 1699 invoked by uid 500); 18 Oct 2011 01:58:31 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 1683 invoked by uid 99); 18 Oct 2011 01:58:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Oct 2011 01:58:31 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Oct 2011 01:58:30 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9364A30D925 for ; Tue, 18 Oct 2011 01:58:10 +0000 (UTC) Date: Tue, 18 Oct 2011 01:58:10 +0000 (UTC) From: "Mariappan Asokan (Commented) (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1218308757.3469.1318903090605.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1372462005.2468.1318887072438.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HDFS-2461) Support HDFS file name globbing in libhdfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-2461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13129418#comment-13129418 ] Mariappan Asokan commented on HDFS-2461: ---------------------------------------- Srivas, Thanks for your comments. I am aware of the methods in FileSystem class. However, I wanted the C API to be simpler. Callers can iterate through the array and call hdfsGetPathInfo() to get the equivalent of FileStatus object if they wish. Also, the caller can pass each file name to a filter function. Having said that, the use cases of the API will dictate the function signature(simplicity versus convenience.) My current requirement is just to get file names matching wildcard patterns. I would like to hear the opinions from other developers before finalizing the API. > Support HDFS file name globbing in libhdfs > ------------------------------------------ > > Key: HDFS-2461 > URL: https://issues.apache.org/jira/browse/HDFS-2461 > Project: Hadoop HDFS > Issue Type: Improvement > Components: libhdfs > Reporter: Mariappan Asokan > Priority: Minor > > This is to enhance the C API in libhdfs to support HDFS file name globbing. The proposal is to keep the new API simple and return a list of matched HDFS path names. Callers can use existing hdfsGetPathInfo() to get additional information on each of the matched path. Following code snippet shows the proposed API enhancements: > {code:title=hdfs.h} > /** > * hdfsGlob - Get all the HDFS file names that match a glob pattern. The > * returned result will be sorted by the file names. The last element in the > * array is NULL. The function hdfsFreeGlob() should be called to free this > * array and its contents. > * @param fs The configured filesystem handle. > * @param globPattern The glob pattern to match file names against. Note that > * this is not a POSIX regular expression but rather a POSIX glob pattern. > * @return Returns a dynamically-allocated array of strings; if there is no > * match, an array with one entry that has a NULL value will be returned. If > * there is an error, NULL will be returned. > */ > char ** hdfsGlob(hdfsFS fs, const char *globPattern); > /** > * hdfsFreeGlob - Free up the array returned by hdfsGlob(). > * @param globResult The array of dynamically-allocated strings returned by > * hdfsGlob(). > */ > void hdfsFreeGlob(char **globResult); > {code} > Please comment on the above proposed API. I will start the implementation and testing. However, I need a committer to work with. > Thanks. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira