You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/11/05 20:17:31 UTC

[GitHub] mikewalch opened a new issue #747: Shorten method names in AccumuloClient builder

mikewalch opened a new issue #747: Shorten method names in AccumuloClient builder
URL: https://github.com/apache/accumulo/issues/747
 
 
   [AccumuloClient](https://github.com/apache/accumulo/blob/master/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java) has long method names for its builder that could be shortened before 2.0 is released.
   
   Below are examples of this proposed shortening:
   
   ```java
   // current
   Accumulo.newClient().forInstance("myinstance", "zookeeper1,zookeeper2")
         .usingPassword("myuser", "mypassword").build();
   // proposed
   Accumulo.newClient().instance("myinstance", "zookeeper1,zookeeper2")
         .user("myuser", "mypassword").build();
   
   
   
   // current
   Accumulo.newClient().usingClientInfo(clientInfo)
        .usingToken("user, new PasswordToken("pass")).build();
   // proposed
   Accumulo.newClient().from(clientInfo).user("user", new PasswordToken("pass")).build();
   ```
   
   Below is a chart of the proposed method names for the [AccumuloClient](https://github.com/apache/accumulo/blob/master/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java) builder. Naming is subjective so I am open to no change or different names. Feel fre to comment on this issue:
   
   | Current Method Name | Proposed Method Name |
   |--------------------------|-------------------------------|
   |  forInstance(String name, String zk) | instance(String name, String zk) |
   | usingProperties(String propsFilePath) | from(String propsFilePath) |
   | usingProperties(Properties properties) | from(Properties props) |
   | usingClientInfo(ClientInfo info) | from(ClientInfo info) |
   | usingPassword(String username, CharSequence password) | user(String username, CharSequence password) |
   | usingKerberos(String principal, String keytabFile) | kerberosUser(String principal, String keytabPath) |
   | usingToken(String principal, AuthenticationToken token) | user(String principal, AuthenticationToken token) |
   | withTruststore | truststore |
   | withKeystore | keystore |
   | withJsse | jsse |
   | withPrimary | primary |
   | withQop | qop |
   | withSsl | ssl |
   | withSasl | sasl |
   | withBatchWriterConfig | batchWriterConfig |
   | withBatchScannerQueryThreads | batchScannerQueryThreads |
   | withScannerBatchSize | scannerBatchSize |
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services