[accumulo] branch 1.9 updated (6ec00cf -> a3793e6)

2019-02-26 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a change to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git.


from 6ec00cf  Add logging for slow file permits requests. (#978) (#981)
 new acd2d9f  Improve log4j lookup (#919)
 new a3793e6  Clean up accumulo script

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 assemble/bin/accumulo | 37 +
 1 file changed, 17 insertions(+), 20 deletions(-)



[accumulo] 01/01: Merge branch '1.9'

2019-02-26 Thread ctubbsii
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

commit d70a29fd5161c21bb268264070533fd05a607fb6
Merge: ba6d5e1 a3793e6
Author: Christopher Tubbs 
AuthorDate: Tue Feb 26 19:47:19 2019 -0500

Merge branch '1.9'

 assemble/bin/accumulo | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --cc assemble/bin/accumulo
index 895adac,cad9c9e..4f23770
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@@ -15,61 -15,174 +15,61 @@@
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
 -# Start: Resolve Script Directory
 -SOURCE="${BASH_SOURCE[0]}"
 -while [[ -h "${SOURCE}" ]]; do # resolve $SOURCE until the file is no longer 
a symlink
 -   bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
 -   SOURCE="$(readlink "${SOURCE}")"
 -   [[ "${SOURCE}" != /* ]] && SOURCE="${bin}/${SOURCE}" # if $SOURCE was a 
relative symlink, we need to resolve it relative to the path where the symlink 
file was located
 -done
 -bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
 -# Stop: Resolve Script Directory
 -
 -. "${bin}"/config.sh
 -
 -START_JAR="${ACCUMULO_HOME}/lib/accumulo-start.jar"
 -
 -#
 -# Resolve a program to its installation directory
 -#
 -locationByProgram()
 -{
 -   RESULT=$(type -P "$1")
 -   if [[ -z "${RESULT}" ]]; then
 -  echo "Cannot find '$1' and '$2' is not set in 
$ACCUMULO_CONF_DIR/accumulo-env.sh"
 -  exit 1
 -   fi
 -   while [[ -h "${RESULT}" ]]; do # resolve $RESULT until the file is no 
longer a symlink
 -  DIR="$( cd -P "$( dirname "$RESULT" )" && pwd )"
 -  RESULT="$(readlink "${RESULT}")"
 -  [[ "${RESULT}" != /* ]] && RESULT="${DIR}/${RESULT}" # if $RESULT was a 
relative symlink, we need to resolve it relative to the path where the symlink 
file was located
 -   done
 -   # find the relative home directory, accounting for an extra bin directory
 -   RESULT=$(dirname "$(dirname "${RESULT}")")
 -   echo "Auto-set ${2} to '${RESULT}'.  To suppress this message, set ${2} in 
conf/accumulo-env.sh"
 -   eval "${2}=${RESULT}"
 +function main() {
 +
 +  SOURCE="${BASH_SOURCE[0]}"
-   while [ -h "${SOURCE}" ]; do
++  while [[ -h "${SOURCE}" ]]; do
 + bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
 + SOURCE="$(readlink "${SOURCE}")"
 + [[ "${SOURCE}" != /* ]] && SOURCE="${bin}/${SOURCE}"
 +  done
 +  # Set up variables needed by accumulo-env.sh
-   export bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
-   export basedir=$( cd -P "${bin}"/.. && pwd )
++  bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"; export bin
++  basedir=$( cd -P "${bin}"/.. && pwd ); export basedir
 +  export conf="${ACCUMULO_CONF_DIR:-${basedir}/conf}"
 +  export lib="${basedir}/lib"
 +  export cmd="$1"
 +
 +  if [[ -z $conf || ! -d $conf ]]; then
 +echo "$conf is not a valid directory.  Please make sure it exists"
 +exit 1
 +  fi
 +  if [[ ! -f "$conf/accumulo-env.sh" ]]; then
 +echo "accumulo-env.sh must exist in $conf"
 +exit 1
 +  fi
 +  source "$conf/accumulo-env.sh"
 +
 +  # Accumulo is moving away from these variables but they still might be 
needed
 +  export ACCUMULO_HOME="$basedir"
 +  export ACCUMULO_CONF_DIR="$conf"
 +
 +  # Verify setting in accumulo-env.sh
 +  : "${JAVA_OPTS:?"variable is not set in accumulo-env.sh"}"
 +  : "${CLASSPATH:?"variable is not set in accumulo-env.sh"}"
 +  : "${ACCUMULO_LOG_DIR:?"variable is not set in accumulo-env.sh"}"
 +  mkdir -p "${ACCUMULO_LOG_DIR}" 2>/dev/null
 +  : "${MALLOC_ARENA_MAX:?"variable is not set in accumulo-env.sh"}"
 +
 +  if [[ $cmd == "classpath" ]]; then
 +echo "$CLASSPATH"
 +exit 0
 +  fi
 +
 +  if [[ -x "$JAVA_HOME/bin/java" ]]; then
 +JAVA="$JAVA_HOME/bin/java"
 +  else
- JAVA=$(which java)
++JAVA=$(type -P java)
 +  fi
 +  if [[ ! -x "$JAVA" ]]; then
 +echo "Could not find any executable java binary. Please set java on your 
PATH or set JAVA_HOME"
 +exit 1
 +  fi
 +  if [[ -n "$ACCUMULO_JAVA_PREFIX" ]]; then
- JAVA=($ACCUMULO_JAVA_PREFIX $JAVA)
++JAVA=("${ACCUMULO_JAVA_PREFIX[*]}" "$JAVA")
 +  fi
 +
 +  exec "${JAVA[@]}" "${JAVA_OPTS[@]}" org.apache.accumulo.start.Main "$@"
  }
  
 -test -z "${JAVA_HOME}"  && locationByProgram java JAVA_HOME
 -test -z "${HADOOP_PREFIX}"  && locationByProgram hadoop HADOOP_PREFIX
 -test -z "${ZOOKEEPER_HOME}" && locationByProgram zkCli.sh ZOOKEEPER_HOME
 -
 -#
 -# ACCUMULO_XTRAJARS is where all of the commandline -add items go into for 
reading by accumulo.
 -# It also holds the JAR run with the jar command and, if possible, any items 
in the JAR manifest's Class-Path.
 -#
 -if [[ "$1" = "-add" ]]; then
 -export ACCUMULO_XTRAJARS="$2"
 -shift 2
 -else
 -export ACCUMULO_XTRAJARS=""
 -fi
 -if [[ "$1" = "jar" && -f "$2" ]]; then
 -if [[ $2 =~ ^/ ]]; then
 -  jardir="$(dirname "$2")"
 -  jarfile="$2"
 -else

[accumulo] 02/02: Clean up accumulo script

2019-02-26 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit a3793e68cc9eb5f351514c32bd750d2602e681d1
Author: Christopher Tubbs 
AuthorDate: Tue Feb 26 19:38:20 2019 -0500

Clean up accumulo script

Use regex when finding log4j jar
Fix issues identified by shellcheck
---
 assemble/bin/accumulo | 37 +
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/assemble/bin/accumulo b/assemble/bin/accumulo
index 71dc471..cad9c9e 100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@ -17,13 +17,12 @@
 
 # Start: Resolve Script Directory
 SOURCE="${BASH_SOURCE[0]}"
-while [ -h "${SOURCE}" ]; do # resolve $SOURCE until the file is no longer a 
symlink
+while [[ -h "${SOURCE}" ]]; do # resolve $SOURCE until the file is no longer a 
symlink
bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
SOURCE="$(readlink "${SOURCE}")"
[[ "${SOURCE}" != /* ]] && SOURCE="${bin}/${SOURCE}" # if $SOURCE was a 
relative symlink, we need to resolve it relative to the path where the symlink 
file was located
 done
 bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
-script=$( basename "${SOURCE}" )
 # Stop: Resolve Script Directory
 
 . "${bin}"/config.sh
@@ -35,12 +34,12 @@ START_JAR="${ACCUMULO_HOME}/lib/accumulo-start.jar"
 #
 locationByProgram()
 {
-   RESULT=$( which "$1" )
-   if [[ "$?" != 0 && -z "${RESULT}" ]]; then
+   RESULT=$(type -P "$1")
+   if [[ -z "${RESULT}" ]]; then
   echo "Cannot find '$1' and '$2' is not set in 
$ACCUMULO_CONF_DIR/accumulo-env.sh"
   exit 1
fi
-   while [ -h "${RESULT}" ]; do # resolve $RESULT until the file is no longer 
a symlink
+   while [[ -h "${RESULT}" ]]; do # resolve $RESULT until the file is no 
longer a symlink
   DIR="$( cd -P "$( dirname "$RESULT" )" && pwd )"
   RESULT="$(readlink "${RESULT}")"
   [[ "${RESULT}" != /* ]] && RESULT="${DIR}/${RESULT}" # if $RESULT was a 
relative symlink, we need to resolve it relative to the path where the symlink 
file was located
@@ -55,19 +54,17 @@ test -z "${JAVA_HOME}"  && locationByProgram java 
JAVA_HOME
 test -z "${HADOOP_PREFIX}"  && locationByProgram hadoop HADOOP_PREFIX
 test -z "${ZOOKEEPER_HOME}" && locationByProgram zkCli.sh ZOOKEEPER_HOME
 
-DEFAULT_GENERAL_JAVA_OPTS=""
-
 #
 # ACCUMULO_XTRAJARS is where all of the commandline -add items go into for 
reading by accumulo.
 # It also holds the JAR run with the jar command and, if possible, any items 
in the JAR manifest's Class-Path.
 #
-if [ "$1" = "-add" ] ; then
+if [[ "$1" = "-add" ]]; then
 export ACCUMULO_XTRAJARS="$2"
 shift 2
 else
 export ACCUMULO_XTRAJARS=""
 fi
-if [ "$1" = "jar" -a -f "$2" ] ; then
+if [[ "$1" = "jar" && -f "$2" ]]; then
 if [[ $2 =~ ^/ ]]; then
   jardir="$(dirname "$2")"
   jarfile="$2"
@@ -77,9 +74,9 @@ if [ "$1" = "jar" -a -f "$2" ] ; then
 fi
 if jar tf "$jarfile" | grep -q META-INF/MANIFEST.MF ; then
   cp="$(unzip -p "$jarfile" META-INF/MANIFEST.MF | grep ^Class-Path: | sed 
's/^Class-Path: *//')"
-  if [[ -n "$cp" ]] ; then
+  if [[ -n "$cp" ]]; then
  for j in $cp; do
-if [[ "$j" != "Class-Path:" ]] ; then
+if [[ "$j" != "Class-Path:" ]]; then
ACCUMULO_XTRAJARS="${jardir}/${j},$ACCUMULO_XTRAJARS"
 fi
  done
@@ -91,11 +88,11 @@ fi
 #
 # Set up -D switches for JAAS and Kerberos if env variables set
 #
-if [[ ! -z ${ACCUMULO_JAAS_CONF} ]]; then
+if [[ -n ${ACCUMULO_JAAS_CONF} ]]; then
   ACCUMULO_GENERAL_OPTS="${ACCUMULO_GENERAL_OPTS} 
-Djava.security.auth.login.config=${ACCUMULO_JAAS_CONF}"
 fi
 
-if [[ ! -z ${ACCUMULO_KRB5_CONF} ]]; then
+if [[ -n ${ACCUMULO_KRB5_CONF} ]]; then
   ACCUMULO_GENERAL_OPTS="${ACCUMULO_GENERAL_OPTS} 
-Djava.security.krb5.conf=${ACCUMULO_KRB5_CONF}"
 fi
 
@@ -112,12 +109,12 @@ shell)   export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} 
${ACCUMULO_SHELL_OPTS}"
 esac
 
 XML_FILES="${ACCUMULO_CONF_DIR}"
-LOG4J_JAR=$(find -H "${HADOOP_PREFIX}/lib" 
"${HADOOP_PREFIX}"/share/hadoop/common/lib -name 'log4j*.jar' -not -name 
'log4j-core*.jar' -print 2>/dev/null | head -1)
+LOG4J_JAR=$(find -H "${HADOOP_PREFIX}/lib" 
"${HADOOP_PREFIX}"/share/hadoop/common/lib -regex '.*/log4j-[0-9.]*[.]jar$' 
-print 2>/dev/null | head -1)
 
SLF4J_JARS="${ACCUMULO_HOME}/lib/slf4j-api.jar:${ACCUMULO_HOME}/lib/slf4j-log4j12.jar"
 
 # The `find` command could fail for environmental reasons or bad configuration
 # Avoid trying to run Accumulo when we can't find the jar
-if [ -z "${LOG4J_JAR}" -a -z "${CLASSPATH}" ]; then
+if [[ -z "${LOG4J_JAR}" && -z "${CLASSPATH}" ]]; then
echo "Could not locate Log4j jar in Hadoop installation at ${HADOOP_PREFIX}"
exit 1
 fi
@@ -128,15 +125,15 @@ else
   CLASSPATH="${XML_FILES}:${START_JAR}:${SLF4J_JARS}:${LOG4J_JAR}"
 fi
 
-if [ -z "${JAVA_HOME}" -o ! -d "${JAVA_HOME}" ]; then

[accumulo] branch master updated (ba6d5e1 -> d70a29f)

2019-02-26 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git.


from ba6d5e1  Split IteratorUtil up into 2 non-API classes (#986)
 new acd2d9f  Improve log4j lookup (#919)
 new a3793e6  Clean up accumulo script
 new d70a29f  Merge branch '1.9'

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 assemble/bin/accumulo | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)



[accumulo] 01/02: Improve log4j lookup (#919)

2019-02-26 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit acd2d9f73b18be9b55e1ea91490a695d4b44ff85
Author: Le Dai <726575...@qq.com>
AuthorDate: Fri Jan 25 09:19:13 2019 +0800

Improve log4j lookup (#919)

Look for log4j-1.2.17.jar instead of log4j-core-*.jar
---
 assemble/bin/accumulo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/assemble/bin/accumulo b/assemble/bin/accumulo
index 18e0571..71dc471 100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@ -112,7 +112,7 @@ shell)   export ACCUMULO_OPTS="${ACCUMULO_GENERAL_OPTS} 
${ACCUMULO_SHELL_OPTS}"
 esac
 
 XML_FILES="${ACCUMULO_CONF_DIR}"
-LOG4J_JAR=$(find -H "${HADOOP_PREFIX}/lib" 
"${HADOOP_PREFIX}"/share/hadoop/common/lib -name 'log4j*.jar' -print 
2>/dev/null | head -1)
+LOG4J_JAR=$(find -H "${HADOOP_PREFIX}/lib" 
"${HADOOP_PREFIX}"/share/hadoop/common/lib -name 'log4j*.jar' -not -name 
'log4j-core*.jar' -print 2>/dev/null | head -1)
 
SLF4J_JARS="${ACCUMULO_HOME}/lib/slf4j-api.jar:${ACCUMULO_HOME}/lib/slf4j-log4j12.jar"
 
 # The `find` command could fail for environmental reasons or bad configuration



[accumulo] branch master updated: Split IteratorUtil up into 2 non-API classes (#986)

2019-02-26 Thread mmiller
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


The following commit(s) were added to refs/heads/master by this push:
 new ba6d5e1  Split IteratorUtil up into 2 non-API classes (#986)
ba6d5e1 is described below

commit ba6d5e100aff11177e09b5285e42de58f435144a
Author: Mike Miller 
AuthorDate: Tue Feb 26 17:03:41 2019 -0500

Split IteratorUtil up into 2 non-API classes (#986)

* Moved methods not useful to users to non-API classes
* Created IterConfigUtil and SystemIteratorUtil for internal use
* Cleaned up loadIterators methods and created IterLoad class to assist
* Remove Generics from IterConfigUtil and other minor improvements
---
 .../core/client/ClientSideIteratorScanner.java |  12 +-
 .../core/client/admin/NewTableConfiguration.java   |   4 +-
 .../accumulo/core/client/rfile/RFileScanner.java   |  17 +-
 .../accumulo/core/clientImpl/OfflineIterator.java  |  16 +-
 .../core/clientImpl/TableOperationsImpl.java   |   4 +-
 .../apache/accumulo/core/conf/IterConfigUtil.java  | 261 ++
 .../org/apache/accumulo/core/conf/IterLoad.java|  66 
 .../accumulo/core/iterators/IteratorUtil.java  | 400 +
 .../accumulo/core/util/SystemIteratorUtil.java | 110 ++
 .../IterConfigUtilTest.java}   |  58 +--
 .../accumulo/server/conf/TableConfiguration.java   |  12 +-
 .../apache/accumulo/master/FateServiceHandler.java |   4 +-
 .../accumulo/tserver/ConditionCheckerContext.java  |  12 +-
 .../apache/accumulo/tserver/tablet/Compactor.java  |   6 +-
 .../accumulo/tserver/tablet/ScanDataSource.java|  13 +-
 .../shell/commands/CreateTableCommand.java |   4 +-
 .../test/performance/scan/CollectTabletStats.java  |  10 +-
 17 files changed, 540 insertions(+), 469 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
 
b/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
index c666b1d..f928f6a 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
@@ -31,6 +31,8 @@ import java.util.concurrent.TimeUnit;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.sample.SamplerConfiguration;
 import org.apache.accumulo.core.clientImpl.ScannerOptions;
+import org.apache.accumulo.core.conf.IterConfigUtil;
+import org.apache.accumulo.core.conf.IterLoad;
 import org.apache.accumulo.core.data.ArrayByteSequence;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Column;
@@ -40,7 +42,6 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.dataImpl.thrift.IterInfo;
 import org.apache.accumulo.core.iterators.IteratorAdapter;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
-import org.apache.accumulo.core.iterators.IteratorUtil;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.security.Authorizations;
@@ -247,10 +248,11 @@ public class ClientSideIteratorScanner extends 
ScannerOptions implements Scanner
 
 SortedKeyValueIterator skvi;
 try {
-  skvi = IteratorUtil.loadIterators(smi, tm.values(), 
serverSideIteratorOptions,
-  new ClientSideIteratorEnvironment(getSamplerConfiguration() != null,
-  getIteratorSamplerConfigurationInternal()),
-  false, null);
+  IteratorEnvironment env = new 
ClientSideIteratorEnvironment(getSamplerConfiguration() != null,
+  getIteratorSamplerConfigurationInternal());
+  IterLoad iterLoad = new 
IterLoad().iters(tm.values()).iterOpts(serverSideIteratorOptions)
+  .iterEnv(env).useAccumuloClassLoader(false);
+  skvi = IterConfigUtil.loadIterators(smi, iterLoad);
 } catch (IOException e) {
   throw new RuntimeException(e);
 }
diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java
 
b/core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java
index 48849a3..f4b1d8e 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java
@@ -36,8 +36,8 @@ import 
org.apache.accumulo.core.client.sample.SamplerConfiguration;
 import org.apache.accumulo.core.client.summary.Summarizer;
 import org.apache.accumulo.core.client.summary.SummarizerConfiguration;
 import org.apache.accumulo.core.clientImpl.TableOperationsHelper;
+import org.apache.accumulo.core.conf.IterConfigUtil;
 import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.iterators.IteratorUtil;
 

[accumulo] branch master updated: More try-with-resources BatchWriter updates (#989)

2019-02-26 Thread mwalch
This is an automated email from the ASF dual-hosted git repository.

mwalch 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 64a33c8  More try-with-resources BatchWriter updates (#989)
64a33c8 is described below

commit 64a33c8a41ebf9c4cb8dea42a50b3cf01567db02
Author: Mike Walch 
AuthorDate: Tue Feb 26 10:26:03 2019 -0500

More try-with-resources BatchWriter updates (#989)
---
 .../accumulo/test/functional/BloomFilterIT.java| 11 ++-
 .../accumulo/test/functional/CloneTestIT.java  |  3 +-
 .../test/functional/KerberosRenewalIT.java | 11 ++-
 .../accumulo/test/functional/LargeRowIT.java   | 27 +++-
 .../test/functional/ManyWriteAheadLogsIT.java  |  6 +-
 .../test/functional/MasterAssignmentIT.java| 11 ++-
 .../apache/accumulo/test/functional/MergeIT.java   | 39 ++-
 .../accumulo/test/functional/PermissionsIT.java| 39 +--
 .../accumulo/test/functional/ReadWriteIT.java  | 14 ++--
 .../apache/accumulo/test/functional/ScanIdIT.java  |  7 +-
 .../accumulo/test/functional/ScanIteratorIT.java   | 36 --
 .../accumulo/test/functional/ScanRangeIT.java  | 25 +++
 .../test/functional/ScanSessionTimeOutIT.java  | 17 ++---
 .../accumulo/test/functional/ScannerContextIT.java | 49 +++---
 .../apache/accumulo/test/functional/ScannerIT.java | 15 ++--
 .../test/functional/ServerSideErrorIT.java | 14 ++--
 .../test/functional/SessionBlockVerifyIT.java  | 17 ++---
 .../test/functional/SessionDurabilityIT.java   | 12 ++--
 .../test/functional/SparseColumnFamilyIT.java  | 30 
 .../apache/accumulo/test/functional/SummaryIT.java | 14 ++--
 .../apache/accumulo/test/functional/TabletIT.java  | 18 +++--
 .../functional/TabletStateChangeIteratorIT.java| 12 ++--
 .../apache/accumulo/test/functional/TimeoutIT.java | 18 +++--
 .../accumulo/test/functional/TooManyDeletesIT.java |  7 +-
 .../accumulo/test/functional/VisibilityIT.java | 79 ++
 .../accumulo/test/functional/WALSunnyDayIT.java| 32 -
 .../test/functional/ZookeeperRestartIT.java| 10 +--
 27 files changed, 253 insertions(+), 320 deletions(-)

diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
index e329fa4..3ede1ba 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
@@ -28,7 +28,6 @@ import java.util.Random;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.conf.Property;
@@ -95,11 +94,11 @@ public class BloomFilterIT extends AccumuloClusterHarness {
 log.info("Writing complete");
 
 // test inserting an empty key
-BatchWriter bw = c.createBatchWriter(tables[3], new 
BatchWriterConfig());
-Mutation m = new Mutation(new Text(""));
-m.put(new Text(""), new Text(""), new Value("foo1".getBytes()));
-bw.addMutation(m);
-bw.close();
+try (BatchWriter bw = c.createBatchWriter(tables[3])) {
+  Mutation m = new Mutation(new Text(""));
+  m.put(new Text(""), new Text(""), new Value("foo1".getBytes()));
+  bw.addMutation(m);
+}
 c.tableOperations().flush(tables[3], null, null, true);
 
 for (String table : Arrays.asList(tables[0], tables[1], tables[2])) {
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java
index 9133380..7b8fbbe 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java
@@ -35,7 +35,6 @@ import java.util.TreeSet;
 import org.apache.accumulo.cluster.AccumuloCluster;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.admin.DiskUsage;
@@ -270,7 +269,7 @@ public class CloneTestIT extends AccumuloClusterHarness {
 
   client.tableOperations().addSplits(tables[0], splits);
 
-  try (BatchWriter bw = client.createBatchWriter(tables[0], new 
BatchWriterConfig())) {
+  try (BatchWriter bw = client.createBatchWriter(tables[0])) {
 

[accumulo] branch master updated: More try-with-resources BatchWriter updates (#989)

2019-02-26 Thread mwalch
This is an automated email from the ASF dual-hosted git repository.

mwalch 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 64a33c8  More try-with-resources BatchWriter updates (#989)
64a33c8 is described below

commit 64a33c8a41ebf9c4cb8dea42a50b3cf01567db02
Author: Mike Walch 
AuthorDate: Tue Feb 26 10:26:03 2019 -0500

More try-with-resources BatchWriter updates (#989)
---
 .../accumulo/test/functional/BloomFilterIT.java| 11 ++-
 .../accumulo/test/functional/CloneTestIT.java  |  3 +-
 .../test/functional/KerberosRenewalIT.java | 11 ++-
 .../accumulo/test/functional/LargeRowIT.java   | 27 +++-
 .../test/functional/ManyWriteAheadLogsIT.java  |  6 +-
 .../test/functional/MasterAssignmentIT.java| 11 ++-
 .../apache/accumulo/test/functional/MergeIT.java   | 39 ++-
 .../accumulo/test/functional/PermissionsIT.java| 39 +--
 .../accumulo/test/functional/ReadWriteIT.java  | 14 ++--
 .../apache/accumulo/test/functional/ScanIdIT.java  |  7 +-
 .../accumulo/test/functional/ScanIteratorIT.java   | 36 --
 .../accumulo/test/functional/ScanRangeIT.java  | 25 +++
 .../test/functional/ScanSessionTimeOutIT.java  | 17 ++---
 .../accumulo/test/functional/ScannerContextIT.java | 49 +++---
 .../apache/accumulo/test/functional/ScannerIT.java | 15 ++--
 .../test/functional/ServerSideErrorIT.java | 14 ++--
 .../test/functional/SessionBlockVerifyIT.java  | 17 ++---
 .../test/functional/SessionDurabilityIT.java   | 12 ++--
 .../test/functional/SparseColumnFamilyIT.java  | 30 
 .../apache/accumulo/test/functional/SummaryIT.java | 14 ++--
 .../apache/accumulo/test/functional/TabletIT.java  | 18 +++--
 .../functional/TabletStateChangeIteratorIT.java| 12 ++--
 .../apache/accumulo/test/functional/TimeoutIT.java | 18 +++--
 .../accumulo/test/functional/TooManyDeletesIT.java |  7 +-
 .../accumulo/test/functional/VisibilityIT.java | 79 ++
 .../accumulo/test/functional/WALSunnyDayIT.java| 32 -
 .../test/functional/ZookeeperRestartIT.java| 10 +--
 27 files changed, 253 insertions(+), 320 deletions(-)

diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
index e329fa4..3ede1ba 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java
@@ -28,7 +28,6 @@ import java.util.Random;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.conf.Property;
@@ -95,11 +94,11 @@ public class BloomFilterIT extends AccumuloClusterHarness {
 log.info("Writing complete");
 
 // test inserting an empty key
-BatchWriter bw = c.createBatchWriter(tables[3], new 
BatchWriterConfig());
-Mutation m = new Mutation(new Text(""));
-m.put(new Text(""), new Text(""), new Value("foo1".getBytes()));
-bw.addMutation(m);
-bw.close();
+try (BatchWriter bw = c.createBatchWriter(tables[3])) {
+  Mutation m = new Mutation(new Text(""));
+  m.put(new Text(""), new Text(""), new Value("foo1".getBytes()));
+  bw.addMutation(m);
+}
 c.tableOperations().flush(tables[3], null, null, true);
 
 for (String table : Arrays.asList(tables[0], tables[1], tables[2])) {
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java
index 9133380..7b8fbbe 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java
@@ -35,7 +35,6 @@ import java.util.TreeSet;
 import org.apache.accumulo.cluster.AccumuloCluster;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.admin.DiskUsage;
@@ -270,7 +269,7 @@ public class CloneTestIT extends AccumuloClusterHarness {
 
   client.tableOperations().addSplits(tables[0], splits);
 
-  try (BatchWriter bw = client.createBatchWriter(tables[0], new 
BatchWriterConfig())) {
+  try (BatchWriter bw = client.createBatchWriter(tables[0])) {