Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A97111743 for ; Wed, 20 Aug 2014 20:27:04 +0000 (UTC) Received: (qmail 11213 invoked by uid 500); 20 Aug 2014 20:26:46 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 11179 invoked by uid 500); 20 Aug 2014 20:26:46 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 11166 invoked by uid 99); 20 Aug 2014 20:26:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 20:26:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2CF9E982249; Wed, 20 Aug 2014 20:26:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tedyu@apache.org To: commits@hbase.apache.org Message-Id: <6615166af91c42a3b0520116964f1954@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: HBASE-11742 Addendum makes compilation on hadoop-1 pass Date: Wed, 20 Aug 2014 20:26:46 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/0.98 d79861213 -> 00a9cd3c3 HBASE-11742 Addendum makes compilation on hadoop-1 pass Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/00a9cd3c Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/00a9cd3c Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/00a9cd3c Branch: refs/heads/0.98 Commit: 00a9cd3c342b59774e1068c705e454f94d861d14 Parents: d798612 Author: Ted Yu Authored: Wed Aug 20 20:26:35 2014 +0000 Committer: Ted Yu Committed: Wed Aug 20 20:26:35 2014 +0000 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/snapshot/ExportSnapshot.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/00a9cd3c/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java index 3ffed7a..0639218 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java @@ -159,10 +159,16 @@ public class ExportSnapshot extends Configured implements Tool { LOG.info("Using bufferSize=" + StringUtils.humanReadableInt(bufferSize)); } + byte[] copyBytes(BytesWritable bw) { + byte[] result = new byte[bw.getLength()]; + System.arraycopy(bw.getBytes(), 0, result, 0, bw.getLength()); + return result; + } + @Override public void map(BytesWritable key, NullWritable value, Context context) throws InterruptedException, IOException { - SnapshotFileInfo inputInfo = SnapshotFileInfo.parseFrom(key.copyBytes()); + SnapshotFileInfo inputInfo = SnapshotFileInfo.parseFrom(copyBytes(key)); Path outputPath = getOutputPath(inputInfo); copyFile(context, inputInfo, outputPath);