[accumulo] branch master updated: TServerUtilsTest fails on master and OSX

2018-09-14 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj 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 5e01176  TServerUtilsTest fails on master and OSX
5e01176 is described below

commit 5e011764f9e43925e7fffcd1d68811a4ede5a199
Author: Josh Elser 
AuthorDate: Fri Sep 14 16:01:02 2018 -0400

TServerUtilsTest fails on master and OSX

A couple of tests fail in this class because the test binds to 
localhost:
but then TServerSocket (via TServerUtils) binds to `0.0.0.0` which doesn't
cause an exception to be thrown (testing for the port collision).

Closes #649

Signed-Off-By: Christopher Tubbs 
Signed-Off-By: Keith Turner 
---
 .../main/java/org/apache/accumulo/server/rpc/TServerUtils.java| 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java 
b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
index 6a6de4e..af2871e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
@@ -276,7 +276,9 @@ public class TServerUtils {
   TProtocolFactory protocolFactory, long maxMessageSize, String 
serverName, int numThreads,
   int numSimpleTimerThreads, long timeBetweenThreadChecks) throws 
TTransportException {
 
-TServerSocket transport = new TServerSocket(address.getPort());
+InetSocketAddress isa = new InetSocketAddress(address.getHost(), 
address.getPort());
+// Must use an ISA, providing only a port would ignore the hostname given
+TServerSocket transport = new TServerSocket(isa);
 ThreadPoolExecutor pool = createSelfResizingThreadPool(serverName, 
numThreads,
 numSimpleTimerThreads, timeBetweenThreadChecks);
 TThreadPoolServer server = createTThreadPoolServer(transport, processor,
@@ -433,7 +435,9 @@ public class TServerUtils {
 // when the server does an accept() to (presumably) wake up the eventing 
system.
 log.info("Creating SASL thread pool thrift server on listening on {}:{}", 
address.getHost(),
 address.getPort());
-TServerSocket transport = new TServerSocket(address.getPort(), (int) 
socketTimeout);
+InetSocketAddress isa = new InetSocketAddress(address.getHost(), 
address.getPort());
+// Must use an ISA, providing only a port would ignore the hostname given
+TServerSocket transport = new TServerSocket(isa, (int) socketTimeout);
 
 String hostname, fqdn;
 try {



[accumulo] branch master updated: Rename new Bulk import API (#648)

2018-09-14 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 576280a  Rename new Bulk import API (#648)
576280a is described below

commit 576280a4157207d7e8938d3f6ccb65464dd4b4c3
Author: Mike Miller 
AuthorDate: Fri Sep 14 18:25:10 2018 -0400

Rename new Bulk import API (#648)

* Also added an example for importDirectory fluent API
---
 .../core/client/admin/TableOperations.java | 31 +-
 .../accumulo/core/client/impl/BulkImport.java  | 26 +-
 .../core/client/impl/TableOperationsImpl.java  |  4 +--
 .../accumulo/core/client/rfile/RFileWriter.java|  2 +-
 .../apache/accumulo/core/conf/ClientProperty.java  |  4 +--
 .../org/apache/accumulo/core/data/LoadPlan.java|  4 +--
 .../org/apache/accumulo/proxy/ProxyServer.java |  6 ++---
 .../shell/commands/ImportDirectoryCommand.java |  4 +--
 .../org/apache/accumulo/test/AuditMessageIT.java   |  4 +--
 .../accumulo/test/BulkImportSequentialRowsIT.java  |  2 +-
 .../org/apache/accumulo/test/NamespacesIT.java |  2 +-
 .../accumulo/test/functional/BulkFileIT.java   |  2 +-
 .../apache/accumulo/test/functional/BulkIT.java|  2 +-
 .../accumulo/test/functional/BulkLoadIT.java   | 18 ++---
 .../test/functional/BulkSplitOptimizationIT.java   |  2 +-
 .../accumulo/test/functional/CompactionIT.java |  2 +-
 16 files changed, 61 insertions(+), 54 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java 
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index 4de0abe..e18cc57 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -612,7 +612,7 @@ public interface TableOperations {
* @throws TableNotFoundException
*   when the table no longer exists
*
-   * @deprecated since 2.0.0 use {@link #addFilesTo(String)} instead.
+   * @deprecated since 2.0.0 use {@link #importDirectory(String)} instead.
*/
   @Deprecated
   void importDirectory(String tableName, String dir, String failureDir, 
boolean setTime)
@@ -629,7 +629,7 @@ public interface TableOperations {
  *
  * @see NewTableConfiguration#setTimeType(TimeType)
  */
-ImportDestinationOptions tableTime();
+ImportMappingOptions tableTime();
 
 /**
  * Loads the files into the table.
@@ -639,9 +639,11 @@ public interface TableOperations {
   }
 
   /**
+   * Options giving control of how the bulk import file mapping is done.
+   *
* @since 2.0.0
*/
-  interface ImportDestinationOptions extends ImportOptions {
+  interface ImportMappingOptions extends ImportOptions {
 
 /**
  * This is the default number of threads used to determine where to load 
files. A suffix of
@@ -662,7 +664,7 @@ public interface TableOperations {
  * Files are examined to determine where to load them. This examination is 
done in the current
  * process using multiple threads. If this method is not called, then the 
client property
  * {@code bulk.threads} is used to create a thread pool. This property 
defaults to
- * {@value ImportDestinationOptions#BULK_LOAD_THREADS_DEFAULT}.
+ * {@value ImportMappingOptions#BULK_LOAD_THREADS_DEFAULT}.
  *
  * @param service
  *  Use this executor to run file examination task
@@ -675,7 +677,7 @@ public interface TableOperations {
  * Files are examined to determine where to load them. This examination is 
done in the current
  * process using multiple threads. If this method is not called, then the 
client property
  * {@code bulk.threads} is used to create a thread pool. This property 
defaults to
- * {@value 
org.apache.accumulo.core.client.admin.TableOperations.ImportDestinationOptions#BULK_LOAD_THREADS_DEFAULT}.
+ * {@value ImportMappingOptions#BULK_LOAD_THREADS_DEFAULT}.
  *
  * @param numThreads
  *  Create a thread pool with this many thread to run file 
examination task.
@@ -686,30 +688,35 @@ public interface TableOperations {
   /**
* @since 2.0.0
*/
-  interface ImportSourceArguments {
+  interface ImportDestinationArguments {
 /**
  *
- * @param directory
- *  Load files from this directory
+ * @param tableName
+ *  Import files to this tableName
  */
-ImportDestinationOptions from(String directory);
+ImportMappingOptions to(String tableName);
   }
 
   /**
* Bulk import the files in a directory into a table. Files can be created 
using
* {@code AccumuloFileOutputFormat} and {@link RFile#newWriter()}.
-   *
* 
* This new method of bulk import examines files in the current process 
outside of 

[accumulo] branch master updated (c033667 -> 0db0a3f)

2018-09-14 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 c033667  Do not require a password on the truststore JKS
 add 1213c9a  Do not require a password on the truststore JKS
 new 0db0a3f  Merge branch '1.9'

The 1 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:



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

2018-09-14 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 0db0a3f41383d6136a6eafbb0be2b57adc11a89a
Merge: c033667 1213c9a
Author: Christopher Tubbs 
AuthorDate: Fri Sep 14 16:47:22 2018 -0400

Merge branch '1.9'




[accumulo] branch master updated: Do not require a password on the truststore JKS

2018-09-14 Thread elserj
This is an automated email from the ASF dual-hosted git repository.

elserj 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 c033667  Do not require a password on the truststore JKS
c033667 is described below

commit c033667b007d329d05203e21fe5af4c28f63cb13
Author: Romil Choksi 
AuthorDate: Wed Sep 12 15:07:20 2018 -0400

Do not require a password on the truststore JKS

A password on a truststore provides no security value, only validation
that the JKS is the JKS that the user expects. Log a warning when the
truststore is empty.

Closes #646

Signed-off-by: Josh Elser 
---
 .../org/apache/accumulo/monitor/EmbeddedWebServer.java | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
index 2d254ea..ee2ebaa 100644
--- 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
+++ 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
@@ -29,8 +29,12 @@ import org.eclipse.jetty.server.SslConnectionFactory;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class EmbeddedWebServer {
+  private static final Logger LOG = 
LoggerFactory.getLogger(EmbeddedWebServer.class);
+
   private final Server server;
   private final ServerConnector connector;
   private final ServletContextHandler handler;
@@ -51,17 +55,21 @@ public class EmbeddedWebServer {
   private static AbstractConnectionFactory[] 
getConnectionFactories(AccumuloConfiguration conf) {
 HttpConnectionFactory httpFactory = new HttpConnectionFactory();
 EnumSet requireForSecure = 
EnumSet.of(Property.MONITOR_SSL_KEYSTORE,
-Property.MONITOR_SSL_KEYSTOREPASS, Property.MONITOR_SSL_TRUSTSTORE,
-Property.MONITOR_SSL_TRUSTSTOREPASS);
+Property.MONITOR_SSL_KEYSTOREPASS, Property.MONITOR_SSL_TRUSTSTORE);
+
 if (requireForSecure.stream().map(p -> conf.get(p)).anyMatch(s -> s == 
null || s.isEmpty())) {
   return new AbstractConnectionFactory[] {httpFactory};
 } else {
+  final String trustStorePass = 
conf.get(Property.MONITOR_SSL_TRUSTSTOREPASS);
+  if (trustStorePass.isEmpty()) {
+LOG.warn("Truststore JKS file has an empty password which prevents any 
integrity checks.");
+  }
   SslContextFactory sslContextFactory = new SslContextFactory();
   
sslContextFactory.setKeyStorePath(conf.get(Property.MONITOR_SSL_KEYSTORE));
   
sslContextFactory.setKeyStorePassword(conf.get(Property.MONITOR_SSL_KEYSTOREPASS));
   
sslContextFactory.setKeyStoreType(conf.get(Property.MONITOR_SSL_KEYSTORETYPE));
   
sslContextFactory.setTrustStorePath(conf.get(Property.MONITOR_SSL_TRUSTSTORE));
-  
sslContextFactory.setTrustStorePassword(conf.get(Property.MONITOR_SSL_TRUSTSTOREPASS));
+  sslContextFactory.setTrustStorePassword(trustStorePass);
   
sslContextFactory.setTrustStoreType(conf.get(Property.MONITOR_SSL_TRUSTSTORETYPE));
 
   final String includedCiphers = 
conf.get(Property.MONITOR_SSL_INCLUDE_CIPHERS);