[3/6] accumulo git commit: ACCUMULO-4070 Backport server-side fix Kerberos renewal from ACCUMULO-4069
ACCUMULO-4070 Backport server-side fix Kerberos renewal from ACCUMULO-4069 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4d952ac0 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4d952ac0 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4d952ac0 Branch: refs/heads/master Commit: 4d952ac070c399cd16688eefd5d8a5c3f80e753c Parents: bd8cf5e Author: Josh ElserAuthored: Thu Dec 3 01:53:27 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:20:56 2015 -0500 -- .../org/apache/accumulo/core/conf/Property.java | 2 + .../accumulo/server/security/SecurityUtil.java | 47 ++-- 2 files changed, 45 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d952ac0/core/src/main/java/org/apache/accumulo/core/conf/Property.java -- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 6d1f043..632bb59 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -160,6 +160,8 @@ public enum Property { GENERAL_KERBEROS_KEYTAB("general.kerberos.keytab", "", PropertyType.PATH, "Path to the kerberos keytab to use. Leave blank if not using kerberoized hdfs"), GENERAL_KERBEROS_PRINCIPAL("general.kerberos.principal", "", PropertyType.STRING, "Name of the kerberos principal to use. _HOST will automatically be " + "replaced by the machines hostname in the hostname portion of the principal. Leave blank if not using kerberoized hdfs"), + GENERAL_KERBEROS_RENEWAL_PERIOD("general.kerberos.renewal.period", "30s", PropertyType.TIMEDURATION, "The amount of time between attempts to perform " + + "Kerberos ticket renewals. This does not equate to how often tickets are actually renewed (which is performed at 80% of the ticket lifetime)."), GENERAL_MAX_MESSAGE_SIZE("general.server.message.size.max", "1G", PropertyType.MEMORY, "The maximum size of a message that can be sent to a server."), @Experimental GENERAL_VOLUME_CHOOSER("general.volume.chooser", "org.apache.accumulo.server.fs.RandomVolumeChooser", PropertyType.CLASSNAME, http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d952ac0/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java index 42d1313..9e0eb04 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java @@ -21,6 +21,8 @@ import java.net.InetAddress; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.util.Daemon; +import org.apache.accumulo.fate.util.LoggingRunnable; import org.apache.hadoop.security.UserGroupInformation; import org.apache.log4j.Logger; @@ -29,6 +31,7 @@ import org.apache.log4j.Logger; */ public class SecurityUtil { private static final Logger log = Logger.getLogger(SecurityUtil.class); + private static final Logger renewalLog = Logger.getLogger("KerberosTicketRenewal"); public static boolean usingKerberos = false; /** @@ -48,11 +51,10 @@ public class SecurityUtil { if (login(principalConfig, keyTab)) { try { -// This spawns a thread to periodically renew the logged in (accumulo) user -UserGroupInformation.getLoginUser(); +startTicketRenewalThread(UserGroupInformation.getCurrentUser(), acuConf.getTimeInMillis(Property.GENERAL_KERBEROS_RENEWAL_PERIOD)); return; - } catch (IOException io) { -log.error("Error starting up renewal thread. This shouldn't be happenining.", io); + } catch (IOException e) { +log.error("Failed to obtain Kerberos user after successfully logging in", e); } } @@ -80,4 +82,41 @@ public class SecurityUtil { } return false; } + + /** + * Start a thread that periodically attempts to renew the current Kerberos user's ticket. + * + * @param ugi + * The current Kerberos user. + * @param renewalPeriod + * The amount of time between attempting renewals. + */ + static void startTicketRenewalThread(final UserGroupInformation ugi, final long renewalPeriod) { +Thread t = new Daemon(new LoggingRunnable(renewalLog, new Runnable() { + @Override +
[1/6] accumulo git commit: ACCUMULO-4070 Backport server-side fix Kerberos renewal from ACCUMULO-4069
Repository: accumulo Updated Branches: refs/heads/1.6 bd8cf5e21 -> 4d952ac07 refs/heads/1.7 3aa9d307d -> c20996d83 refs/heads/master 6e5fa1c6b -> f02a65cd2 ACCUMULO-4070 Backport server-side fix Kerberos renewal from ACCUMULO-4069 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4d952ac0 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4d952ac0 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4d952ac0 Branch: refs/heads/1.6 Commit: 4d952ac070c399cd16688eefd5d8a5c3f80e753c Parents: bd8cf5e Author: Josh ElserAuthored: Thu Dec 3 01:53:27 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:20:56 2015 -0500 -- .../org/apache/accumulo/core/conf/Property.java | 2 + .../accumulo/server/security/SecurityUtil.java | 47 ++-- 2 files changed, 45 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d952ac0/core/src/main/java/org/apache/accumulo/core/conf/Property.java -- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 6d1f043..632bb59 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -160,6 +160,8 @@ public enum Property { GENERAL_KERBEROS_KEYTAB("general.kerberos.keytab", "", PropertyType.PATH, "Path to the kerberos keytab to use. Leave blank if not using kerberoized hdfs"), GENERAL_KERBEROS_PRINCIPAL("general.kerberos.principal", "", PropertyType.STRING, "Name of the kerberos principal to use. _HOST will automatically be " + "replaced by the machines hostname in the hostname portion of the principal. Leave blank if not using kerberoized hdfs"), + GENERAL_KERBEROS_RENEWAL_PERIOD("general.kerberos.renewal.period", "30s", PropertyType.TIMEDURATION, "The amount of time between attempts to perform " + + "Kerberos ticket renewals. This does not equate to how often tickets are actually renewed (which is performed at 80% of the ticket lifetime)."), GENERAL_MAX_MESSAGE_SIZE("general.server.message.size.max", "1G", PropertyType.MEMORY, "The maximum size of a message that can be sent to a server."), @Experimental GENERAL_VOLUME_CHOOSER("general.volume.chooser", "org.apache.accumulo.server.fs.RandomVolumeChooser", PropertyType.CLASSNAME, http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d952ac0/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java index 42d1313..9e0eb04 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java @@ -21,6 +21,8 @@ import java.net.InetAddress; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.util.Daemon; +import org.apache.accumulo.fate.util.LoggingRunnable; import org.apache.hadoop.security.UserGroupInformation; import org.apache.log4j.Logger; @@ -29,6 +31,7 @@ import org.apache.log4j.Logger; */ public class SecurityUtil { private static final Logger log = Logger.getLogger(SecurityUtil.class); + private static final Logger renewalLog = Logger.getLogger("KerberosTicketRenewal"); public static boolean usingKerberos = false; /** @@ -48,11 +51,10 @@ public class SecurityUtil { if (login(principalConfig, keyTab)) { try { -// This spawns a thread to periodically renew the logged in (accumulo) user -UserGroupInformation.getLoginUser(); +startTicketRenewalThread(UserGroupInformation.getCurrentUser(), acuConf.getTimeInMillis(Property.GENERAL_KERBEROS_RENEWAL_PERIOD)); return; - } catch (IOException io) { -log.error("Error starting up renewal thread. This shouldn't be happenining.", io); + } catch (IOException e) { +log.error("Failed to obtain Kerberos user after successfully logging in", e); } } @@ -80,4 +82,41 @@ public class SecurityUtil { } return false; } + + /** + * Start a thread that periodically attempts to renew the current Kerberos user's ticket. + * + * @param ugi + * The current Kerberos user. + * @param renewalPeriod + * The amount of time between attempting renewals. + */ + static void
[2/6] accumulo git commit: ACCUMULO-4070 Backport server-side fix Kerberos renewal from ACCUMULO-4069
ACCUMULO-4070 Backport server-side fix Kerberos renewal from ACCUMULO-4069 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4d952ac0 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4d952ac0 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4d952ac0 Branch: refs/heads/1.7 Commit: 4d952ac070c399cd16688eefd5d8a5c3f80e753c Parents: bd8cf5e Author: Josh ElserAuthored: Thu Dec 3 01:53:27 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:20:56 2015 -0500 -- .../org/apache/accumulo/core/conf/Property.java | 2 + .../accumulo/server/security/SecurityUtil.java | 47 ++-- 2 files changed, 45 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d952ac0/core/src/main/java/org/apache/accumulo/core/conf/Property.java -- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 6d1f043..632bb59 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -160,6 +160,8 @@ public enum Property { GENERAL_KERBEROS_KEYTAB("general.kerberos.keytab", "", PropertyType.PATH, "Path to the kerberos keytab to use. Leave blank if not using kerberoized hdfs"), GENERAL_KERBEROS_PRINCIPAL("general.kerberos.principal", "", PropertyType.STRING, "Name of the kerberos principal to use. _HOST will automatically be " + "replaced by the machines hostname in the hostname portion of the principal. Leave blank if not using kerberoized hdfs"), + GENERAL_KERBEROS_RENEWAL_PERIOD("general.kerberos.renewal.period", "30s", PropertyType.TIMEDURATION, "The amount of time between attempts to perform " + + "Kerberos ticket renewals. This does not equate to how often tickets are actually renewed (which is performed at 80% of the ticket lifetime)."), GENERAL_MAX_MESSAGE_SIZE("general.server.message.size.max", "1G", PropertyType.MEMORY, "The maximum size of a message that can be sent to a server."), @Experimental GENERAL_VOLUME_CHOOSER("general.volume.chooser", "org.apache.accumulo.server.fs.RandomVolumeChooser", PropertyType.CLASSNAME, http://git-wip-us.apache.org/repos/asf/accumulo/blob/4d952ac0/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java index 42d1313..9e0eb04 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityUtil.java @@ -21,6 +21,8 @@ import java.net.InetAddress; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.util.Daemon; +import org.apache.accumulo.fate.util.LoggingRunnable; import org.apache.hadoop.security.UserGroupInformation; import org.apache.log4j.Logger; @@ -29,6 +31,7 @@ import org.apache.log4j.Logger; */ public class SecurityUtil { private static final Logger log = Logger.getLogger(SecurityUtil.class); + private static final Logger renewalLog = Logger.getLogger("KerberosTicketRenewal"); public static boolean usingKerberos = false; /** @@ -48,11 +51,10 @@ public class SecurityUtil { if (login(principalConfig, keyTab)) { try { -// This spawns a thread to periodically renew the logged in (accumulo) user -UserGroupInformation.getLoginUser(); +startTicketRenewalThread(UserGroupInformation.getCurrentUser(), acuConf.getTimeInMillis(Property.GENERAL_KERBEROS_RENEWAL_PERIOD)); return; - } catch (IOException io) { -log.error("Error starting up renewal thread. This shouldn't be happenining.", io); + } catch (IOException e) { +log.error("Failed to obtain Kerberos user after successfully logging in", e); } } @@ -80,4 +82,41 @@ public class SecurityUtil { } return false; } + + /** + * Start a thread that periodically attempts to renew the current Kerberos user's ticket. + * + * @param ugi + * The current Kerberos user. + * @param renewalPeriod + * The amount of time between attempting renewals. + */ + static void startTicketRenewalThread(final UserGroupInformation ugi, final long renewalPeriod) { +Thread t = new Daemon(new LoggingRunnable(renewalLog, new Runnable() { + @Override +
[6/6] accumulo git commit: Merge branch '1.7'
Merge branch '1.7' Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f02a65cd Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f02a65cd Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f02a65cd Branch: refs/heads/master Commit: f02a65cd2cd9715d1dc9e212fd97829ce3d8be40 Parents: 6e5fa1c c20996d Author: Josh ElserAuthored: Thu Dec 3 16:49:06 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:49:06 2015 -0500 -- --
[5/6] accumulo git commit: Merge branch '1.6' into 1.7
Merge branch '1.6' into 1.7 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c20996d8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c20996d8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c20996d8 Branch: refs/heads/1.7 Commit: c20996d83ee0fd64c864d3af1c1ac9deee5ac8d5 Parents: 3aa9d30 4d952ac Author: Josh ElserAuthored: Thu Dec 3 16:48:59 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:48:59 2015 -0500 -- --
[4/6] accumulo git commit: Merge branch '1.6' into 1.7
Merge branch '1.6' into 1.7 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c20996d8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c20996d8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c20996d8 Branch: refs/heads/master Commit: c20996d83ee0fd64c864d3af1c1ac9deee5ac8d5 Parents: 3aa9d30 4d952ac Author: Josh ElserAuthored: Thu Dec 3 16:48:59 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:48:59 2015 -0500 -- --
[2/3] accumulo git commit: ACCUMULO-4069 Ensure Kerberos relogins occur on server side and client side.
ACCUMULO-4069 Ensure Kerberos relogins occur on server side and client side. Closes apache/accumulo#57 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3aa9d307 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3aa9d307 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3aa9d307 Branch: refs/heads/master Commit: 3aa9d307d7405d8d98c02dcc11c94cfe07ea2a14 Parents: 0e3af1e Author: Josh ElserAuthored: Thu Dec 3 01:53:27 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:15:35 2015 -0500 -- .../org/apache/accumulo/core/conf/Property.java | 2 + .../apache/accumulo/core/rpc/ThriftUtil.java| 60 ++ .../accumulo/server/security/SecurityUtil.java | 47 - .../org/apache/accumulo/harness/TestingKdc.java | 13 +- .../test/functional/KerberosRenewalIT.java | 188 +++ 5 files changed, 303 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/3aa9d307/core/src/main/java/org/apache/accumulo/core/conf/Property.java -- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index df53791..d8165b7 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -177,6 +177,8 @@ public enum Property { GENERAL_KERBEROS_KEYTAB("general.kerberos.keytab", "", PropertyType.PATH, "Path to the kerberos keytab to use. Leave blank if not using kerberoized hdfs"), GENERAL_KERBEROS_PRINCIPAL("general.kerberos.principal", "", PropertyType.STRING, "Name of the kerberos principal to use. _HOST will automatically be " + "replaced by the machines hostname in the hostname portion of the principal. Leave blank if not using kerberoized hdfs"), + GENERAL_KERBEROS_RENEWAL_PERIOD("general.kerberos.renewal.period", "30s", PropertyType.TIMEDURATION, "The amount of time between attempts to perform " + + "Kerberos ticket renewals. This does not equate to how often tickets are actually renewed (which is performed at 80% of the ticket lifetime)."), GENERAL_MAX_MESSAGE_SIZE("general.server.message.size.max", "1G", PropertyType.MEMORY, "The maximum size of a message that can be sent to a server."), GENERAL_SIMPLETIMER_THREADPOOL_SIZE("general.server.simpletimer.threadpool.size", "1", PropertyType.COUNT, "The number of threads to use for " + "server-internal scheduled tasks"), http://git-wip-us.apache.org/repos/asf/accumulo/blob/3aa9d307/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java -- diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java index 1b5c256..f3cb9b5 100644 --- a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java +++ b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java @@ -22,6 +22,7 @@ import java.net.InetAddress; import java.security.KeyStore; import java.util.HashMap; import java.util.Map; +import java.util.Random; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; @@ -62,6 +63,9 @@ public class ThriftUtil { public static final String GSSAPI = "GSSAPI", DIGEST_MD5 = "DIGEST-MD5"; + private static final Random SASL_BACKOFF_RAND = new Random(); + private static final int RELOGIN_MAX_BACKOFF = 5000; + /** * An instance of {@link TraceProtocolFactory} * @@ -296,6 +300,15 @@ public class ThriftUtil { // Open the transport transport.open(); +} catch (TTransportException e) { + log.warn("Failed to open SASL transport", e); + + // We might have had a valid ticket, but it expired. We'll let the caller retry, but we will attempt to re-login to make the next attempt work. + // Sadly, we have no way to determine the actual reason we got this TTransportException other than inspecting the exception msg. + log.debug("Caught TTransportException opening SASL transport, checking if re-login is necessary before propagating the exception."); + attemptClientReLogin(); + + throw e; } catch (IOException e) { log.warn("Failed to open SASL transport", e); throw new TTransportException(e); @@ -328,6 +341,53 @@ public class ThriftUtil { } /** + * Some wonderful snippets of documentation from HBase on performing the re-login client-side (as well as server-side) in the following paragraph. We want to + * attempt a re-login to automatically refresh the client's Krb
[2/6] accumulo git commit: ACCUMULO-4065 Tweak generics in RpcWrapper and related code
ACCUMULO-4065 Tweak generics in RpcWrapper and related code * depend more on compile time checks with generic checking * use better naming of generic params (I for Iface, P for Processor) to clarify relationship between types * remove unneeded casts and warnings suppressions Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bd8cf5e2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bd8cf5e2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bd8cf5e2 Branch: refs/heads/1.7 Commit: bd8cf5e21305b63bd4bd62c92f7ed045eb440830 Parents: 5724df5 Author: Christopher TubbsAuthored: Wed Dec 2 20:04:04 2015 -0500 Committer: Christopher Tubbs Committed: Wed Dec 2 20:04:04 2015 -0500 -- .../java/org/apache/accumulo/proxy/Proxy.java | 22 ++- .../apache/accumulo/server/util/RpcWrapper.java | 11 +- .../accumulo/server/util/RpcWrapperTest.java| 23 +++- .../accumulo/gc/SimpleGarbageCollector.java | 2 +- .../java/org/apache/accumulo/master/Master.java | 4 ++-- .../apache/accumulo/tserver/TabletServer.java | 2 +- 6 files changed, 35 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd8cf5e2/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java -- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java index 3368d20..53221e0 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -30,7 +30,6 @@ import org.apache.accumulo.proxy.thrift.AccumuloProxy; import org.apache.accumulo.server.util.RpcWrapper; import org.apache.log4j.Logger; import org.apache.thrift.TBaseProcessor; -import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TCompactProtocol; import org.apache.thrift.protocol.TProtocolFactory; import org.apache.thrift.server.THsHaServer; @@ -125,20 +124,23 @@ public class Proxy { public static TServer createProxyServer(Class api, Class implementor, final int port, Class protoClass, Properties properties) throws Exception { -final TNonblockingServerSocket socket = new TNonblockingServerSocket(port); - -// create the implementor -Object impl = implementor.getConstructor(Properties.class).newInstance(properties); - -Class proxyProcClass = Class.forName(api.getName() + "$Processor"); Class proxyIfaceClass = Class.forName(api.getName() + "$Iface"); +return createProxyServer(proxyIfaceClass, api, implementor, port, protoClass, properties); + } + private static TServer createProxyServer(final Class proxyIfaceClass, Class api, final Class implementor, + final int port, final Class protoClass, final Properties properties) throws Exception { +@SuppressWarnings("unchecked") +Class proxyProcClass = (Class) Class.forName(api.getName() + "$Processor"); + +// create the implementor @SuppressWarnings("unchecked") -Constructor proxyProcConstructor = (Constructor) proxyProcClass.getConstructor(proxyIfaceClass); +I impl = (I) implementor.getConstructor(Properties.class).newInstance(properties); -@SuppressWarnings({"rawtypes", "unchecked"}) -final TProcessor processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, ((TBaseProcessor) proxyProcConstructor.newInstance(impl)).getProcessMapView())); +Constructor proxyProcConstructor = proxyProcClass.getConstructor(proxyIfaceClass); +P processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, proxyProcConstructor.newInstance(impl))); +TNonblockingServerSocket socket = new TNonblockingServerSocket(port); THsHaServer.Args args = new THsHaServer.Args(socket); args.processor(processor); final long maxFrameSize = AccumuloConfiguration.getMemoryInBytes(properties.getProperty("maxFrameSize", "16M")); http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd8cf5e2/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java index aafe37c..78a9d4f 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java @@ -28,7 +28,7 @@ import org.apache.accumulo.trace.instrument.thrift.RpcServerInvocationHandler; import org.apache.accumulo.trace.instrument.thrift.TraceWrap; import
[5/6] accumulo git commit: Merge branch '1.6' into 1.7
Merge branch '1.6' into 1.7 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0e3af1e8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0e3af1e8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0e3af1e8 Branch: refs/heads/1.7 Commit: 0e3af1e8560b0a28a4415f8da38a561965d552dc Parents: e35e189 bd8cf5e Author: Christopher TubbsAuthored: Thu Dec 3 15:36:49 2015 -0500 Committer: Christopher Tubbs Committed: Thu Dec 3 15:36:49 2015 -0500 -- .../src/main/java/org/apache/accumulo/proxy/Proxy.java | 2 +- .../java/org/apache/accumulo/server/rpc/RpcWrapper.java | 12 ++-- .../org/apache/accumulo/server/rpc/RpcWrapperTest.java | 9 +++-- .../org/apache/accumulo/gc/SimpleGarbageCollector.java | 2 +- .../main/java/org/apache/accumulo/master/Master.java| 4 ++-- .../java/org/apache/accumulo/tserver/TabletServer.java | 4 ++-- 6 files changed, 15 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e3af1e8/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java -- diff --cc proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java index ca39786,53221e0..87e2c58 --- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java @@@ -161,113 -117,38 +161,113 @@@ public class Proxy implements KeywordEx Class protoFactoryClass = Class.forName(opts.prop.getProperty("protocolFactory", TCompactProtocol.Factory.class.getName())) .asSubclass(TProtocolFactory.class); +TProtocolFactory protoFactory = protoFactoryClass.newInstance(); int port = Integer.parseInt(opts.prop.getProperty("port")); -TServer server = createProxyServer(AccumuloProxy.class, ProxyServer.class, port, protoFactoryClass, opts.prop); -server.serve(); +String hostname = opts.prop.getProperty(THRIFT_SERVER_HOSTNAME, THRIFT_SERVER_HOSTNAME_DEFAULT); +HostAndPort address = HostAndPort.fromParts(hostname, port); +ServerAddress server = createProxyServer(address, protoFactory, opts.prop); +// Wait for the server to come up +while (!server.server.isServing()) { + Thread.sleep(100); +} +log.info("Proxy server started on " + server.getAddress()); +while (server.server.isServing()) { + Thread.sleep(1000); +} + } + + public static void main(String[] args) throws Exception { +new Proxy().execute(args); } - public static TServer createProxyServer(Class api, Class implementor, final int port, Class protoClass, - Properties properties) throws Exception { -Class proxyIfaceClass = Class.forName(api.getName() + "$Iface"); -return createProxyServer(proxyIfaceClass, api, implementor, port, protoClass, properties); + public static ServerAddress createProxyServer(HostAndPort address, TProtocolFactory protocolFactory, Properties properties) throws Exception { +return createProxyServer(address, protocolFactory, properties, ClientConfiguration.loadDefault()); } - private static TServer createProxyServer(final Class proxyIfaceClass, Class api, final Class implementor, - final int port, final Class protoClass, final Properties properties) throws Exception { -@SuppressWarnings("unchecked") -Class proxyProcClass = (Class) Class.forName(api.getName() + "$Processor"); - -// create the implementor -@SuppressWarnings("unchecked") -I impl = (I) implementor.getConstructor(Properties.class).newInstance(properties); - -Constructor proxyProcConstructor = proxyProcClass.getConstructor(proxyIfaceClass); -P processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, proxyProcConstructor.newInstance(impl))); - -TNonblockingServerSocket socket = new TNonblockingServerSocket(port); -THsHaServer.Args args = new THsHaServer.Args(socket); -args.processor(processor); -final long maxFrameSize = AccumuloConfiguration.getMemoryInBytes(properties.getProperty("maxFrameSize", "16M")); -if (maxFrameSize > Integer.MAX_VALUE) - throw new RuntimeException(maxFrameSize + " is larger than MAX_INT"); -args.transportFactory(new TFramedTransport.Factory((int) maxFrameSize)); -args.protocolFactory(protoClass.newInstance()); -args.maxReadBufferBytes = maxFrameSize; -return new THsHaServer(args); + public static ServerAddress createProxyServer(HostAndPort address, TProtocolFactory protocolFactory, Properties properties, ClientConfiguration clientConf) + throws Exception { +final int numThreads =
[1/6] accumulo git commit: ACCUMULO-4065 Tweak generics in RpcWrapper and related code
Repository: accumulo Updated Branches: refs/heads/1.6 5724df591 -> bd8cf5e21 refs/heads/1.7 e35e1898d -> 0e3af1e85 refs/heads/master 7dc373675 -> 46e5d5c8d ACCUMULO-4065 Tweak generics in RpcWrapper and related code * depend more on compile time checks with generic checking * use better naming of generic params (I for Iface, P for Processor) to clarify relationship between types * remove unneeded casts and warnings suppressions Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bd8cf5e2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bd8cf5e2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bd8cf5e2 Branch: refs/heads/1.6 Commit: bd8cf5e21305b63bd4bd62c92f7ed045eb440830 Parents: 5724df5 Author: Christopher TubbsAuthored: Wed Dec 2 20:04:04 2015 -0500 Committer: Christopher Tubbs Committed: Wed Dec 2 20:04:04 2015 -0500 -- .../java/org/apache/accumulo/proxy/Proxy.java | 22 ++- .../apache/accumulo/server/util/RpcWrapper.java | 11 +- .../accumulo/server/util/RpcWrapperTest.java| 23 +++- .../accumulo/gc/SimpleGarbageCollector.java | 2 +- .../java/org/apache/accumulo/master/Master.java | 4 ++-- .../apache/accumulo/tserver/TabletServer.java | 2 +- 6 files changed, 35 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd8cf5e2/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java -- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java index 3368d20..53221e0 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -30,7 +30,6 @@ import org.apache.accumulo.proxy.thrift.AccumuloProxy; import org.apache.accumulo.server.util.RpcWrapper; import org.apache.log4j.Logger; import org.apache.thrift.TBaseProcessor; -import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TCompactProtocol; import org.apache.thrift.protocol.TProtocolFactory; import org.apache.thrift.server.THsHaServer; @@ -125,20 +124,23 @@ public class Proxy { public static TServer createProxyServer(Class api, Class implementor, final int port, Class protoClass, Properties properties) throws Exception { -final TNonblockingServerSocket socket = new TNonblockingServerSocket(port); - -// create the implementor -Object impl = implementor.getConstructor(Properties.class).newInstance(properties); - -Class proxyProcClass = Class.forName(api.getName() + "$Processor"); Class proxyIfaceClass = Class.forName(api.getName() + "$Iface"); +return createProxyServer(proxyIfaceClass, api, implementor, port, protoClass, properties); + } + private static TServer createProxyServer(final Class proxyIfaceClass, Class api, final Class implementor, + final int port, final Class protoClass, final Properties properties) throws Exception { +@SuppressWarnings("unchecked") +Class proxyProcClass = (Class) Class.forName(api.getName() + "$Processor"); + +// create the implementor @SuppressWarnings("unchecked") -Constructor proxyProcConstructor = (Constructor) proxyProcClass.getConstructor(proxyIfaceClass); +I impl = (I) implementor.getConstructor(Properties.class).newInstance(properties); -@SuppressWarnings({"rawtypes", "unchecked"}) -final TProcessor processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, ((TBaseProcessor) proxyProcConstructor.newInstance(impl)).getProcessMapView())); +Constructor proxyProcConstructor = proxyProcClass.getConstructor(proxyIfaceClass); +P processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, proxyProcConstructor.newInstance(impl))); +TNonblockingServerSocket socket = new TNonblockingServerSocket(port); THsHaServer.Args args = new THsHaServer.Args(socket); args.processor(processor); final long maxFrameSize = AccumuloConfiguration.getMemoryInBytes(properties.getProperty("maxFrameSize", "16M")); http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd8cf5e2/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java index aafe37c..78a9d4f 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java @@
[6/6] accumulo git commit: Merge branch '1.7'
Merge branch '1.7' Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/46e5d5c8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/46e5d5c8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/46e5d5c8 Branch: refs/heads/master Commit: 46e5d5c8d14c6fcacad5c15c71f5921d8333bd85 Parents: 7dc3736 0e3af1e Author: Christopher TubbsAuthored: Thu Dec 3 16:06:51 2015 -0500 Committer: Christopher Tubbs Committed: Thu Dec 3 16:06:51 2015 -0500 -- .../src/main/java/org/apache/accumulo/proxy/Proxy.java | 2 +- .../java/org/apache/accumulo/server/rpc/RpcWrapper.java | 12 ++-- .../org/apache/accumulo/server/rpc/RpcWrapperTest.java | 9 +++-- .../org/apache/accumulo/gc/SimpleGarbageCollector.java | 2 +- .../main/java/org/apache/accumulo/master/Master.java| 4 ++-- .../java/org/apache/accumulo/tserver/TabletServer.java | 4 ++-- 6 files changed, 15 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/46e5d5c8/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/46e5d5c8/server/master/src/main/java/org/apache/accumulo/master/Master.java -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/46e5d5c8/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java -- diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java index 1af114c,1080d8d..cc4ee73 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java @@@ -2292,8 -2331,8 +2292,8 @@@ public class TabletServer extends Accum private HostAndPort startTabletClientService() throws UnknownHostException { // start listening for client connection last -ThriftClientHandler handler = new ThriftClientHandler(); -Iface rpcProxy = RpcWrapper.service(handler, new Processor(handler)); +clientHandler = new ThriftClientHandler(); - Iface rpcProxy = RpcWrapper.service(clientHandler, new Processor(clientHandler).getProcessMapView()); ++Iface rpcProxy = RpcWrapper.service(clientHandler, new Processor(clientHandler)); final Processor processor; if (ThriftServerType.SASL == getThriftServerType()) { Iface tcredProxy = TCredentialsUpdatingWrapper.service(rpcProxy, ThriftClientHandler.class, getConfiguration());
[4/6] accumulo git commit: Merge branch '1.6' into 1.7
Merge branch '1.6' into 1.7 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0e3af1e8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0e3af1e8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0e3af1e8 Branch: refs/heads/master Commit: 0e3af1e8560b0a28a4415f8da38a561965d552dc Parents: e35e189 bd8cf5e Author: Christopher TubbsAuthored: Thu Dec 3 15:36:49 2015 -0500 Committer: Christopher Tubbs Committed: Thu Dec 3 15:36:49 2015 -0500 -- .../src/main/java/org/apache/accumulo/proxy/Proxy.java | 2 +- .../java/org/apache/accumulo/server/rpc/RpcWrapper.java | 12 ++-- .../org/apache/accumulo/server/rpc/RpcWrapperTest.java | 9 +++-- .../org/apache/accumulo/gc/SimpleGarbageCollector.java | 2 +- .../main/java/org/apache/accumulo/master/Master.java| 4 ++-- .../java/org/apache/accumulo/tserver/TabletServer.java | 4 ++-- 6 files changed, 15 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e3af1e8/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java -- diff --cc proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java index ca39786,53221e0..87e2c58 --- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java @@@ -161,113 -117,38 +161,113 @@@ public class Proxy implements KeywordEx Class protoFactoryClass = Class.forName(opts.prop.getProperty("protocolFactory", TCompactProtocol.Factory.class.getName())) .asSubclass(TProtocolFactory.class); +TProtocolFactory protoFactory = protoFactoryClass.newInstance(); int port = Integer.parseInt(opts.prop.getProperty("port")); -TServer server = createProxyServer(AccumuloProxy.class, ProxyServer.class, port, protoFactoryClass, opts.prop); -server.serve(); +String hostname = opts.prop.getProperty(THRIFT_SERVER_HOSTNAME, THRIFT_SERVER_HOSTNAME_DEFAULT); +HostAndPort address = HostAndPort.fromParts(hostname, port); +ServerAddress server = createProxyServer(address, protoFactory, opts.prop); +// Wait for the server to come up +while (!server.server.isServing()) { + Thread.sleep(100); +} +log.info("Proxy server started on " + server.getAddress()); +while (server.server.isServing()) { + Thread.sleep(1000); +} + } + + public static void main(String[] args) throws Exception { +new Proxy().execute(args); } - public static TServer createProxyServer(Class api, Class implementor, final int port, Class protoClass, - Properties properties) throws Exception { -Class proxyIfaceClass = Class.forName(api.getName() + "$Iface"); -return createProxyServer(proxyIfaceClass, api, implementor, port, protoClass, properties); + public static ServerAddress createProxyServer(HostAndPort address, TProtocolFactory protocolFactory, Properties properties) throws Exception { +return createProxyServer(address, protocolFactory, properties, ClientConfiguration.loadDefault()); } - private static TServer createProxyServer(final Class proxyIfaceClass, Class api, final Class implementor, - final int port, final Class protoClass, final Properties properties) throws Exception { -@SuppressWarnings("unchecked") -Class proxyProcClass = (Class) Class.forName(api.getName() + "$Processor"); - -// create the implementor -@SuppressWarnings("unchecked") -I impl = (I) implementor.getConstructor(Properties.class).newInstance(properties); - -Constructor proxyProcConstructor = proxyProcClass.getConstructor(proxyIfaceClass); -P processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, proxyProcConstructor.newInstance(impl))); - -TNonblockingServerSocket socket = new TNonblockingServerSocket(port); -THsHaServer.Args args = new THsHaServer.Args(socket); -args.processor(processor); -final long maxFrameSize = AccumuloConfiguration.getMemoryInBytes(properties.getProperty("maxFrameSize", "16M")); -if (maxFrameSize > Integer.MAX_VALUE) - throw new RuntimeException(maxFrameSize + " is larger than MAX_INT"); -args.transportFactory(new TFramedTransport.Factory((int) maxFrameSize)); -args.protocolFactory(protoClass.newInstance()); -args.maxReadBufferBytes = maxFrameSize; -return new THsHaServer(args); + public static ServerAddress createProxyServer(HostAndPort address, TProtocolFactory protocolFactory, Properties properties, ClientConfiguration clientConf) + throws Exception { +final int numThreads =
[3/6] accumulo git commit: ACCUMULO-4065 Tweak generics in RpcWrapper and related code
ACCUMULO-4065 Tweak generics in RpcWrapper and related code * depend more on compile time checks with generic checking * use better naming of generic params (I for Iface, P for Processor) to clarify relationship between types * remove unneeded casts and warnings suppressions Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bd8cf5e2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bd8cf5e2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bd8cf5e2 Branch: refs/heads/master Commit: bd8cf5e21305b63bd4bd62c92f7ed045eb440830 Parents: 5724df5 Author: Christopher TubbsAuthored: Wed Dec 2 20:04:04 2015 -0500 Committer: Christopher Tubbs Committed: Wed Dec 2 20:04:04 2015 -0500 -- .../java/org/apache/accumulo/proxy/Proxy.java | 22 ++- .../apache/accumulo/server/util/RpcWrapper.java | 11 +- .../accumulo/server/util/RpcWrapperTest.java| 23 +++- .../accumulo/gc/SimpleGarbageCollector.java | 2 +- .../java/org/apache/accumulo/master/Master.java | 4 ++-- .../apache/accumulo/tserver/TabletServer.java | 2 +- 6 files changed, 35 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd8cf5e2/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java -- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java index 3368d20..53221e0 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -30,7 +30,6 @@ import org.apache.accumulo.proxy.thrift.AccumuloProxy; import org.apache.accumulo.server.util.RpcWrapper; import org.apache.log4j.Logger; import org.apache.thrift.TBaseProcessor; -import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TCompactProtocol; import org.apache.thrift.protocol.TProtocolFactory; import org.apache.thrift.server.THsHaServer; @@ -125,20 +124,23 @@ public class Proxy { public static TServer createProxyServer(Class api, Class implementor, final int port, Class protoClass, Properties properties) throws Exception { -final TNonblockingServerSocket socket = new TNonblockingServerSocket(port); - -// create the implementor -Object impl = implementor.getConstructor(Properties.class).newInstance(properties); - -Class proxyProcClass = Class.forName(api.getName() + "$Processor"); Class proxyIfaceClass = Class.forName(api.getName() + "$Iface"); +return createProxyServer(proxyIfaceClass, api, implementor, port, protoClass, properties); + } + private static TServer createProxyServer(final Class proxyIfaceClass, Class api, final Class implementor, + final int port, final Class protoClass, final Properties properties) throws Exception { +@SuppressWarnings("unchecked") +Class proxyProcClass = (Class) Class.forName(api.getName() + "$Processor"); + +// create the implementor @SuppressWarnings("unchecked") -Constructor proxyProcConstructor = (Constructor) proxyProcClass.getConstructor(proxyIfaceClass); +I impl = (I) implementor.getConstructor(Properties.class).newInstance(properties); -@SuppressWarnings({"rawtypes", "unchecked"}) -final TProcessor processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, ((TBaseProcessor) proxyProcConstructor.newInstance(impl)).getProcessMapView())); +Constructor proxyProcConstructor = proxyProcClass.getConstructor(proxyIfaceClass); +P processor = proxyProcConstructor.newInstance(RpcWrapper.service(impl, proxyProcConstructor.newInstance(impl))); +TNonblockingServerSocket socket = new TNonblockingServerSocket(port); THsHaServer.Args args = new THsHaServer.Args(socket); args.processor(processor); final long maxFrameSize = AccumuloConfiguration.getMemoryInBytes(properties.getProperty("maxFrameSize", "16M")); http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd8cf5e2/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java -- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java index aafe37c..78a9d4f 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java @@ -28,7 +28,7 @@ import org.apache.accumulo.trace.instrument.thrift.RpcServerInvocationHandler; import org.apache.accumulo.trace.instrument.thrift.TraceWrap; import
[3/3] accumulo git commit: Merge branch '1.7'
Merge branch '1.7' Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6e5fa1c6 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6e5fa1c6 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6e5fa1c6 Branch: refs/heads/master Commit: 6e5fa1c6bf8e6193439c81d57aa36159d5197ad9 Parents: 46e5d5c 3aa9d30 Author: Josh ElserAuthored: Thu Dec 3 16:15:54 2015 -0500 Committer: Josh Elser Committed: Thu Dec 3 16:15:54 2015 -0500 -- .../org/apache/accumulo/core/conf/Property.java | 2 + .../apache/accumulo/core/rpc/ThriftUtil.java| 60 ++ .../accumulo/server/security/SecurityUtil.java | 47 - .../org/apache/accumulo/harness/TestingKdc.java | 13 +- .../test/functional/KerberosRenewalIT.java | 188 +++ 5 files changed, 303 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/6e5fa1c6/core/src/main/java/org/apache/accumulo/core/conf/Property.java -- http://git-wip-us.apache.org/repos/asf/accumulo/blob/6e5fa1c6/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java -- diff --cc test/src/main/java/org/apache/accumulo/harness/TestingKdc.java index 1f84fc8,000..653139a mode 100644,00..100644 --- a/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java +++ b/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java @@@ -1,212 -1,0 +1,219 @@@ +/* + * 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.harness; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import org.apache.accumulo.cluster.ClusterUser; +import org.apache.hadoop.minikdc.MiniKdc; +import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Creates a {@link MiniKdc} for tests to use to exercise secure Accumulo + */ +public class TestingKdc { + private static final Logger log = LoggerFactory.getLogger(TestingKdc.class); + + public static final int NUM_USERS = 10; ++ public static final long MAX_TICKET_LIFETIME_MILLIS = 8640; // one day + + protected MiniKdc kdc = null; + protected ClusterUser accumuloServerUser = null, accumuloAdmin = null; + protected List clientPrincipals = null; + + public final String ORG_NAME = "EXAMPLE", ORG_DOMAIN = "COM"; + + private String hostname; + private File keytabDir; + private boolean started = false; + + public TestingKdc() throws Exception { - this(computeKdcDir(), computeKeytabDir()); ++this(computeKdcDir(), computeKeytabDir(), MAX_TICKET_LIFETIME_MILLIS); + } + - private static File computeKdcDir() { ++ public static File computeKdcDir() { +File targetDir = new File(System.getProperty("user.dir"), "target"); +if (!targetDir.exists()) + Assert.assertTrue(targetDir.mkdirs()); +Assert.assertTrue("Could not find Maven target directory: " + targetDir, targetDir.exists() && targetDir.isDirectory()); + +// Create the directories: target/kerberos/minikdc +File kdcDir = new File(new File(targetDir, "kerberos"), "minikdc"); + +assertTrue(kdcDir.mkdirs() || kdcDir.isDirectory()); + +return kdcDir; + } + - private static File computeKeytabDir() { ++ public static File computeKeytabDir() { +File targetDir = new File(System.getProperty("user.dir"), "target"); +Assert.assertTrue("Could not find Maven target directory: " + targetDir, targetDir.exists() && targetDir.isDirectory()); + +// Create the directories: target/kerberos/keytabs +File keytabDir = new File(new File(targetDir, "kerberos"), "keytabs"); + +