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

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new cb0c034  Provide default values for LedgerIdFormatter and 
EntryFormatter
cb0c034 is described below

commit cb0c034f8e2e77ad41246a2952463cd7e3b55d6c
Author: cguttapalem <cguttapa...@salesforce.com>
AuthorDate: Fri Feb 23 00:02:32 2018 -0800

    Provide default values for LedgerIdFormatter and EntryFormatter
    
    Descriptions of the changes in this PR:
    
    Provide default values for LedgerIdFormatter and EntryFormatter.
    
    Author: cguttapalem <cguttapa...@salesforce.com>
    
    Reviewers: Enrico Olivelli <eolive...@gmail.com>, Sijie Guo 
<si...@apache.org>
    
    This closes #1199 from reddycharan/defaultformatter
---
 .../org/apache/bookkeeper/conf/AbstractConfiguration.java | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java
index 526912b..9c90c33 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java
@@ -96,6 +96,11 @@ public abstract class AbstractConfiguration<T extends 
AbstractConfiguration>
     // Enable authentication of the other connection end point (mutual 
authentication)
     protected static final String TLS_CLIENT_AUTHENTICATION = 
"tlsClientAuthentication";
 
+    // Default formatter classes
+    protected static final Class<? extends EntryFormatter> 
DEFAULT_ENTRY_FORMATTER = StringEntryFormatter.class;
+    protected static final Class<? extends LedgerIdFormatter> 
DEFAULT_LEDGERID_FORMATTER =
+            LedgerIdFormatter.UUIDLedgerIdFormatter.class;
+
     /**
      * This list will be passed to {@link 
SSLEngine#setEnabledCipherSuites(java.lang.String[]) }.
      * Please refer to official JDK JavaDocs
@@ -486,9 +491,8 @@ public abstract class AbstractConfiguration<T extends 
AbstractConfiguration>
      */
     public Class<? extends LedgerIdFormatter> getLedgerIdFormatterClass()
         throws ConfigurationException {
-        return ReflectionUtils.getClass(this, LEDGERID_FORMATTER_CLASS,
-                                        null, 
LedgerIdFormatter.UUIDLedgerIdFormatter.class,
-                                        
LedgerIdFormatter.class.getClassLoader());
+        return ReflectionUtils.getClass(this, LEDGERID_FORMATTER_CLASS, 
DEFAULT_LEDGERID_FORMATTER,
+                LedgerIdFormatter.class, DEFAULT_LOADER);
     }
 
     /**
@@ -508,9 +512,8 @@ public abstract class AbstractConfiguration<T extends 
AbstractConfiguration>
      */
     public Class<? extends EntryFormatter> getEntryFormatterClass()
         throws ConfigurationException {
-        return ReflectionUtils.getClass(this, ENTRY_FORMATTER_CLASS,
-                                        null, StringEntryFormatter.class,
-                                        EntryFormatter.class.getClassLoader());
+        return ReflectionUtils.getClass(this, ENTRY_FORMATTER_CLASS, 
DEFAULT_ENTRY_FORMATTER, EntryFormatter.class,
+                DEFAULT_LOADER);
     }
 
     /**

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

Reply via email to