From commits-return-25023-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Fri Jun 4 17:31:18 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 86BCB18066B for ; Fri, 4 Jun 2021 19:31:18 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 0178F5FF98 for ; Fri, 4 Jun 2021 17:31:17 +0000 (UTC) Received: (qmail 41884 invoked by uid 500); 4 Jun 2021 17:31:17 -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 41875 invoked by uid 99); 4 Jun 2021 17:31:17 -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; Fri, 04 Jun 2021 17:31:17 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id ED72181A86; Fri, 4 Jun 2021 17:31:16 +0000 (UTC) Date: Fri, 04 Jun 2021 17:31:16 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] branch main updated: Fix crypto in SplitLarge utility (#2145) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <162282787671.10583.9988975433162501443@gitbox.apache.org> From: mmiller@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Oldrev: 4c9ab5a8b765e3ac7e889abcf4238e0b8aa2eca9 X-Git-Newrev: 512325e1ab14351df7722ca1956b14c42fff90d7 X-Git-Rev: 512325e1ab14351df7722ca1956b14c42fff90d7 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. mmiller pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git The following commit(s) were added to refs/heads/main by this push: new 512325e Fix crypto in SplitLarge utility (#2145) 512325e is described below commit 512325e1ab14351df7722ca1956b14c42fff90d7 Author: Mike Miller AuthorDate: Fri Jun 4 13:31:01 2021 -0400 Fix crypto in SplitLarge utility (#2145) * The option that was added in 2.0 for the encryption only included the name of the service. You also need a way to pass in other options for it to work. This change just simplifies that by removing the option altogether and reading the config from classpath, similar to other utilities. --- .../org/apache/accumulo/core/file/rfile/SplitLarge.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/SplitLarge.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/SplitLarge.java index f0ca7da..580c68d 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/SplitLarge.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/SplitLarge.java @@ -21,10 +21,8 @@ package org.apache.accumulo.core.file.rfile; import java.util.ArrayList; import java.util.List; -import org.apache.accumulo.core.cli.Help; +import org.apache.accumulo.core.cli.ConfigOpts; import org.apache.accumulo.core.conf.AccumuloConfiguration; -import org.apache.accumulo.core.conf.ConfigurationTypeHelper; -import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.crypto.CryptoServiceFactory; import org.apache.accumulo.core.data.Key; @@ -46,12 +44,10 @@ import com.beust.jcommander.Parameter; */ public class SplitLarge { - static class Opts extends Help { + static class Opts extends ConfigOpts { @Parameter(names = "-m", description = "the maximum size of the key/value pair to shunt to the small file") long maxSize = 10 * 1024 * 1024; - @Parameter(names = "-crypto", description = "the class to perform encryption/decryption") - String cryptoClass = Property.INSTANCE_CRYPTO_SERVICE.getDefaultValue(); @Parameter(description = " { ... }") List files = new ArrayList<>(); } @@ -63,9 +59,9 @@ public class SplitLarge { opts.parseArgs(SplitLarge.class.getName(), args); for (String file : opts.files) { - AccumuloConfiguration aconf = DefaultConfiguration.getInstance(); - CryptoService cryptoService = ConfigurationTypeHelper.getClassInstance(null, opts.cryptoClass, - CryptoService.class, CryptoServiceFactory.newDefaultInstance()); + AccumuloConfiguration aconf = opts.getSiteConfiguration(); + CryptoService cryptoService = + CryptoServiceFactory.newInstance(aconf, CryptoServiceFactory.ClassloaderType.JAVA); Path path = new Path(file); CachableBuilder cb = new CachableBuilder().fsPath(fs, path).conf(conf).cryptoService(cryptoService);