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
fe1c7a3b
Commit
fe1c7a3b
authored
Apr 23, 2018
by
rdsolani
Committed by
Madhan Neethiraj
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2592 Storm atlas hook fails with NPE
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
57c7e85e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
StormAtlasHook.java
...main/java/org/apache/atlas/storm/hook/StormAtlasHook.java
+13
-2
No files found.
addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java
View file @
fe1c7a3b
...
@@ -199,6 +199,9 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
...
@@ -199,6 +199,9 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
clusterName
=
getClusterName
(
stormConf
);
clusterName
=
getClusterName
(
stormConf
);
if
(
topicName
==
null
)
{
LOG
.
error
(
"Kafka topic name not found"
);
}
else
{
ret
=
new
AtlasEntity
(
StormDataTypes
.
KAFKA_TOPIC
.
getName
());
ret
=
new
AtlasEntity
(
StormDataTypes
.
KAFKA_TOPIC
.
getName
());
ret
.
setAttribute
(
"topic"
,
topicName
);
ret
.
setAttribute
(
"topic"
,
topicName
);
...
@@ -207,6 +210,7 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
...
@@ -207,6 +210,7 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
ret
.
setAttribute
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
getKafkaTopicQualifiedName
(
clusterName
,
topicName
));
ret
.
setAttribute
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
getKafkaTopicQualifiedName
(
clusterName
,
topicName
));
ret
.
setAttribute
(
AtlasClient
.
NAME
,
topicName
);
ret
.
setAttribute
(
AtlasClient
.
NAME
,
topicName
);
}
}
}
break
;
break
;
case
"HBaseBolt"
:
{
case
"HBaseBolt"
:
{
...
@@ -219,6 +223,9 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
...
@@ -219,6 +223,9 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
clusterName
=
extractComponentClusterName
(
HBaseConfiguration
.
create
(),
stormConf
);
clusterName
=
extractComponentClusterName
(
HBaseConfiguration
.
create
(),
stormConf
);
if
(
hbaseTableName
==
null
)
{
LOG
.
error
(
"HBase table name not found"
);
}
else
{
ret
=
new
AtlasEntity
(
StormDataTypes
.
HBASE_TABLE
.
getName
());
ret
=
new
AtlasEntity
(
StormDataTypes
.
HBASE_TABLE
.
getName
());
ret
.
setAttribute
(
"uri"
,
hbaseTableName
);
ret
.
setAttribute
(
"uri"
,
hbaseTableName
);
...
@@ -227,6 +234,7 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
...
@@ -227,6 +234,7 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
//TODO - Hbase Namespace is hardcoded to 'default'. need to check how to get this or is it already part of tableName
//TODO - Hbase Namespace is hardcoded to 'default'. need to check how to get this or is it already part of tableName
ret
.
setAttribute
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
getHbaseTableQualifiedName
(
clusterName
,
HBASE_NAMESPACE_DEFAULT
,
hbaseTableName
));
ret
.
setAttribute
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
getHbaseTableQualifiedName
(
clusterName
,
HBASE_NAMESPACE_DEFAULT
,
hbaseTableName
));
}
}
}
break
;
break
;
case
"HdfsBolt"
:
{
case
"HdfsBolt"
:
{
...
@@ -261,8 +269,10 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
...
@@ -261,8 +269,10 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
final
String
dbName
=
config
.
get
(
"HiveBolt.options.databaseName"
);
final
String
dbName
=
config
.
get
(
"HiveBolt.options.databaseName"
);
final
String
tblName
=
config
.
get
(
"HiveBolt.options.tableName"
);
final
String
tblName
=
config
.
get
(
"HiveBolt.options.tableName"
);
final
String
tblQualifiedName
=
HiveMetaStoreBridge
.
getTableQualifiedName
(
clusterName
,
dbName
,
tblName
);
if
(
dbName
==
null
||
tblName
==
null
)
{
LOG
.
error
(
"Hive database or table name not found"
);
}
else
{
AtlasEntity
dbEntity
=
new
AtlasEntity
(
"hive_db"
);
AtlasEntity
dbEntity
=
new
AtlasEntity
(
"hive_db"
);
dbEntity
.
setAttribute
(
AtlasClient
.
NAME
,
dbName
);
dbEntity
.
setAttribute
(
AtlasClient
.
NAME
,
dbName
);
...
@@ -276,7 +286,8 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
...
@@ -276,7 +286,8 @@ public class StormAtlasHook extends AtlasHook implements ISubmitterHook {
ret
.
setAttribute
(
AtlasClient
.
NAME
,
tblName
);
ret
.
setAttribute
(
AtlasClient
.
NAME
,
tblName
);
ret
.
setAttribute
(
ATTRIBUTE_DB
,
AtlasTypeUtil
.
getAtlasObjectId
(
dbEntity
));
ret
.
setAttribute
(
ATTRIBUTE_DB
,
AtlasTypeUtil
.
getAtlasObjectId
(
dbEntity
));
ret
.
setAttribute
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
tblQualifiedName
);
ret
.
setAttribute
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
HiveMetaStoreBridge
.
getTableQualifiedName
(
clusterName
,
dbName
,
tblName
));
}
}
}
break
;
break
;
...
...
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