当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationProperties.getSubsetConfiguration方法代码示例

本文整理汇总了Java中org.apache.atlas.ApplicationProperties.getSubsetConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationProperties.getSubsetConfiguration方法的具体用法?Java ApplicationProperties.getSubsetConfiguration怎么用?Java ApplicationProperties.getSubsetConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.atlas.ApplicationProperties的用法示例。


在下文中一共展示了ApplicationProperties.getSubsetConfiguration方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConfiguration

import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
public static Configuration getConfiguration() throws AtlasException {
    Configuration configProperties = ApplicationProperties.get();

    Configuration titanConfig = ApplicationProperties.getSubsetConfiguration(configProperties, GRAPH_PREFIX);

    //add serializers for non-standard property value types that Atlas uses

    titanConfig.addProperty("attributes.custom.attribute1.attribute-class", TypeCategory.class.getName());
    titanConfig.addProperty("attributes.custom.attribute1.serializer-class",
            TypeCategorySerializer.class.getName());

    //not ideal, but avoids making large changes to Atlas
    titanConfig.addProperty("attributes.custom.attribute2.attribute-class", ArrayList.class.getName());
    titanConfig.addProperty("attributes.custom.attribute2.serializer-class", StringListSerializer.class.getName());

    titanConfig.addProperty("attributes.custom.attribute3.attribute-class", BigInteger.class.getName());
    titanConfig.addProperty("attributes.custom.attribute3.serializer-class", BigIntegerSerializer.class.getName());

    titanConfig.addProperty("attributes.custom.attribute4.attribute-class", BigDecimal.class.getName());
    titanConfig.addProperty("attributes.custom.attribute4.serializer-class", BigDecimalSerializer.class.getName());

    return titanConfig;
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:24,代码来源:Titan1GraphDatabase.java

示例2: getHBaseConfiguration

import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
/**
 * Converts atlas' application properties to hadoop conf
 * @return
 * @throws AtlasException
 * @param atlasConf
 */
public static org.apache.hadoop.conf.Configuration getHBaseConfiguration(Configuration atlasConf) throws AtlasException {
    Configuration subsetAtlasConf =
            ApplicationProperties.getSubsetConfiguration(atlasConf, CONFIG_PREFIX);
    org.apache.hadoop.conf.Configuration hbaseConf = HBaseConfiguration.create();
    Iterator<String> keys = subsetAtlasConf.getKeys();
    while (keys.hasNext()) {
        String key = keys.next();
        hbaseConf.set(key, subsetAtlasConf.getString(key));
    }
    return hbaseConf;
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:18,代码来源:HBaseBasedAuditRepository.java

示例3: setUp

import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@BeforeTest
public void setUp() throws AtlasException {
    GraphSandboxUtil.create();

    //First get Instance
    graph = new Titan1Graph();
    configuration = ApplicationProperties.getSubsetConfiguration(ApplicationProperties.get(),
            Titan1GraphDatabase.GRAPH_PREFIX);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:10,代码来源:TitanGraphProviderTest.java

示例4: setUp

import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@BeforeTest
public void setUp() throws AtlasException {
    GraphSandboxUtil.create();

    // First get Instance
    graph = new Titan0Graph();
    configuration = ApplicationProperties.getSubsetConfiguration(ApplicationProperties.get(),
            Titan0GraphDatabase.GRAPH_PREFIX);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:10,代码来源:Titan0DatabaseValidationTest.java

示例5: KafkaNotification

import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
/**
 * Construct a KafkaNotification.
 *
 * @param applicationProperties  the application properties used to configure Kafka
 *
 * @throws AtlasException if the notification interface can not be created
 */
@Inject
public KafkaNotification(Configuration applicationProperties) throws AtlasException {
    super(applicationProperties);
    Configuration subsetConfiguration =
            ApplicationProperties.getSubsetConfiguration(applicationProperties, PROPERTY_PREFIX);
    properties = ConfigurationConverter.getProperties(subsetConfiguration);
    //override to store offset in kafka
    //todo do we need ability to replay?

    //Override default configs
    properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
            "org.apache.kafka.common.serialization.StringSerializer");
    properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
            "org.apache.kafka.common.serialization.StringSerializer");
    properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,
            "org.apache.kafka.common.serialization.StringDeserializer");
    properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,
            "org.apache.kafka.common.serialization.StringDeserializer");
    properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");

    pollTimeOutMs = subsetConfiguration.getLong("poll.timeout.ms", 1000);
    boolean oldApiCommitEnbleFlag = subsetConfiguration.getBoolean("auto.commit.enable",false);
    //set old autocommit value if new autoCommit property is not set.
    properties.put("enable.auto.commit", subsetConfiguration.getBoolean("enable.auto.commit", oldApiCommitEnbleFlag));
    properties.put("session.timeout.ms", subsetConfiguration.getString("session.timeout.ms", "30000"));

}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:35,代码来源:KafkaNotification.java

示例6: getConfiguration

import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
public static Configuration getConfiguration() throws AtlasException {
    Configuration configProperties = ApplicationProperties.get();
    return ApplicationProperties.getSubsetConfiguration(configProperties, GRAPH_PREFIX);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:5,代码来源:Titan0GraphDatabase.java


注:本文中的org.apache.atlas.ApplicationProperties.getSubsetConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。