Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-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 D0C65E625 for ; Wed, 9 Jan 2013 20:24:46 +0000 (UTC) Received: (qmail 41506 invoked by uid 500); 9 Jan 2013 20:24:46 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 41482 invoked by uid 500); 9 Jan 2013 20:24:46 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 41474 invoked by uid 99); 9 Jan 2013 20:24:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 20:24:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 20:24:44 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5235E23888FE; Wed, 9 Jan 2013 20:24:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1431042 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java Date: Wed, 09 Jan 2013 20:24:24 -0000 To: commits@accumulo.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130109202424.5235E23888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ecn Date: Wed Jan 9 20:24:23 2013 New Revision: 1431042 URL: http://svn.apache.org/viewvc?rev=1431042&view=rev Log: ACCUMULO-797: ignore empty wal files Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java?rev=1431042&r1=1431041&r2=1431042&view=diff ============================================================================== --- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java (original) +++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java Wed Jan 9 20:24:23 2013 @@ -46,6 +46,12 @@ import org.apache.log4j.Logger; public class SortedLogRecovery { private static final Logger log = Logger.getLogger(SortedLogRecovery.class); + static class EmptyMapFileException extends Exception { + private static final long serialVersionUID = 1L; + + public EmptyMapFileException() { super(); } + } + public SortedLogRecovery() {} private enum Status { @@ -87,7 +93,12 @@ public class SortedLogRecovery { log.info("Looking at mutations from " + logfile + " for " + extent); MultiReader reader = new MultiReader(fs, conf, logfile); try { - tids[i] = findLastStartToFinish(reader, i, extent, tabletFiles, lastStartToFinish); + try { + tids[i] = findLastStartToFinish(reader, i, extent, tabletFiles, lastStartToFinish); + } catch (EmptyMapFileException ex) { + log.info("Ignoring empty map file " + logfile); + tids[i] = -1; + } } finally { try { reader.close(); @@ -117,13 +128,13 @@ public class SortedLogRecovery { } } - int findLastStartToFinish(MultiReader reader, int fileno, KeyExtent extent, Set tabletFiles, LastStartToFinish lastStartToFinish) throws IOException { + int findLastStartToFinish(MultiReader reader, int fileno, KeyExtent extent, Set tabletFiles, LastStartToFinish lastStartToFinish) throws IOException, EmptyMapFileException { // Scan for tableId for this extent (should always be in the log) LogFileKey key = new LogFileKey(); LogFileValue value = new LogFileValue(); int tid = -1; if (!reader.next(key, value)) - throw new RuntimeException("Unable to read log entries"); + throw new EmptyMapFileException(); if (key.event != OPEN) throw new RuntimeException("First log entry value is not OPEN");