Java Code Examples for org.apache.atlas.ApplicationProperties#getClass()

The following examples show how to use org.apache.atlas.ApplicationProperties#getClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AtlasRepositoryConfiguration.java    From atlas with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public static Class<? extends GraphDatabase> getGraphDatabaseImpl() {
    try {
        final Class<? extends GraphDatabase> ret;
        Configuration                        config            = ApplicationProperties.get();
        String                               graphDatabaseImpl = config.getString(ApplicationProperties.GRAPHDB_BACKEND_CONF);

        if (StringUtils.equals(graphDatabaseImpl, ApplicationProperties.GRAPHBD_BACKEND_JANUS)) {
            ret = ApplicationProperties.getClass(JANUS_GRAPH_DATABASE_IMPLEMENTATION_CLASS, GraphDatabase.class);
        } else {
            ret = ApplicationProperties.getClass(graphDatabaseImpl, GraphDatabase.class);
        }

        return ret;
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}
 
Example 2
Source File: AtlasRepositoryConfiguration.java    From atlas with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static Class<? extends EntityAuditRepository> getAuditRepositoryImpl() {
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config,
                AUDIT_REPOSITORY_IMPLEMENTATION_PROPERTY, HBaseBasedAuditRepository.class.getName(), EntityAuditRepository.class);
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}
 
Example 3
Source File: AtlasRepositoryConfiguration.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static Class<? extends DeleteHandlerV1> getDeleteHandlerV1Impl() {
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config,
                                              DELETE_HANDLER_V1_IMPLEMENTATION_PROPERTY, SoftDeleteHandlerV1.class.getName(), DeleteHandlerV1.class);
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}
 
Example 4
Source File: AtlasRepositoryConfiguration.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static Class<? extends TypeCache> getTypeCache() {
    // Get the type cache implementation class from Atlas configuration.
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config, TYPE_CACHE_IMPLEMENTATION_PROPERTY,
                DefaultTypeCache.class.getName(), TypeCache.class);
    } catch (AtlasException e) {
        LOG.error("Error loading typecache ", e);
        return DefaultTypeCache.class;
    }
}
 
Example 5
Source File: AtlasRepositoryConfiguration.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static Class<? extends EntityAuditRepository> getAuditRepositoryImpl() {
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config,
                AUDIT_REPOSITORY_IMPLEMENTATION_PROPERTY, HBaseBasedAuditRepository.class.getName(), EntityAuditRepository.class);
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}
 
Example 6
Source File: AtlasRepositoryConfiguration.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static Class<? extends DeleteHandler> getDeleteHandlerImpl() {
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config,
                DELETE_HANDLER_IMPLEMENTATION_PROPERTY, SoftDeleteHandler.class.getName(), DeleteHandler.class);
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}
 
Example 7
Source File: AtlasRepositoryConfiguration.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
public static Class<? extends DeleteHandlerV1> getDeleteHandlerV1Impl() {
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config,
                DELETE_HANDLER_V1_IMPLEMENTATION_PROPERTY, SoftDeleteHandlerV1.class.getName(), DeleteHandlerV1.class);
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}
 
Example 8
Source File: AtlasRepositoryConfiguration.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static Class<? extends GraphDatabase> getGraphDatabaseImpl() {
    try {
        Configuration config = ApplicationProperties.get();
        return ApplicationProperties.getClass(config,
                GRAPH_DATABASE_IMPLEMENTATION_PROPERTY, DEFAULT_GRAPH_DATABASE_IMPLEMENTATION_CLASS, GraphDatabase.class);
    } catch (AtlasException e) {
        throw new RuntimeException(e);
    }
}