From commits-return-22050-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Tue Aug 28 05:51:15 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2863A180674 for ; Tue, 28 Aug 2018 05:51:14 +0200 (CEST) Received: (qmail 26230 invoked by uid 500); 28 Aug 2018 03:51:14 -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 26219 invoked by uid 99); 28 Aug 2018 03:51:13 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Aug 2018 03:51:13 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 5C02D82A1F; Tue, 28 Aug 2018 03:51:13 +0000 (UTC) Date: Tue, 28 Aug 2018 03:51:13 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] branch master updated: Remove warnings (#619) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153542827328.10472.4406844915855089515@gitbox.apache.org> From: ctubbsii@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: b7294b101a0da12fc66b6c8d23278aa2ada62b55 X-Git-Newrev: a24e379785f51b2e6f87530edfea7d79c27d966b X-Git-Rev: a24e379785f51b2e6f87530edfea7d79c27d966b X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/accumulo.git The following commit(s) were added to refs/heads/master by this push: new a24e379 Remove warnings (#619) a24e379 is described below commit a24e379785f51b2e6f87530edfea7d79c27d966b Author: Christopher Tubbs AuthorDate: Mon Aug 27 23:51:11 2018 -0400 Remove warnings (#619) * Remove unnecessary warnings suppression in FileOperations (also add missing overrides annotations here) * Remove potential resource leak in BCFile due to reusing a variable for a potentially new resource allocation without closing the previous one assigned to that variable; this wasn't really a problem because of the way we were passing the input stream into the decryptor to get a new input stream, but it could happen if that code were to change slightly * Remove unused instanceId from AuditedSecurityOperation * Remove unused zk variable from UnusedWALIT (also make the timeout scalable, like other ITs, in case of testing on a resource-limited machine) --- .../main/java/org/apache/accumulo/core/file/FileOperations.java | 5 ++++- .../java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java | 7 +++---- .../accumulo/server/security/AuditedSecurityOperation.java | 1 - test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java | 9 ++++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java b/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java index 25f9d73..cfa4d73 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java +++ b/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java @@ -124,7 +124,6 @@ public abstract class FileOperations { * .build(); * */ - @SuppressWarnings("unchecked") public ScanReaderBuilder newScanReaderBuilder() { return new ScanReaderBuilder(); } @@ -350,6 +349,7 @@ public abstract class FileOperations { return this; } + @Override public WriterBuilder withTableConfiguration(AccumuloConfiguration tableConfiguration) { tableConfiguration(tableConfiguration); return this; @@ -398,6 +398,7 @@ public abstract class FileOperations { return this; } + @Override public ReaderBuilder withTableConfiguration(AccumuloConfiguration tableConfiguration) { tableConfiguration(tableConfiguration); return this; @@ -489,6 +490,7 @@ public abstract class FileOperations { return this; } + @Override public IndexReaderBuilder withTableConfiguration(AccumuloConfiguration tableConfiguration) { tableConfiguration(tableConfiguration); return this; @@ -515,6 +517,7 @@ public abstract class FileOperations { return this; } + @Override public ScanReaderBuilder withTableConfiguration(AccumuloConfiguration tableConfiguration) { tableConfiguration(tableConfiguration); return this; diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java index 4b68600..060ac00 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java @@ -17,8 +17,6 @@ package org.apache.accumulo.core.file.rfile.bcfile; -import static org.apache.accumulo.core.security.crypto.impl.CryptoEnvironmentImpl.Scope; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Closeable; @@ -46,6 +44,7 @@ import org.apache.accumulo.core.security.crypto.CryptoUtils; import org.apache.accumulo.core.security.crypto.impl.CryptoEnvironmentImpl; import org.apache.accumulo.core.security.crypto.impl.NoFileDecrypter; import org.apache.accumulo.core.spi.crypto.CryptoEnvironment; +import org.apache.accumulo.core.spi.crypto.CryptoEnvironment.Scope; import org.apache.accumulo.core.spi.crypto.CryptoService; import org.apache.accumulo.core.spi.crypto.FileDecrypter; import org.apache.accumulo.core.spi.crypto.FileEncrypter; @@ -487,10 +486,10 @@ public final class BCFile { BoundedRangeFileInputStream boundedRangeFileInputStream = new BoundedRangeFileInputStream( fsin, this.region.getOffset(), this.region.getCompressedSize()); - InputStream inputStreamToBeCompressed = boundedRangeFileInputStream; try { - inputStreamToBeCompressed = decrypter.decryptStream(inputStreamToBeCompressed); + InputStream inputStreamToBeCompressed = decrypter + .decryptStream(boundedRangeFileInputStream); this.in = compressAlgo.createDecompressionStream(inputStreamToBeCompressed, decompressor, getFSInputBufferSize(conf)); } catch (IOException e) { diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java b/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java index b63aa48..93a8b36 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java @@ -71,7 +71,6 @@ public class AuditedSecurityOperation extends SecurityOperation { public static synchronized SecurityOperation getInstance(ServerContext context, boolean initialize) { if (instance == null) { - String instanceId = context.getInstanceID(); instance = new AuditedSecurityOperation(context, getAuthorizor(context, initialize), getAuthenticator(context, initialize), getPermHandler(context, initialize)); } diff --git a/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java b/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java index 7d4fe6d..52b5b0c 100644 --- a/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java +++ b/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java @@ -52,7 +52,10 @@ import com.google.common.collect.Iterators; // It would be useful to have an IT that will test this situation. public class UnusedWALIT extends ConfigurableMacBase { - private ZooReaderWriter zk; + @Override + protected int defaultTimeoutSeconds() { + return 120; + } @Override protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { @@ -65,7 +68,7 @@ public class UnusedWALIT extends ConfigurableMacBase { hadoopCoreSite.set("fs.namenode.fs-limits.min-block-size", Long.toString(logSize)); } - @Test(timeout = 2 * 60 * 1000) + @Test public void test() throws Exception { // don't want this bad boy cleaning up walog entries getCluster().getClusterControl().stop(ServerType.GARBAGE_COLLECTOR); @@ -79,7 +82,7 @@ public class UnusedWALIT extends ConfigurableMacBase { c.tableOperations().create(lilTable); ServerContext context = getServerContext(); - zk = new ZooReaderWriter(c.info().getZooKeepers(), c.info().getZooKeepersSessionTimeOut(), ""); + new ZooReaderWriter(c.info().getZooKeepers(), c.info().getZooKeepersSessionTimeOut(), ""); // put some data in a log that should be replayed for both tables writeSomeData(c, bigTable, 0, 10, 0, 10);