Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 48827 invoked from network); 2 May 2006 19:17:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 May 2006 19:17:58 -0000 Received: (qmail 80829 invoked by uid 500); 2 May 2006 19:17:58 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 80807 invoked by uid 500); 2 May 2006 19:17:58 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 80798 invoked by uid 99); 2 May 2006 19:17:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2006 12:17:58 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [216.145.54.172] (HELO mrout2.yahoo.com) (216.145.54.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2006 12:17:57 -0700 Received: from [66.228.175.136] (seemeight-dx.corp.yahoo.com [66.228.175.136]) by mrout2.yahoo.com (8.13.6/8.13.4/y.out) with ESMTP id k42JGiU9064842 for ; Tue, 2 May 2006 12:16:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=message-id:date:from:user-agent:x-accept-language: mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=czoA60HiFbodBdy3YyVETSMgT+UFAtfzqBC3WoGhP6v9Z4srO7Vk+mi+od7mXbXh Message-ID: <4457B01C.2010007@yahoo-inc.com> Date: Tue, 02 May 2006 12:16:44 -0700 From: Konstantin Shvachko User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadoop-dev@lucene.apache.org Subject: Re: C API for Hadoop DFS References: <02e101c66da0$1435c160$2201a8c0@ddaslaptop> In-Reply-To: <02e101c66da0$1435c160$2201a8c0@ddaslaptop> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I think this a very important issue raised by David. IMO __ALL__ functions should return an integer value indicating success (=0) or failure (<0). Unless we want to use C style Exceptions, otherwise we won't be able to identify what went wrong if anything. NULL or bool is not enough in most cases, since we need to distinguish e.g. between timeout (when we retry) and "file not found" cases. The actual return objects should be passed as outputs parameters. E.g. dfsFS dfsConnect(char *host, tPort port); will become tCompletionCode dfsConnect(char *host, tPort port, dfsFS fileSystem ); where tCompletionCode could be integer for now. Or we can define a structure { int errCode; char *errDescription; } to return the actual error descriptions along with the error code. --Konstantin Devaraj Das wrote: >>Do dfsConnect and dfsOpenFile return NULL on failure? >> >> >Yes. > > > >>Shouldn't dfsSeek, dfsRename, dfsCreateDirectory and >>dfsSetWorkingDirectory each have a return value to indicate success or >>failure? Or are they assumed to never fail? >> >> >Yes these functions should have return values. I will update the API spec. >Thanks for pointing this out. > >-----Original Message----- >From: David Bowen [mailto:dbowen@yahoo-inc.com] >Sent: Monday, May 01, 2006 8:13 AM >To: hadoop-dev@lucene.apache.org >Subject: Re: C API for Hadoop DFS > > >I'm curious about error handling. > >Do dfsConnect and dfsOpenFile return NULL on failure? > >Shouldn't dfsSeek, dfsRename, dfsCreateDirectory and >dfsSetWorkingDirectory each have a return value to indicate success or >failure? Or are they assumed to never fail? > >- David > > > > > > >