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 2019/08/23 17:13:43 UTC
[GitHub] [accumulo] hkeebler edited a comment on issue #1330: Fix #1090
Consolidate/Simplfy ServerOpts
hkeebler edited a comment on issue #1330: Fix #1090 Consolidate/Simplfy ServerOpts
URL: https://github.com/apache/accumulo/pull/1330#issuecomment-524392484
Added the hostname assignment back into the AbstractServer. I don't love that the appName is a string assigned and hardcoded in each server class but it works for now. It probably would be good to create an ApplicatioName enum for these (another ticket).
```java
protected AbstractServer(String appName, ConfigOpts opts, String[] args) {
this.log = LoggerFactory.getLogger(getClass().getName());
this.applicationName = appName;
opts.parseArgs(appName, args);
var siteConfig = opts.getSiteConfiguration();
this.hostname = siteConfig.get(appName+ Property.SERVER_ADDRESS_BIND_SUFFIX); <====
context = new ServerContext(siteConfig);
SecurityUtil.serverLogin(siteConfig);
log.info("Version " + Constants.VERSION);
log.info("Instance " + context.getInstanceID());
ServerUtil.init(context, appName);
this.metricsSystem = Metrics.initSystem(getClass().getSimpleName());
TraceUtil.enableServerTraces(hostname, appName, context.getConfiguration());
if (context.getSaslParams() != null) {
// Server-side "client" check to make sure we're logged in as a user we expect to be
context.enforceKerberosLogin();
}
}
```
Also added a deprecation property override so it may make it easier to deprecate the --address option . Still reviewing.
```
/**
* Performs special processing of deprecated options.
* Could be cleaned up periodically as deprecations are deleted
* @param option
* @param value
*/
private static void processDeprecation(String option, String value){
if ("-s".equals(option)){
deprecated_overrides.add(Property.GC_SAFEMODE.getKey()+"=true");
}
}
```
So now I can get rid of
`safemode = opts.safeMode || getConfiguration().getBoolean(Property.GC_SAFEMODE);`
and replace with just
`safemode = getConfiguration().getBoolean(Property.GC_SAFEMODE);`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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