Search in sources :

Example 56 with Configuration

use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.

the class StormAtlasHookIT method setUp.

@BeforeClass
public void setUp() throws Exception {
    // start a local storm cluster
    stormCluster = StormTestUtil.createLocalStormCluster();
    LOG.info("Created a storm local cluster");
    Configuration configuration = ApplicationProperties.get();
    if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
        atlasClient = new AtlasClient(configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT), new String[] { "admin", "admin" });
    } else {
        atlasClient = new AtlasClient(configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT));
    }
}
Also used : Configuration(org.apache.commons.configuration.Configuration) AtlasClient(org.apache.atlas.AtlasClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 57 with Configuration

use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.

the class TestUtils method setupGraphProvider.

/**
     * Triggers the Atlas initialization process using the specified MetadataRepository.
     * This causes the built-in types and their indices to be created.
     */
public static void setupGraphProvider(MetadataRepository repo) throws AtlasException {
    TypeCache typeCache = null;
    try {
        typeCache = AtlasRepositoryConfiguration.getTypeCache().newInstance();
    } catch (Throwable t) {
        typeCache = new DefaultTypeCache();
    }
    final GraphBackedSearchIndexer indexer = new GraphBackedSearchIndexer(new AtlasTypeRegistry());
    Configuration config = ApplicationProperties.get();
    ITypeStore typeStore = new GraphBackedTypeStore(AtlasGraphProvider.getGraphInstance());
    DefaultMetadataService defaultMetadataService = new DefaultMetadataService(repo, typeStore, new HashSet<TypesChangeListener>() {

        {
            add(indexer);
        }
    }, new HashSet<EntityChangeListener>(), TypeSystem.getInstance(), config, typeCache, // Fixme: Can we work with Noop
    new InMemoryEntityAuditRepository());
    //commit the created types
    getGraph().commit();
}
Also used : EntityChangeListener(org.apache.atlas.listener.EntityChangeListener) AtlasRepositoryConfiguration(org.apache.atlas.util.AtlasRepositoryConfiguration) Configuration(org.apache.commons.configuration.Configuration) AtlasTypeRegistry(org.apache.atlas.type.AtlasTypeRegistry) InMemoryEntityAuditRepository(org.apache.atlas.repository.audit.InMemoryEntityAuditRepository) ITypeStore(org.apache.atlas.repository.typestore.ITypeStore) GraphBackedSearchIndexer(org.apache.atlas.repository.graph.GraphBackedSearchIndexer) TypesChangeListener(org.apache.atlas.listener.TypesChangeListener) GraphBackedTypeStore(org.apache.atlas.repository.typestore.GraphBackedTypeStore) DefaultMetadataService(org.apache.atlas.services.DefaultMetadataService) TypeCache(org.apache.atlas.typesystem.types.cache.TypeCache) DefaultTypeCache(org.apache.atlas.typesystem.types.cache.DefaultTypeCache) DefaultTypeCache(org.apache.atlas.typesystem.types.cache.DefaultTypeCache)

Example 58 with Configuration

use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.

the class QuickStart method getServerUrl.

static String[] getServerUrl(String[] args) throws AtlasException {
    if (args.length > 0) {
        return args[0].split(",");
    }
    Configuration configuration = ApplicationProperties.get();
    String[] urls = configuration.getStringArray(ATLAS_REST_ADDRESS);
    if (urls == null || urls.length == 0) {
        System.out.println("Usage: quick_start_v1.py <atlas endpoint of format <http/https>://<atlas-fqdn>:<atlas port> like http://localhost:21000>");
        System.exit(-1);
    }
    return urls;
}
Also used : Configuration(org.apache.commons.configuration.Configuration)

Example 59 with Configuration

use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.

the class QuickStartV2 method getServerUrl.

static String[] getServerUrl(String[] args) throws AtlasException {
    if (args.length > 0) {
        return args[0].split(",");
    }
    Configuration configuration = ApplicationProperties.get();
    String[] urls = configuration.getStringArray(ATLAS_REST_ADDRESS);
    if (ArrayUtils.isEmpty(urls)) {
        System.out.println("org.apache.atlas.examples.QuickStartV2 <Atlas REST address <http/https>://<atlas-fqdn>:<atlas-port> like http://localhost:21000>");
        System.exit(-1);
    }
    return urls;
}
Also used : Configuration(org.apache.commons.configuration.Configuration)

Example 60 with Configuration

use of org.apache.commons.configuration.Configuration in project incubator-atlas by apache.

the class Atlas method main.

public static void main(String[] args) throws Exception {
    CommandLine cmd = parseArgs(args);
    PropertiesConfiguration buildConfiguration = new PropertiesConfiguration("atlas-buildinfo.properties");
    String appPath = "webapp/target/atlas-webapp-" + getProjectVersion(buildConfiguration);
    if (cmd.hasOption(APP_PATH)) {
        appPath = cmd.getOptionValue(APP_PATH);
    }
    setApplicationHome();
    Configuration configuration = ApplicationProperties.get();
    final String enableTLSFlag = configuration.getString(SecurityProperties.TLS_ENABLED);
    final int appPort = getApplicationPort(cmd, enableTLSFlag, configuration);
    System.setProperty(AtlasConstants.SYSTEM_PROPERTY_APP_PORT, String.valueOf(appPort));
    final boolean enableTLS = isTLSEnabled(enableTLSFlag, appPort);
    configuration.setProperty(SecurityProperties.TLS_ENABLED, String.valueOf(enableTLS));
    showStartupInfo(buildConfiguration, enableTLS, appPort);
    server = EmbeddedServer.newServer(appPort, appPath, enableTLS);
    installLogBridge();
    server.start();
}
Also used : CommandLine(org.apache.commons.cli.CommandLine) Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Aggregations

Configuration (org.apache.commons.configuration.Configuration)185 Test (org.junit.Test)51 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)44 ZapXmlConfiguration (org.zaproxy.zap.utils.ZapXmlConfiguration)23 Test (org.testng.annotations.Test)22 File (java.io.File)14 AbstractConfiguration (org.apache.commons.configuration.AbstractConfiguration)13 MidpointConfiguration (com.evolveum.midpoint.common.configuration.api.MidpointConfiguration)11 Properties (java.util.Properties)10 HashMap (java.util.HashMap)9 AtlasException (org.apache.atlas.AtlasException)9 CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)9 ArrayList (java.util.ArrayList)8 ZkUtils (kafka.utils.ZkUtils)8 ConfigurationException (org.apache.commons.configuration.ConfigurationException)8 IndexLoadingConfigMetadata (com.linkedin.pinot.common.metadata.segment.IndexLoadingConfigMetadata)7 AtlasClient (org.apache.atlas.AtlasClient)6 BeforeClass (org.testng.annotations.BeforeClass)6 MockResponse (com.github.bordertech.wcomponents.util.mock.MockResponse)5 IOException (java.io.IOException)5