[accumulo] branch main updated: Fix warning and simplify ScannerBaseTest
This is an automated email from the ASF dual-hosted git repository. ctubbsii 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 74afbab Fix warning and simplify ScannerBaseTest 74afbab is described below commit 74afbabb06ba319cbb3968f30dcca58aa67fa070 Author: Christopher Tubbs AuthorDate: Wed Nov 18 20:41:16 2020 -0500 Fix warning and simplify ScannerBaseTest This simplifies the test added in #1765 and fixes the generics warning that was previously present there. --- .../accumulo/core/clientImpl/ScannerBaseTest.java | 125 - 1 file changed, 21 insertions(+), 104 deletions(-) diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerBaseTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerBaseTest.java index 3f62522..9761937 100644 --- a/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerBaseTest.java +++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerBaseTest.java @@ -18,123 +18,40 @@ */ package org.apache.accumulo.core.clientImpl; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.partialMockBuilder; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; import static org.junit.Assert.assertEquals; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; -import java.util.concurrent.TimeUnit; -import org.apache.accumulo.core.client.IteratorSetting; import org.apache.accumulo.core.client.ScannerBase; -import org.apache.accumulo.core.client.sample.SamplerConfiguration; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Value; -import org.apache.accumulo.core.security.Authorizations; -import org.apache.hadoop.io.Text; import org.junit.Test; public class ScannerBaseTest { @Test public void testScannerBaseForEach() throws Exception { - -// This subclass of ScannerBase contains a List that ScannerBase.forEach() can -// iterate over for testing purposes. -class MockScanner implements ScannerBase { - - Map map; - - MockScanner(Map map) { -this.map = map; - } - - @Override - public void addScanIterator(IteratorSetting cfg) {} - - @Override - public void removeScanIterator(String iteratorName) {} - - @Override - public void updateScanIteratorOption(String iteratorName, String key, String value) {} - - @Override - public void fetchColumnFamily(Text col) {} - - @Override - public void fetchColumn(Text colFam, Text colQual) {} - - @Override - public void fetchColumn(IteratorSetting.Column column) {} - - @Override - public void clearColumns() {} - - @Override - public void clearScanIterators() {} - - @Override - public Iterator> iterator() { -return this.map.entrySet().iterator(); - } - - @Override - public void setTimeout(long timeOut, TimeUnit timeUnit) {} - - @Override - public long getTimeout(TimeUnit timeUnit) { -return 0; - } - - @Override - public void close() {} - - @Override - public Authorizations getAuthorizations() { -return null; - } - - @Override - public void setSamplerConfiguration(SamplerConfiguration samplerConfig) {} - - @Override - public SamplerConfiguration getSamplerConfiguration() { -return null; - } - - @Override - public void clearSamplerConfiguration() {} - - @Override - public void setBatchTimeout(long timeOut, TimeUnit timeUnit) {} - - @Override - public long getBatchTimeout(TimeUnit timeUnit) { -return 0; - } - - @Override - public void setClassLoaderContext(String classLoaderContext) {} - - @Override - public void clearClassLoaderContext() {} - - @Override - public String getClassLoaderContext() { -return null; - } -} - -Map map = new HashMap<>(); -MockScanner ms = new MockScanner(Map -.of(new Key(new Text("a"), new Text("cf1"), new Text("cq1")), new Value(new Text("v1"; -Map.Entry entry = ms.iterator().next(); -// Test forEach from ScannerBase -ms.forEach((k, v) -> map.put(k, v)); - -for (Map.Entry e : map.entrySet()) { - assertEquals(entry.getKey(), e.getKey()); - assertEquals(entry.getValue(), e.getValue()); -} +Map expected = +Map.of(new Key("row1", "cf1", "cq1"), new Value("v1"), new Key("row2", "cf1", "cq1"), +new Value("v2"), new Key("row3", "cf1", "cq1"), new Value("v3")); + +// mock ScannerOptions subclass, because EasyMock can't mock ScannerBase, an interface; +// only the iterator method is mocked, because the forEach method should only call iterator() +ScannerBase scanner = + partialMock
[accumulo] branch main updated (8f688fd -> 6f75eea)
This is an automated email from the ASF dual-hosted git repository. dlmarion pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git. from 8f688fd Fix #1742 Add forEach to ScannerBase (#1765) add 6f75eea 1463 remove beanutils (#1786) No new revisions were added by this update. Summary of changes: assemble/pom.xml | 5 -- assemble/src/main/assemblies/component.xml | 1 - .../accumulo/core/client/ClientConfiguration.java | 26 +-- .../accumulo/core/conf/SiteConfiguration.java | 17 +++ .../accumulo/core/conf/SiteConfigurationTest.java | 3 ++ core/src/test/resources/accumulo2.properties | 2 + .../minicluster/MiniAccumuloClusterTest.java | 13 +++--- pom.xml| 7 --- start/pom.xml | 6 --- .../start/classloader/AccumuloClassLoader.java | 12 ++--- .../java/org/apache/accumulo/test/VolumeIT.java| 53 +++--- .../accumulo/test/metrics/MetricsFileTailer.java | 38 ++-- test/src/main/resources/log4j2-test.properties | 3 -- 13 files changed, 79 insertions(+), 107 deletions(-)
[accumulo] branch main updated (5cb30ed -> 8f688fd)
This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git. from 5cb30ed Utilize ServerContext in DeadServerList add 8f688fd Fix #1742 Add forEach to ScannerBase (#1765) No new revisions were added by this update. Summary of changes: .../apache/accumulo/core/client/ScannerBase.java | 14 +++ .../accumulo/core/clientImpl/ScannerBaseTest.java | 140 + .../apache/accumulo/test/functional/ScannerIT.java | 1 - 3 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerBaseTest.java
[accumulo-classloaders] branch main updated: New implementation of VFSClassLoader (#3)
This is an automated email from the ASF dual-hosted git repository. dlmarion pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo-classloaders.git The following commit(s) were added to refs/heads/main by this push: new 4c47fcc New implementation of VFSClassLoader (#3) 4c47fcc is described below commit 4c47fcc46c14a4d2a30b656f132524941abea32b Author: Dave Marion AuthorDate: Wed Nov 18 08:36:15 2020 -0500 New implementation of VFSClassLoader (#3) --- modules/classloaderfactory-substitute/.gitignore | 32 -- modules/classloaderfactory-substitute/pom.xml | 39 --- .../core/spi/common/ClassLoaderFactory.java| 61 modules/example-iterators-a/.classpath | 38 ++ modules/example-iterators-a/.gitignore | 1 + modules/example-iterators-a/.project | 23 ++ .../.settings/org.eclipse.core.resources.prefs | 6 + .../.settings/org.eclipse.jdt.core.prefs | 8 + .../.settings/org.eclipse.m2e.core.prefs | 4 + modules/example-iterators-a/pom.xml| 48 +++ .../classloader/vfs/examples/ExampleIterator.java | 87 + modules/example-iterators-b/.classpath | 38 ++ modules/example-iterators-b/.gitignore | 1 + modules/example-iterators-b/.project | 23 ++ .../.settings/org.eclipse.core.resources.prefs | 6 + .../.settings/org.eclipse.jdt.core.prefs | 8 + .../.settings/org.eclipse.m2e.core.prefs | 4 + modules/example-iterators-b/pom.xml| 48 +++ .../classloader/vfs/examples/ExampleIterator.java | 87 + modules/vfs-class-loader/README.md | 45 ++- modules/vfs-class-loader/TESTING.md| 251 ++ modules/vfs-class-loader/WIP.txt | 32 -- modules/vfs-class-loader/pom.xml | 59 +--- ...lassLoader.java => AccumuloVFSClassLoader.java} | 385 - .../accumulo/classloader/vfs/ClassPathPrinter.java | 4 +- .../classloader/vfs/VFSClassLoaderWrapper.java | 4 + .../accumulo/classloader/vfs/VFSManager.java | 158 - .../ReloadingVFSContextClassLoaderFactory.java | 128 +-- .../accumulo/classloader/vfs/AccumuloDFSBase.java | 51 ++- .../vfs/AccumuloVFSClassLoaderTest.java| 86 + .../classloader/vfs/ClassPathPrinterTest.java | 10 +- .../vfs/ReloadingVFSClassLoaderTest.java | 225 .../classloader/vfs/VfsClassLoaderTest.java| 21 +- .../ReloadingVFSContextClassLoaderFactoryTest.java | 153 +++- .../src/test/resources/log4j2-test.properties | 3 - .../new-context-configuration.json | 20 ++ pom.xml| 126 ++- 37 files changed, 1580 insertions(+), 743 deletions(-) diff --git a/modules/classloaderfactory-substitute/.gitignore b/modules/classloaderfactory-substitute/.gitignore deleted file mode 100644 index 3d5bdae..000 --- a/modules/classloaderfactory-substitute/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# 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. - -# Maven ignores -/target/ - -# IDE ignores -/.settings/ -/.project -/.classpath -/.pydevproject -/.idea -/*.iml -/*.ipr -/*.iws -/nbproject/ -/nbactions.xml -/nb-configuration.xml -.vscode/ -.factorypath diff --git a/modules/classloaderfactory-substitute/pom.xml b/modules/classloaderfactory-substitute/pom.xml deleted file mode 100644 index d5475fc..000 --- a/modules/classloaderfactory-substitute/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - -http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd";> - 4.0.0 - -org.apache.accumulo -classloader-extras -1.0.0-SNAPSHOT -../../pom.xml - - classloaderfactory-substitute - ClassloaderFactory substitute - This exists temporarily, until a version of Accumulo is published containing the required ClassloaderFactory interface - - ../../contrib/Eclipse-Accumulo-Codestyle.xml -true - -true - - diff --git a/modules/classloaderfac