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 9CC4F102C5 for ; Tue, 29 Apr 2014 16:23:56 +0000 (UTC) Received: (qmail 47678 invoked by uid 500); 29 Apr 2014 16:23:55 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 47614 invoked by uid 500); 29 Apr 2014 16:23:55 -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 47605 invoked by uid 99); 29 Apr 2014 16:23:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 16:23:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A232D9957DD; Tue, 29 Apr 2014 16:23:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ecn@apache.org To: commits@accumulo.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: ACCUMULO-2749 make the DefaultKeySizeConstraint a bit more efficient Date: Tue, 29 Apr 2014 16:23:54 +0000 (UTC) Repository: accumulo Updated Branches: refs/heads/1.6.0-SNAPSHOT f5bcee7ae -> 62af17d52 ACCUMULO-2749 make the DefaultKeySizeConstraint a bit more efficient Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/62af17d5 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/62af17d5 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/62af17d5 Branch: refs/heads/1.6.0-SNAPSHOT Commit: 62af17d52e1a45b2dded8f7996318140c569eed2 Parents: f5bcee7 Author: Eric C. Newton Authored: Tue Apr 29 12:21:45 2014 -0400 Committer: Eric C. Newton Committed: Tue Apr 29 12:21:45 2014 -0400 ---------------------------------------------------------------------- .../accumulo/core/constraints/DefaultKeySizeConstraint.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/62af17d5/core/src/main/java/org/apache/accumulo/core/constraints/DefaultKeySizeConstraint.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/constraints/DefaultKeySizeConstraint.java b/core/src/main/java/org/apache/accumulo/core/constraints/DefaultKeySizeConstraint.java index b395067..88b7eea 100644 --- a/core/src/main/java/org/apache/accumulo/core/constraints/DefaultKeySizeConstraint.java +++ b/core/src/main/java/org/apache/accumulo/core/constraints/DefaultKeySizeConstraint.java @@ -41,9 +41,15 @@ public class DefaultKeySizeConstraint implements Constraint { return null; } + final static List NO_VIOLATIONS = new ArrayList(); + @Override public List check(Environment env, Mutation mutation) { + // fast size check + if (mutation.numBytes() < maxSize) + return NO_VIOLATIONS; + List violations = new ArrayList(); for (ColumnUpdate cu : mutation.getUpdates()) {