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 71AB717D6F for ; Fri, 26 Sep 2014 17:18:34 +0000 (UTC) Received: (qmail 43629 invoked by uid 500); 26 Sep 2014 17:18:34 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 43521 invoked by uid 500); 26 Sep 2014 17:18:34 -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 43429 invoked by uid 99); 26 Sep 2014 17:18:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2014 17:18:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F0F5D9B3240; Fri, 26 Sep 2014 17:18:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Fri, 26 Sep 2014 17:18:35 -0000 Message-Id: <01212645121747d38b4f831c2fb1dfc2@git.apache.org> In-Reply-To: <62f51ef6f74449b8a3bfe1671cf15ead@git.apache.org> References: <62f51ef6f74449b8a3bfe1671cf15ead@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] git commit: Merge branch '1.6.2-SNAPSHOT' Merge branch '1.6.2-SNAPSHOT' Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/15ca1007 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/15ca1007 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/15ca1007 Branch: refs/heads/master Commit: 15ca1007adea80b6f4beb9018c5011597da0906a Parents: ed33776 b9a0b27 Author: Josh Elser Authored: Fri Sep 26 13:18:18 2014 -0400 Committer: Josh Elser Committed: Fri Sep 26 13:18:18 2014 -0400 ---------------------------------------------------------------------- .../accumulo/test/BadDeleteMarkersCreatedIT.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/15ca1007/test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java ---------------------------------------------------------------------- diff --cc test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java index 7d032c1,0000000..6b5fb70 mode 100644,000000..100644 --- a/test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java +++ b/test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java @@@ -1,80 -1,0 +1,94 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.test; + +import java.util.Map.Entry; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.Scanner; +import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.metadata.MetadataTable; +import org.apache.accumulo.core.metadata.schema.MetadataSchema; +import org.apache.accumulo.core.security.Authorizations; +import org.apache.accumulo.core.util.UtilWaitThread; +import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; +import org.apache.accumulo.test.functional.ConfigurableMacIT; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.io.Text; +import org.junit.Assert; ++import org.junit.Before; +import org.junit.Test; + +// Accumulo3047 +public class BadDeleteMarkersCreatedIT extends ConfigurableMacIT { + + @Override + public int defaultTimeoutSeconds() { + return 60; + } + + @Override + public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { + cfg.setNumTservers(1); + cfg.setProperty(Property.GC_CYCLE_DELAY, "1s"); + cfg.setProperty(Property.GC_CYCLE_START, "0s"); + } + ++ private int timeoutFactor = 1; ++ ++ @Before ++ public void setup() { ++ try { ++ timeoutFactor = Integer.parseInt(System.getProperty("timeout.factor")); ++ } catch (NumberFormatException e) { ++ log.warn("Could not parse integer from timeout.factor"); ++ } ++ ++ Assert.assertTrue("timeout.factor must be greater than or equal to 1", timeoutFactor >= 1); ++ } ++ + @Test + public void test() throws Exception { + // make a table + String tableName = getUniqueNames(1)[0]; + Connector c = getConnector(); + c.tableOperations().create(tableName); + // add some splits + SortedSet splits = new TreeSet(); + for (int i = 0; i < 10; i++) { + splits.add(new Text("" + i)); + } + c.tableOperations().addSplits(tableName, splits); + // get rid of all the splits + c.tableOperations().deleteRows(tableName, null, null); + // get rid of the table + c.tableOperations().delete(tableName); + // let gc run - UtilWaitThread.sleep(5 * 1000); ++ UtilWaitThread.sleep(timeoutFactor * 5 * 1000); + // look for delete markers + Scanner scanner = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY); + scanner.setRange(MetadataSchema.DeletesSection.getRange()); + for (Entry entry : scanner) { + Assert.fail(entry.getKey().getRow().toString()); + } + } + +}