You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2018/02/09 00:33:19 UTC

[accumulo] branch 1.8 updated: misc performance improvements (#379)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/1.8 by this push:
     new 3a6f0d7  misc performance improvements (#379)
3a6f0d7 is described below

commit 3a6f0d77756924e6d8db1149cb21f875ab662732
Author: Keith Turner <ke...@deenlo.com>
AuthorDate: Thu Feb 8 19:33:17 2018 -0500

    misc performance improvements (#379)
    
    * Avoid computing audit log message when level is not enabled
     * Faster hash function in thrift transport key
     * Avoid accessing site config for frequently accessed properties
---
 .../java/org/apache/accumulo/core/client/impl/ThriftTransportKey.java | 4 +++-
 core/src/main/java/org/apache/accumulo/core/conf/Property.java        | 2 +-
 .../org/apache/accumulo/server/security/AuditedSecurityOperation.java | 4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportKey.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportKey.java
index 0b24b90..f1ab501 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportKey.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportKey.java
@@ -18,6 +18,8 @@ package org.apache.accumulo.core.client.impl;
 
 import static java.util.Objects.requireNonNull;
 
+import java.util.Objects;
+
 import org.apache.accumulo.core.rpc.SaslConnectionParams;
 import org.apache.accumulo.core.rpc.SslConnectionParams;
 import org.apache.accumulo.core.util.HostAndPort;
@@ -87,7 +89,7 @@ public class ThriftTransportKey {
   @Override
   public int hashCode() {
     if (hash == -1)
-      hash = toString().hashCode();
+      hash = Objects.hash(server, timeout, sslParams, saslParams);
     return hash;
   }
 
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 f64b9e2..a72e60e 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
@@ -840,7 +840,7 @@ public enum Property {
   public static final EnumSet<Property> HOT_PATH_PROPERTIES = EnumSet.of(Property.TSERV_CLIENT_TIMEOUT, Property.TSERV_TOTAL_MUTATION_QUEUE_MAX,
       Property.TSERV_ARCHIVE_WALOGS, Property.GC_TRASH_IGNORE, Property.TSERV_MAJC_DELAY, Property.TABLE_MINC_LOGS_MAX, Property.TSERV_MAJC_MAXCONCURRENT,
       Property.REPLICATION_WORKER_THREADS, Property.TABLE_DURABILITY, Property.INSTANCE_ZK_TIMEOUT, Property.TABLE_CLASSPATH,
-      Property.MASTER_METADATA_SUSPENDABLE);
+      Property.MASTER_METADATA_SUSPENDABLE, Property.TABLE_FAILURES_IGNORE, Property.TABLE_SCAN_MAXMEM);
 
   private static final EnumSet<Property> fixedProperties = EnumSet.of(Property.TSERV_CLIENTPORT, Property.TSERV_NATIVEMAP_ENABLED,
       Property.TSERV_SCAN_MAX_OPENFILES, Property.MASTER_CLIENTPORT, Property.GC_PORT);
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java b/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
index e5ca006..22bf119 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
@@ -113,13 +113,13 @@ public class AuditedSecurityOperation extends SecurityOperation {
   }
 
   private void audit(TCredentials credentials, String template, Object... args) {
-    if (shouldAudit(credentials)) {
+    if (audit.isInfoEnabled() && shouldAudit(credentials)) {
       audit.info("operation: success; user: " + credentials.getPrincipal() + ": " + String.format(template, args));
     }
   }
 
   private void audit(TCredentials credentials, boolean permitted, String template, Object... args) {
-    if (shouldAudit(credentials)) {
+    if (audit.isInfoEnabled() && shouldAudit(credentials)) {
       String prefix = permitted ? "permitted" : "denied";
       audit.info("operation: " + prefix + "; user: " + credentials.getPrincipal() + "; client: " + TServerUtils.clientAddress.get() + "; "
           + String.format(template, args));

-- 
To stop receiving notification emails like this one, please contact
kturner@apache.org.