Search in sources :

Example 26 with Property

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;
}
Also used : Property(org.apache.accumulo.core.conf.Property)

Example 27 with Property

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);
}
Also used : Property(org.apache.accumulo.core.conf.Property)

Example 28 with Property

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;
}
Also used : Property(org.apache.accumulo.core.conf.Property)

Example 29 with Property

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));
}
Also used : Property(org.apache.accumulo.core.conf.Property) Test(org.junit.Test)

Example 30 with Property

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));
}
Also used : Property(org.apache.accumulo.core.conf.Property) Test(org.junit.Test)

Aggregations

Property (org.apache.accumulo.core.conf.Property)40 Test (org.junit.Test)19 HashMap (java.util.HashMap)11 AccumuloConfiguration (org.apache.accumulo.core.conf.AccumuloConfiguration)11 File (java.io.File)8 Path (org.apache.hadoop.fs.Path)7 IOException (java.io.IOException)6 Map (java.util.Map)6 Predicate (java.util.function.Predicate)5 ConfigurationCopy (org.apache.accumulo.core.conf.ConfigurationCopy)5 VolumeManager (org.apache.accumulo.server.fs.VolumeManager)5 AccumuloException (org.apache.accumulo.core.client.AccumuloException)4 DefaultConfiguration (org.apache.accumulo.core.conf.DefaultConfiguration)4 TableConfiguration (org.apache.accumulo.server.conf.TableConfiguration)4 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)3 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)3 AccumuloServerContext (org.apache.accumulo.server.AccumuloServerContext)3 NamespaceConfiguration (org.apache.accumulo.server.conf.NamespaceConfiguration)3 TServerInstance (org.apache.accumulo.server.master.state.TServerInstance)3 ArrayList (java.util.ArrayList)2