本文整理汇总了Java中org.apache.atlas.ApplicationProperties.get方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationProperties.get方法的具体用法?Java ApplicationProperties.get怎么用?Java ApplicationProperties.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.atlas.ApplicationProperties
的用法示例。
在下文中一共展示了ApplicationProperties.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publish
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@Override
public void publish(SqoopJobDataPublisher.Data data) throws AtlasHookException {
try {
Configuration atlasProperties = ApplicationProperties.get();
String clusterName = atlasProperties.getString(ATLAS_CLUSTER_NAME, DEFAULT_CLUSTER_NAME);
Referenceable dbStoreRef = createDBStoreInstance(data);
Referenceable dbRef = createHiveDatabaseInstance(clusterName, data.getHiveDB());
Referenceable hiveTableRef = createHiveTableInstance(clusterName, dbRef,
data.getHiveTable(), data.getHiveDB());
Referenceable procRef = createSqoopProcessInstance(dbStoreRef, hiveTableRef, data, clusterName);
int maxRetries = atlasProperties.getInt(HOOK_NUM_RETRIES, 3);
HookNotification.HookNotificationMessage message =
new HookNotification.EntityCreateRequest(AtlasHook.getUser(), dbStoreRef, dbRef, hiveTableRef, procRef);
AtlasHook.notifyEntities(Arrays.asList(message), maxRetries);
}
catch(Exception e) {
throw new AtlasHookException("SqoopHook.publish() failed.", e);
}
}
示例2: setAuthenticationMethod
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@PostConstruct
void setAuthenticationMethod() {
try {
Configuration configuration = ApplicationProperties.get();
this.fileAuthenticationMethodEnabled = configuration.getBoolean(FILE_AUTH_METHOD, true);
this.pamAuthenticationEnabled = configuration.getBoolean(PAM_AUTH_METHOD, false);
boolean ldapAuthenticationEnabled = configuration.getBoolean(LDAP_AUTH_METHOD, false);
if (ldapAuthenticationEnabled) {
this.ldapType = configuration.getString(LDAP_TYPE, "NONE");
} else {
this.ldapType = "NONE";
}
} catch (Exception e) {
LOG.error("Error while getting atlas.login.method application properties", e);
}
}
示例3: create
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
public static void create(String sandboxName) {
Configuration configuration;
try {
configuration = ApplicationProperties.get();
String newStorageDir = System.getProperty("atlas.data") +
File.separatorChar + "storage" +
File.separatorChar + sandboxName;
configuration.setProperty("atlas.graph.storage.directory", newStorageDir);
String newIndexerDir = System.getProperty("atlas.data") +
File.separatorChar + "index" +
File.separatorChar + sandboxName;
configuration.setProperty("atlas.graph.index.search.directory", newIndexerDir);
LOG.debug("New Storage dir : {}", newStorageDir);
LOG.debug("New Indexer dir : {}", newIndexerDir);
} catch (AtlasException ignored) {}
}
示例4: loadFileLoginsDetails
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
void loadFileLoginsDetails() {
InputStream inStr = null;
try {
Configuration configuration = ApplicationProperties.get();
inStr = ApplicationProperties.getFileAsInputStream(configuration, "atlas.authentication.method.file.filename", DEFAULT_USER_CREDENTIALS_PROPERTIES);
userLogins = new Properties();
userLogins.load(inStr);
} catch (IOException | AtlasException e) {
LOG.error("Error while reading user.properties file", e);
throw new RuntimeException(e);
} finally {
if(inStr != null) {
try {
inStr.close();
} catch(Exception excp) {
// ignore
}
}
}
}
示例5: NotificationHookConsumer
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@Inject
public NotificationHookConsumer(NotificationInterface notificationInterface, AtlasEntityStore atlasEntityStore,
ServiceState serviceState, AtlasInstanceConverter instanceConverter,
AtlasTypeRegistry typeRegistry) throws AtlasException {
this.notificationInterface = notificationInterface;
this.atlasEntityStore = atlasEntityStore;
this.serviceState = serviceState;
this.instanceConverter = instanceConverter;
this.typeRegistry = typeRegistry;
this.applicationProperties = ApplicationProperties.get();
maxRetries = applicationProperties.getInt(CONSUMER_RETRIES_PROPERTY, 3);
failedMsgCacheSize = applicationProperties.getInt(CONSUMER_FAILEDCACHESIZE_PROPERTY, 20);
consumerRetryInterval = applicationProperties.getInt(CONSUMER_RETRY_INTERVAL, 500);
}
示例6: getTypeUpdateLockMaxWaitTimeInSeconds
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
public static int getTypeUpdateLockMaxWaitTimeInSeconds() {
Integer ret = typeUpdateLockMaxWaitTimeInSeconds;
if (ret == null) {
try {
Configuration config = ApplicationProperties.get();
ret = config.getInteger(CONFIG_TYPE_UPDATE_LOCK_MAX_WAIT_TIME_IN_SECONDS, DEFAULT_TYPE_UPDATE_LOCK_MAX_WAIT_TIME_IN_SECONDS);
typeUpdateLockMaxWaitTimeInSeconds = ret;
} catch (AtlasException e) {
// ignore
}
}
return ret == null ? DEFAULT_TYPE_UPDATE_LOCK_MAX_WAIT_TIME_IN_SECONDS : ret;
}
示例7: setUp
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@BeforeClass
public void setUp() throws Exception {
Configuration atlasProperties = ApplicationProperties.get();
if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
atlasClient = new AtlasClient(atlasProperties.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT), new String[]{"admin", "admin"});
} else {
atlasClient = new AtlasClient(atlasProperties.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT));
}
AtlasService service = new AtlasService();
service.init();
STORE.registerListener(service);
CurrentUser.authenticate(System.getProperty("user.name"));
}
示例8: getConfiguration
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
/**
* Returns the application configuration.
* @return
*/
protected org.apache.commons.configuration.Configuration getConfiguration() {
try {
return ApplicationProperties.get();
} catch (AtlasException e) {
throw new RuntimeException("Unable to load configuration: " + ApplicationProperties.APPLICATION_PROPERTIES);
}
}
示例9: setup
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@BeforeClass
public void setup() throws Exception {
Configuration properties = ApplicationProperties.get();
properties.setProperty("atlas.kafka.data", "target/" + RandomStringUtils.randomAlphanumeric(5));
kafkaNotification = new KafkaNotification(properties);
kafkaNotification.start();
}
示例10: getDeleteHandlerV1Impl
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
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);
}
}
示例11: getDeleteHandlerImpl
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
@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);
}
}
示例12: getAuditExcludedOperations
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
/**
* Get the list of operations which are configured to be skipped from auditing
* Valid format is HttpMethod:URL eg: GET:Version
* @return list of string
* @throws AtlasException
*/
public static List<String> getAuditExcludedOperations(Configuration config) throws AtlasException {
if (config == null) {
try {
config = ApplicationProperties.get();
} catch (AtlasException e) {
LOG.error(" Error reading operations for auditing ", e);
throw e;
}
}
if (skippedOperations == null) {
skippedOperations = new ArrayList<String>();
String[] skipAuditForOperations = config
.getStringArray(AUDIT_EXCLUDED_OPERATIONS);
if (skipAuditForOperations != null
&& skipAuditForOperations.length > 0) {
for (String skippedOperation : skipAuditForOperations) {
String[] excludedOperations = skippedOperation.trim().toLowerCase().split(SEPARATOR);
if (excludedOperations!= null && excludedOperations.length == 2) {
skippedOperations.add(skippedOperation.toLowerCase());
} else {
LOG.error("Invalid format for skipped operation {}. Valid format is HttpMethod:URL eg: GET:Version", skippedOperation);
}
}
}
}
return skippedOperations;
}
示例13: getServerUrl
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
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;
}
示例14: getServerUrl
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
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;
}
示例15: initApplicationProperties
import org.apache.atlas.ApplicationProperties; //导入方法依赖的package包/类
private void initApplicationProperties() {
if (APPLICATION_PROPERTIES == null) {
try {
APPLICATION_PROPERTIES = ApplicationProperties.get();
} catch (AtlasException ex) {
// ignore
}
}
}