Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
1361d0cb
Commit
1361d0cb
authored
Apr 29, 2015
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading properties from conf directory in deployment
parent
0cdacb1d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
11 deletions
+26
-11
pom.xml
addons/hive-bridge/pom.xml
+1
-1
PropertiesUtil.java
.../main/java/org/apache/hadoop/metadata/PropertiesUtil.java
+19
-6
HiveLineageService.java
.../apache/hadoop/metadata/discovery/HiveLineageService.java
+2
-1
TitanGraphProvider.java
.../hadoop/metadata/repository/graph/TitanGraphProvider.java
+3
-2
metadata-config.sh
src/bin/metadata-config.sh
+1
-1
No files found.
addons/hive-bridge/pom.xml
View file @
1361d0cb
...
...
@@ -208,7 +208,7 @@
<value>
${project.build.directory}/logs
</value>
</systemProperty>
<systemProperty>
<name>
metadata.
properties.location
</name>
<name>
metadata.
conf
</name>
<value>
addons/hive-bridge/src/test/resources
</value>
</systemProperty>
</systemProperties>
...
...
repository/src/main/java/org/apache/hadoop/metadata/PropertiesUtil.java
View file @
1361d0cb
...
...
@@ -20,18 +20,31 @@ package org.apache.hadoop.metadata;
import
org.apache.commons.configuration.ConfigurationException
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
public
class
PropertiesUtil
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
PropertiesUtil
.
class
);
private
static
final
String
APPLICATION_PROPERTIES
=
"application.properties"
;
public
static
final
PropertiesConfiguration
getApplicationProperties
()
throws
ConfigurationException
{
String
proprtiesLocation
=
System
.
getProperty
(
"metadata.properties.location"
);
if
(
proprtiesLocation
==
null
)
{
return
new
PropertiesConfiguration
(
PropertiesUtil
.
class
.
getResource
(
"/"
+
APPLICATION_PROPERTIES
));
}
else
{
return
new
PropertiesConfiguration
(
new
File
(
proprtiesLocation
,
APPLICATION_PROPERTIES
));
public
static
final
PropertiesConfiguration
getApplicationProperties
()
throws
MetadataException
{
String
confLocation
=
System
.
getProperty
(
"metadata.conf"
);
URL
url
;
try
{
if
(
confLocation
==
null
)
{
url
=
PropertiesUtil
.
class
.
getResource
(
"/"
+
APPLICATION_PROPERTIES
);
}
else
{
url
=
new
File
(
confLocation
,
APPLICATION_PROPERTIES
).
toURI
().
toURL
();
}
LOG
.
info
(
"Loading {} from {}"
,
APPLICATION_PROPERTIES
,
url
);
return
new
PropertiesConfiguration
(
url
);
}
catch
(
Exception
e
)
{
throw
new
MetadataException
(
"Failed to load application properties"
,
e
);
}
}
}
repository/src/main/java/org/apache/hadoop/metadata/discovery/HiveLineageService.java
View file @
1361d0cb
...
...
@@ -21,6 +21,7 @@ package org.apache.hadoop.metadata.discovery;
import
com.thinkaurelius.titan.core.TitanGraph
;
import
org.apache.commons.configuration.ConfigurationException
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.apache.hadoop.metadata.MetadataException
;
import
org.apache.hadoop.metadata.PropertiesUtil
;
import
org.apache.hadoop.metadata.discovery.graph.DefaultGraphPersistenceStrategy
;
import
org.apache.hadoop.metadata.discovery.graph.GraphBackedDiscoveryService
;
...
...
@@ -70,7 +71,7 @@ public class HiveLineageService implements LineageService {
conf
.
getString
(
"metadata.lineage.hive.process.inputs.name"
,
"inputTables"
);
HIVE_PROCESS_OUTPUT_ATTRIBUTE_NAME
=
conf
.
getString
(
"metadata.lineage.hive.process.outputs.name"
,
"outputTables"
);
}
catch
(
Configuration
Exception
e
)
{
}
catch
(
Metadata
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
...
...
repository/src/main/java/org/apache/hadoop/metadata/repository/graph/TitanGraphProvider.java
View file @
1361d0cb
...
...
@@ -23,6 +23,7 @@ import com.thinkaurelius.titan.core.TitanGraph;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.ConfigurationException
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.apache.hadoop.metadata.MetadataException
;
import
org.apache.hadoop.metadata.PropertiesUtil
;
import
javax.inject.Singleton
;
...
...
@@ -38,7 +39,7 @@ public class TitanGraphProvider implements GraphProvider<TitanGraph> {
*/
private
static
final
String
METADATA_PREFIX
=
"metadata.graph."
;
private
static
Configuration
getConfiguration
()
throws
Configuration
Exception
{
private
static
Configuration
getConfiguration
()
throws
Metadata
Exception
{
PropertiesConfiguration
configProperties
=
PropertiesUtil
.
getApplicationProperties
();
Configuration
graphConfig
=
new
PropertiesConfiguration
();
...
...
@@ -62,7 +63,7 @@ public class TitanGraphProvider implements GraphProvider<TitanGraph> {
Configuration
config
;
try
{
config
=
getConfiguration
();
}
catch
(
Configuration
Exception
e
)
{
}
catch
(
Metadata
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
...
...
src/bin/metadata-config.sh
View file @
1361d0cb
...
...
@@ -99,7 +99,7 @@ mkdir -p $METADATA_LOG_DIR
pushd
${
BASEDIR
}
>
/dev/null
JAVA_PROPERTIES
=
"
$METADATA_OPTS
$METADATA_PROPERTIES
-Dmetadata.log.dir=
$METADATA_LOG_DIR
-Dmetadata.home=
${
METADATA_HOME_DIR
}
"
JAVA_PROPERTIES
=
"
$METADATA_OPTS
$METADATA_PROPERTIES
-Dmetadata.log.dir=
$METADATA_LOG_DIR
-Dmetadata.home=
${
METADATA_HOME_DIR
}
-Dmetadata.conf=
${
METADATA_CONF
}
"
shift
while
[[
${
1
}
=
~ ^
\-
D
]]
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment