[accumulo] 01/02: Merge branch '1.9' into 2.0
This is an automated email from the ASF dual-hosted git repository. edcoleman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/accumulo.git commit 81027c047e0dcede854c0cb8c99fe8af9e3772c3 Merge: d04109d bfc4dcf Author: Ed Coleman AuthorDate: Thu Sep 5 16:02:17 2019 -0400 Merge branch '1.9' into 2.0 .../java/org/apache/accumulo/master/tableOps/compact/CompactRange.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/compact/CompactRange.java index 4de8a3e,000..f42e99e mode 100644,00..100644 --- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/compact/CompactRange.java +++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/compact/CompactRange.java @@@ -1,185 -1,0 +1,186 @@@ +/* + * 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.master.tableOps.compact; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Objects.requireNonNull; + +import java.util.List; + +import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.IteratorSetting; +import org.apache.accumulo.core.client.admin.CompactionStrategyConfig; +import org.apache.accumulo.core.clientImpl.AcceptableThriftTableOperationException; +import org.apache.accumulo.core.clientImpl.CompactionStrategyConfigUtil; +import org.apache.accumulo.core.clientImpl.thrift.TableOperation; +import org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType; +import org.apache.accumulo.core.data.NamespaceId; +import org.apache.accumulo.core.data.TableId; +import org.apache.accumulo.fate.Repo; +import org.apache.accumulo.fate.zookeeper.IZooReaderWriter; +import org.apache.accumulo.fate.zookeeper.IZooReaderWriter.Mutator; +import org.apache.accumulo.master.Master; +import org.apache.accumulo.master.tableOps.MasterRepo; +import org.apache.accumulo.master.tableOps.Utils; +import org.apache.accumulo.server.master.tableOps.UserCompactionConfig; +import org.apache.commons.codec.binary.Hex; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.io.WritableUtils; +import org.apache.zookeeper.KeeperException.NoNodeException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CompactRange extends MasterRepo { + private static final Logger log = LoggerFactory.getLogger(CompactRange.class); + + private static final long serialVersionUID = 1L; + private final TableId tableId; + private final NamespaceId namespaceId; + private byte[] startRow; + private byte[] endRow; + private byte[] config; + + public CompactRange(NamespaceId namespaceId, TableId tableId, byte[] startRow, byte[] endRow, + List iterators, CompactionStrategyConfig compactionStrategy) + throws AcceptableThriftTableOperationException { + +requireNonNull(namespaceId, "Invalid argument: null namespaceId"); +requireNonNull(tableId, "Invalid argument: null tableId"); +requireNonNull(iterators, "Invalid argument: null iterator list"); +requireNonNull(compactionStrategy, "Invalid argument: null compactionStrategy"); + +this.tableId = tableId; +this.namespaceId = namespaceId; +this.startRow = startRow.length == 0 ? null : startRow; +this.endRow = endRow.length == 0 ? null : endRow; + +if (iterators.size() > 0 +|| !compactionStrategy.equals(CompactionStrategyConfigUtil.DEFAULT_STRATEGY)) { + this.config = WritableUtils.toByteArray( + new UserCompactionConfig(this.startRow, this.endRow, iterators, compactionStrategy)); +} else { - log.info("No iterators or compaction strategy"); ++ log.debug( ++ "Using default compaction strategy. No user iterators or compaction strategy provided."); +} + +if (this.startRow != null && this.endRow != null +&& new Text(startRow).compareTo(new Text(endRow)) >= 0) + throw new AcceptableThriftTableOperationException(tableId.canonical(), null, + TableOperation.COMPACT, TableOperationExceptionType.BAD_RANGE, + "start row must be less than end
[accumulo] 01/02: Merge branch '1.9' into 2.0
This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch 2.0 in repository https://gitbox.apache.org/repos/asf/accumulo.git commit 365074266efa4f5fbe371c48f48f762138cb821f Merge: 6aa4c5f c0b94a2 Author: Christopher Tubbs AuthorDate: Fri Aug 16 15:10:07 2019 -0400 Merge branch '1.9' into 2.0 .../org/apache/accumulo/test/ShellServerIT.java| 30 +- 1 file changed, 7 insertions(+), 23 deletions(-)
[accumulo] 01/02: Merge branch '1.9' into 2.0
This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch 2.0 in repository https://gitbox.apache.org/repos/asf/accumulo.git commit 4e67b51dcadedecfdf70ab7f58cfffc10682513f Merge: a6b72c5 19bdeb4 Author: Christopher Tubbs AuthorDate: Thu Aug 15 22:31:45 2019 -0400 Merge branch '1.9' into 2.0 .../shell/commands/ImportDirectoryCommandTest.java | 79 +- .../org/apache/accumulo/test/ShellServerIT.java| 4 -- 2 files changed, 32 insertions(+), 51 deletions(-) diff --cc shell/src/test/java/org/apache/accumulo/shell/commands/ImportDirectoryCommandTest.java index 963d919,06694fd..556ad5a --- a/shell/src/test/java/org/apache/accumulo/shell/commands/ImportDirectoryCommandTest.java +++ b/shell/src/test/java/org/apache/accumulo/shell/commands/ImportDirectoryCommandTest.java @@@ -16,9 -16,13 +16,13 @@@ */ package org.apache.accumulo.shell.commands; + import static org.easymock.EasyMock.createMock; + import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.expectLastCall; + import static org.easymock.EasyMock.replay; + import static org.easymock.EasyMock.verify; -import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.AccumuloClient; import org.apache.accumulo.core.client.admin.TableOperations; import org.apache.accumulo.shell.Shell; import org.apache.commons.cli.CommandLine; @@@ -42,11 -46,15 +46,15 @@@ public class ImportDirectoryCommandTes // Initialize that internal state cmd.getOptions(); - client = EasyMock.createMock(AccumuloClient.class); - cli = EasyMock.createMock(CommandLine.class); - shellState = EasyMock.createMock(Shell.class); - tableOperations = EasyMock.createMock(TableOperations.class); -conn = createMock(Connector.class); ++client = createMock(AccumuloClient.class); + cli = createMock(CommandLine.class); + shellState = createMock(Shell.class); + tableOperations = createMock(TableOperations.class); + } + @After + public void verifyMocks() { -verify(conn, cli, shellState, tableOperations); ++verify(client, cli, shellState, tableOperations); } /** @@@ -57,33 -65,24 +65,24 @@@ */ @Test public void testOriginalCmdForm() throws Exception { - String[] cliArgs = {"in_dir", "fail_dir", "false"}; - // - // EasyMock.expect(cli.hasOption('t')).andReturn(false); - EasyMock.expect(cli.hasOption("t")).andReturn(false); + // no -t option, use current table context + expect(cli.hasOption("t")).andReturn(false).once(); + expect(shellState.getTableName()).andReturn("tablename").once(); - EasyMock.expect(cli.getArgs()).andReturn(cliArgs); - EasyMock.expect(cli.getArgs()).andReturn(cliArgs); - EasyMock.expect(cli.getArgs()).andReturn(cliArgs); - - EasyMock.expect(shellState.getAccumuloClient()).andReturn(client); - EasyMock.expect(shellState.getTableName()).andReturn("tablename"); + expect(cli.getArgs()).andReturn(cliArgs).atLeastOnce(); -expect(shellState.getConnector()).andReturn(conn).atLeastOnce(); -expect(conn.tableOperations()).andReturn(tableOperations); ++expect(shellState.getAccumuloClient()).andReturn(client).atLeastOnce(); ++expect(client.tableOperations()).andReturn(tableOperations); shellState.checkTableState(); - expectLastCall().andVoid(); - - // Table exists - EasyMock.expect(client.tableOperations()).andReturn(tableOperations); + expectLastCall().once(); tableOperations.importDirectory("tablename", "in_dir", "fail_dir", false); - expectLastCall().times(3); - - EasyMock.replay(client, cli, shellState, tableOperations); + expectLastCall().once(); -replay(conn, cli, shellState, tableOperations); ++replay(client, cli, shellState, tableOperations); cmd.execute("importdirectory in_dir fail_dir false", cli, shellState); - } /** @@@ -94,37 -93,23 +93,23 @@@ */ @Test public void testPassTableOptCmdForm() throws Exception { - String[] cliArgs = {"in_dir", "fail_dir", "false"}; - // - // EasyMock.expect(cli.hasOption('t')).andReturn(false); - EasyMock.expect(cli.hasOption("t")).andReturn(true); - EasyMock.expect(cli.hasOption("t")).andReturn(true); - EasyMock.expect(cli.getOptionValue("t")).andReturn("passedName"); + // -t option specified, table is from option + expect(cli.hasOption("t")).andReturn(true).once(); + expect(cli.getOptionValue("t")).andReturn("passedName").once(); + expect(tableOperations.exists("passedName")).andReturn(true).once(); - EasyMock.expect(tableOperations.exists("passedName")).andReturn(true); - EasyMock.expect(shellState.getAccumuloClient()).andReturn(client); - EasyMock.expect(client.tableOperations()).andReturn(tableOperations); + expect(cli.getArgs()).andReturn(cliArgs).atLeastOnce(); -
[accumulo] 01/02: Merge branch '1.9' into 2.0
This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch 2.0 in repository https://gitbox.apache.org/repos/asf/accumulo.git commit c7c6a64951b83b0a104478a82201b56693892a73 Merge: f49f627 e999681 Author: Christopher Tubbs AuthorDate: Sun Aug 4 11:18:41 2019 -0400 Merge branch '1.9' into 2.0 contrib/javadoc11.patch | 91 + 1 file changed, 91 insertions(+)
[accumulo] 01/02: Merge branch '1.9' into 2.0
This is an automated email from the ASF dual-hosted git repository. mmiller pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/accumulo.git commit b9cc1446aeffe558e93685a7f60d66464845be1e Merge: c2cfa19 fece0bb Author: Mike Miller AuthorDate: Wed Jul 24 18:34:36 2019 -0400 Merge branch '1.9' into 2.0 .../org/apache/accumulo/core/clientImpl/TableOperationsImpl.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --cc core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java index 61bfb09,000..f9e5af2 mode 100644,00..100644 --- a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java +++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java @@@ -1,1924 -1,0 +1,1924 @@@ +/* + * 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.core.clientImpl; + +import static com.google.common.base.Preconditions.checkArgument; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Objects.requireNonNull; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.stream.Collectors.toSet; +import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.ByteBuffer; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Random; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Predicate; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.client.IteratorSetting; +import org.apache.accumulo.core.client.NamespaceExistsException; +import org.apache.accumulo.core.client.NamespaceNotFoundException; +import org.apache.accumulo.core.client.Scanner; +import org.apache.accumulo.core.client.TableDeletedException; +import org.apache.accumulo.core.client.TableExistsException; +import org.apache.accumulo.core.client.TableNotFoundException; +import org.apache.accumulo.core.client.TableOfflineException; +import org.apache.accumulo.core.client.admin.CompactionConfig; +import org.apache.accumulo.core.client.admin.DiskUsage; +import org.apache.accumulo.core.client.admin.FindMax; +import org.apache.accumulo.core.client.admin.Locations; +import org.apache.accumulo.core.client.admin.NewTableConfiguration; +import org.apache.accumulo.core.client.admin.SummaryRetriever; +import org.apache.accumulo.core.client.admin.TableOperations; +import org.apache.accumulo.core.client.sample.SamplerConfiguration; +import org.apache.accumulo.core.client.summary.SummarizerConfiguration; +import org.apache.accumulo.core.client.summary.Summary; +import org.apache.accumulo.core.clientImpl.TabletLocator.TabletLocation; +import org.apache.accumulo.core.clientImpl.bulk.BulkImport; +import org.apache.accumulo.core.clientImpl.thrift.ClientService.Client; +import org.apache.accumulo.core.clientImpl.thrift.TDiskUsage; +import org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException; +import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException; +import