@Override public String getInstanceName() { if (instanceName == null) instanceName = InstanceOperationsImpl.lookupInstanceName(zooCache, UUID.fromString(getInstanceID())); return instanceName; }
@Override public synchronized InstanceOperations instanceOperations() { ensureOpen(); if (instanceops == null) instanceops = new InstanceOperationsImpl(this); return instanceops; }
void checkLocalityGroups(String propChanged) throws AccumuloSecurityException, AccumuloException { if (LocalityGroupUtil.isLocalityGroupProperty(propChanged)) { try { LocalityGroupUtil.checkLocalityGroups(getSystemConfiguration().entrySet()); } catch (LocalityGroupConfigurationError | RuntimeException e) { LoggerFactory.getLogger(this.getClass()).warn("Changing '" + propChanged + "' resulted in bad locality group config. This may be a transient situation since " + "the config spreads over multiple properties. Setting properties in a different " + "order may help. Even though this warning was displayed, the property was updated. " + "Please check your config to ensure consistency.", e); } } }
@Override public void setProperty(final String property, final String value) throws AccumuloException, AccumuloSecurityException, IllegalArgumentException { checkArgument(property != null, "property is null"); checkArgument(value != null, "value is null"); MasterClient.executeVoid(context, client -> client.setSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property, value)); checkLocalityGroups(property); }
@Override public void removeProperty(final String property) throws AccumuloException, AccumuloSecurityException { checkArgument(property != null, "property is null"); MasterClient.executeVoid(context, client -> client.removeSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property)); checkLocalityGroups(property); }
ServerInfo(SiteConfiguration config) { SingletonManager.setMode(Mode.SERVER); siteConfig = config; hadoopConf = new Configuration(); try { volumeManager = VolumeManagerImpl.get(siteConfig, hadoopConf); } catch (IOException e) { throw new IllegalStateException(e); } Path instanceIdPath = ServerUtil.getAccumuloInstanceIdPath(volumeManager); instanceID = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, config, hadoopConf); zooKeepers = config.get(Property.INSTANCE_ZK_HOST); zooKeepersSessionTimeOut = (int) config.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT); zooCache = new ZooCacheFactory().getZooCache(zooKeepers, zooKeepersSessionTimeOut); instanceName = InstanceOperationsImpl.lookupInstanceName(zooCache, UUID.fromString(instanceID)); }