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 D3C3F9715 for ; Tue, 6 Mar 2012 15:28:14 +0000 (UTC) Received: (qmail 21626 invoked by uid 500); 6 Mar 2012 15:28:10 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 21568 invoked by uid 500); 6 Mar 2012 15:28:10 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 21559 invoked by uid 99); 6 Mar 2012 15:28:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 15:28:10 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jane.wayne2978@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-tul01m020-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 15:28:05 +0000 Received: by obbef5 with SMTP id ef5so8410884obb.35 for ; Tue, 06 Mar 2012 07:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of jane.wayne2978@gmail.com designates 10.60.26.65 as permitted sender) client-ip=10.60.26.65; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jane.wayne2978@gmail.com designates 10.60.26.65 as permitted sender) smtp.mail=jane.wayne2978@gmail.com; dkim=pass header.i=jane.wayne2978@gmail.com Received: from mr.google.com ([10.60.26.65]) by 10.60.26.65 with SMTP id j1mr11908026oeg.6.1331047664990 (num_hops = 1); Tue, 06 Mar 2012 07:27:44 -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 :content-type; bh=jxrBQT5qXCtsi8dmw4xN09CJPKNCJdxcxiReVm9u0nY=; b=meUjx/EXW1d0WaqdFftJDb58a43eg4kHvXoeG7BFh8KipvDYAqZLZZ2FsPYzxGW6Uw Twm+L/mdSvRclj1UmLUxWfGAWQg3Vvlt2a5rgDXjHibnry08zV1L05h4ckdfste3C38M wcLzWsDSCkod8xvzE4KGukf9JSUPXF3/Hirpaq3T6AzrBX4RDea3S/qvBRfEFPqVg/9A GlR3NT63NGR1dVBrC2dSXipG50iLwLAuPw/0EL57sc96vr97OZ+tii7JZpsmeiLBhDdY C0vUIMECUdymbl+D+7k3w1MLGAnjAKEXWWfYXmsl8KaHE9nrtSJilVS7usPGbcnm8WtZ Gorw== MIME-Version: 1.0 Received: by 10.60.26.65 with SMTP id j1mr10268662oeg.6.1331047664909; Tue, 06 Mar 2012 07:27:44 -0800 (PST) Received: by 10.182.179.6 with HTTP; Tue, 6 Mar 2012 07:27:44 -0800 (PST) In-Reply-To: References: Date: Tue, 6 Mar 2012 10:27:44 -0500 Message-ID: Subject: Re: is there anyway to detect the file size as am i writing a sequence file? From: Jane Wayne To: common-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=e89a8fb1eef43efd5c04ba94af60 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8fb1eef43efd5c04ba94af60 Content-Type: text/plain; charset=ISO-8859-1 Thanks Joey. That's what I meant (I've been staring at the screen too long). :) On Tue, Mar 6, 2012 at 10:00 AM, Joey Echeverria wrote: > I think you mean Writer.getLength(). It returns the current position > in the output stream in bytes (more or less the current size of the > file). > > -Joey > > On Tue, Mar 6, 2012 at 9:53 AM, Jane Wayne > wrote: > > hi, > > > > i am writing a little util class to recurse into a directory and add all > > *.txt files into a sequence file (key is the file name, value is the > > content of the corresponding text file). as i am writing (i.e. > > SequenceFile.Writer.append(key, value)), is there any way to detect how > > large the sequence file is? > > > > for example, i want to create a new sequence file as soon as the current > > one exceeds 64 MB. > > > > i notice there is a SequenceFile.Writer.getLong() which the javadocs says > > "returns the current length of the output file," but that is vague. what > is > > this Writer.getLong() method? is it the number of bytes, kilobytes, > > megabytes, or something else? > > > > thanks, > > > > -- > Joseph Echeverria > Cloudera, Inc. > 443.305.9434 > --e89a8fb1eef43efd5c04ba94af60--