Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-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 5CC309965 for ; Tue, 17 Apr 2012 11:11:37 +0000 (UTC) Received: (qmail 28147 invoked by uid 500); 17 Apr 2012 11:11:35 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 28110 invoked by uid 500); 17 Apr 2012 11:11:35 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 28102 invoked by uid 99); 17 Apr 2012 11:11:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 11:11:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of juancitomiguelito@gmail.com designates 209.85.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-wi0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 11:11:29 +0000 Received: by wibhn6 with SMTP id hn6so379403wib.2 for ; Tue, 17 Apr 2012 04:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=vZdr8N6UHDaPPGhJlQdz3NmSWgO341bgNl5tXBQM1NI=; b=ThpZ3y7uMbLEdUg7I+5pjEZWtxxtNFtqz9lYlIoC7jOD+Fb/54ndUNCedBUWEZN8p9 QM5s1poGZu16Xteu6+3QxO2xwsoa+5vc82hu2Vb1HJxh0LS9Ntw8mlpa5s+/IDFeR35Y /fp+kqrpnzzvPmIUziVA+SIkVGo35f69iYfYHHmuCtdaxl6G6LOk/FL5jlsIESfqdwRA UHZd1FWsgZ0g90ZpapRRSC7uiJWHMeuqLe0mm7Z/D5GVKKdy4ZY+DmPSDgD9/wy8H1Qt 4LiL45ZMZVY4DhAIlnWc3m+u16/wXywaMiSfqGz1IzHJfBVuVI1w4GcQytfImd1PE1yp gylQ== Received: by 10.216.132.98 with SMTP id n76mr8950443wei.101.1334661067919; Tue, 17 Apr 2012 04:11:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.7.8 with HTTP; Tue, 17 Apr 2012 04:10:37 -0700 (PDT) From: Juan Pino Date: Tue, 17 Apr 2012 12:10:37 +0100 Message-ID: Subject: hfile writer append key value offset To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=0016e6da98bcd9538b04bdddfe4b X-Virus-Checked: Checked by ClamAV on apache.org --0016e6da98bcd9538b04bdddfe4b Content-Type: text/plain; charset=UTF-8 Hi, I am using the code below to append key/value pairs from a SequenceFile to an HFile. The problem is that I don't include offset and length information. In the old api (0.20.2), there was a method *append *(byte[] key, int koffset, int klength, byte[] value, int voffset, int vlength) so I would replace line 7. below by hfileWriter.append(key.getBytes(), 0, key.getLength(), valueBytes, 0, valueBytes.length); How do I do this with the newer api (0.92) ? Thank you very much. Best regards, Juan 1. HFile.WriterFactory hfileWriterFactory = HFile.getWriterFactory(conf); 2. HFile.Writer hfileWriter = hfileWriterFactory.createWriter(fs, path, 64 * 1024, "gz", null); 3. BytesWritable key = new BytesWritable(); 4. ArrayWritable value = new ArrayWritable(IntWritable.class); 5. while (sequenceReader.next(key, value)) { 6. byte[] valueBytes = Util.object2ByteArray(value); 7. hfileWriter.append(key.getBytes(), valueBytes); 8. } --0016e6da98bcd9538b04bdddfe4b--