Search in sources :

Example 1 with TypeCache

use of org.apache.atlas.typesystem.types.cache.TypeCache 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)

Aggregations

EntityChangeListener (org.apache.atlas.listener.EntityChangeListener)1 TypesChangeListener (org.apache.atlas.listener.TypesChangeListener)1 InMemoryEntityAuditRepository (org.apache.atlas.repository.audit.InMemoryEntityAuditRepository)1 GraphBackedSearchIndexer (org.apache.atlas.repository.graph.GraphBackedSearchIndexer)1 GraphBackedTypeStore (org.apache.atlas.repository.typestore.GraphBackedTypeStore)1 ITypeStore (org.apache.atlas.repository.typestore.ITypeStore)1 DefaultMetadataService (org.apache.atlas.services.DefaultMetadataService)1 AtlasTypeRegistry (org.apache.atlas.type.AtlasTypeRegistry)1 DefaultTypeCache (org.apache.atlas.typesystem.types.cache.DefaultTypeCache)1 TypeCache (org.apache.atlas.typesystem.types.cache.TypeCache)1 AtlasRepositoryConfiguration (org.apache.atlas.util.AtlasRepositoryConfiguration)1 Configuration (org.apache.commons.configuration.Configuration)1