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 4763AE0B6 for ; Mon, 11 Feb 2013 23:53:50 +0000 (UTC) Received: (qmail 52184 invoked by uid 500); 11 Feb 2013 23:53:50 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 52142 invoked by uid 500); 11 Feb 2013 23:53:50 -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 52130 invoked by uid 99); 11 Feb 2013 23:53:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 23:53:49 +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, 11 Feb 2013 23:53:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E213623889FA; Mon, 11 Feb 2013 23:53:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1444998 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactSelection.java Date: Mon, 11 Feb 2013 23:53:29 -0000 To: commits@hbase.apache.org From: eclark@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130211235329.E213623889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eclark Date: Mon Feb 11 23:53:29 2013 New Revision: 1444998 URL: http://svn.apache.org/r1444998 Log: HBASE-7821 Remove Duplicated code in CompactSelection Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactSelection.java Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactSelection.java URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactSelection.java?rev=1444998&r1=1444997&r2=1444998&view=diff ============================================================================== --- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactSelection.java (original) +++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactSelection.java Mon Feb 11 23:53:29 2013 @@ -58,43 +58,6 @@ public class CompactSelection { } /** - * Select the expired store files to compact - * - * @param maxExpiredTimeStamp - * The store file will be marked as expired if its max time stamp is - * less than this maxExpiredTimeStamp. - * @return A CompactSelection contains the expired store files as - * filesToCompact - */ - public CompactSelection selectExpiredStoreFilesToCompact( - long maxExpiredTimeStamp) { - if (filesToCompact == null || filesToCompact.size() == 0) - return null; - ArrayList expiredStoreFiles = null; - boolean hasExpiredStoreFiles = false; - CompactSelection expiredSFSelection = null; - - for (StoreFile storeFile : this.filesToCompact) { - if (storeFile.getReader().getMaxTimestamp() < maxExpiredTimeStamp) { - LOG.info("Deleting the expired store file by compaction: " - + storeFile.getPath() + " whose maxTimeStamp is " - + storeFile.getReader().getMaxTimestamp() - + " while the max expired timestamp is " + maxExpiredTimeStamp); - if (!hasExpiredStoreFiles) { - expiredStoreFiles = new ArrayList(); - hasExpiredStoreFiles = true; - } - expiredStoreFiles.add(storeFile); - } - } - - if (hasExpiredStoreFiles) { - expiredSFSelection = new CompactSelection(expiredStoreFiles); - } - return expiredSFSelection; - } - - /** * The current compaction finished, so reset the off peak compactions count * if this was an off peak compaction. */ @@ -163,10 +126,6 @@ public class CompactSelection { return selectionTime; } - public CompactSelection subList(int start, int end) { - throw new UnsupportedOperationException(); - } - public CompactSelection getSubList(int start, int end) { filesToCompact = filesToCompact.subList(start, end); return this; @@ -175,8 +134,4 @@ public class CompactSelection { public void clearSubList(int start, int end) { filesToCompact.subList(start, end).clear(); } - - private boolean isValidHour(int hour) { - return (hour >= 0 && hour <= 23); - } }