Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-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 D567310C10 for ; Mon, 9 Sep 2013 19:40:00 +0000 (UTC) Received: (qmail 37199 invoked by uid 500); 9 Sep 2013 19:40:00 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 37175 invoked by uid 99); 9 Sep 2013 19:39:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 19:39:51 +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; Mon, 09 Sep 2013 19:39:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 349CD238888A; Mon, 9 Sep 2013 19:39:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1521264 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java Date: Mon, 09 Sep 2013 19:39:28 -0000 To: commits@lucene.apache.org From: shaie@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130909193928.349CD238888A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: shaie Date: Mon Sep 9 19:39:27 2013 New Revision: 1521264 URL: http://svn.apache.org/r1521264 Log: Make IndexFileDeleter.lastFiles a List instead of List> Modified: lucene/dev/branches/branch_4x/ (props changed) lucene/dev/branches/branch_4x/lucene/ (props changed) lucene/dev/branches/branch_4x/lucene/core/ (props changed) lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java?rev=1521264&r1=1521263&r2=1521264&view=diff ============================================================================== --- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java (original) +++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java Mon Sep 9 19:39:27 2013 @@ -91,7 +91,7 @@ final class IndexFileDeleter implements /* Holds files we had incref'd from the previous * non-commit checkpoint: */ - private List> lastFiles = new ArrayList>(); + private final List lastFiles = new ArrayList(); /* Commits that the IndexDeletionPolicy have decided to delete: */ private List commitsToDelete = new ArrayList(); @@ -360,14 +360,13 @@ final class IndexFileDeleter implements refresh(null); } + @Override public void close() throws IOException { // DecRef old files from the last checkpoint, if any: assert locked(); - int size = lastFiles.size(); - if (size > 0) { - for(int i=0;i lastFile : lastFiles) { - decRef(lastFile); - } + decRef(lastFiles); lastFiles.clear(); // Save files so we can decr on next checkpoint/commit: - lastFiles.add(segmentInfos.files(directory, false)); + lastFiles.addAll(segmentInfos.files(directory, false)); } if (infoStream.isEnabled("IFD")) { long t1 = System.nanoTime();