use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class Initialize method getInitialPasswordWarning.
/**
* Create warning message related to initial password, if appropriate.
*
* ACCUMULO-2907 Remove unnecessary security warning from console message unless its actually appropriate. The warning message should only be displayed when
* the value of <code>instance.security.authenticator</code> differs between the SiteConfiguration and the DefaultConfiguration values.
*
* @return String containing warning portion of console message.
*/
private String getInitialPasswordWarning() {
String optionalWarning;
Property authenticatorProperty = Property.INSTANCE_SECURITY_AUTHENTICATOR;
if (SiteConfiguration.getInstance().get(authenticatorProperty).equals(authenticatorProperty.getDefaultValue()))
optionalWarning = ": ";
else
optionalWarning = " (this may not be applicable for your security setup): ";
return optionalWarning;
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class Initialize method printInitializeFailureMessages.
static void printInitializeFailureMessages(SiteConfiguration sconf) {
@SuppressWarnings("deprecation") Property INSTANCE_DFS_DIR = Property.INSTANCE_DFS_DIR;
@SuppressWarnings("deprecation") Property INSTANCE_DFS_URI = Property.INSTANCE_DFS_URI;
String instanceDfsDir = sconf.get(INSTANCE_DFS_DIR);
// ACCUMULO-3651 Changed level to error and added FATAL to message for slf4j compatibility
log.error("FATAL It appears the directories {}", Arrays.asList(VolumeConfiguration.getVolumeUris(SiteConfiguration.getInstance())) + " were previously initialized.");
String instanceVolumes = sconf.get(Property.INSTANCE_VOLUMES);
String instanceDfsUri = sconf.get(INSTANCE_DFS_URI);
if (!instanceVolumes.isEmpty()) {
log.error("FATAL: Change the property {} to use different filesystems,", Property.INSTANCE_VOLUMES);
} else if (!instanceDfsDir.isEmpty()) {
log.error("FATAL: Change the property {} to use a different filesystem,", INSTANCE_DFS_URI);
} else {
log.error("FATAL: You are using the default URI for the filesystem. Set the property {} to use a different filesystem,", Property.INSTANCE_VOLUMES);
}
log.error("FATAL: or change the property {} to use a different directory.", INSTANCE_DFS_DIR);
log.error("FATAL: The current value of {} is |{}|", INSTANCE_DFS_URI, instanceDfsUri);
log.error("FATAL: The current value of {} is |{}|", INSTANCE_DFS_DIR, instanceDfsDir);
log.error("FATAL: The current value of {} is |{}|", Property.INSTANCE_VOLUMES, instanceVolumes);
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class Admin method getDefaultConfigValue.
private String getDefaultConfigValue(String key) {
if (null == key)
return null;
String defaultValue = null;
try {
Property p = Property.getPropertyByKey(key);
if (null == p)
return defaultValue;
defaultValue = defaultConfig.get(p);
} catch (IllegalArgumentException e) {
// ignore
}
return defaultValue;
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class NamespaceConfigurationTest method testGet_InParent.
@Test
public void testGet_InParent() {
Property p = Property.INSTANCE_SECRET;
expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZNAMESPACES + "/" + NSID + Constants.ZNAMESPACE_CONF + "/" + p.getKey())).andReturn(null);
replay(zc);
expect(parent.get(p)).andReturn("sekrit");
replay(parent);
assertEquals("sekrit", c.get(Property.INSTANCE_SECRET));
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class NamespaceConfigurationTest method testGet_InZK.
@Test
public void testGet_InZK() {
Property p = Property.INSTANCE_SECRET;
expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZNAMESPACES + "/" + NSID + Constants.ZNAMESPACE_CONF + "/" + p.getKey())).andReturn("sekrit".getBytes(UTF_8));
replay(zc);
assertEquals("sekrit", c.get(Property.INSTANCE_SECRET));
}
Aggregations