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
c26e9bcd
Commit
c26e9bcd
authored
Mar 19, 2018
by
rmani
Committed by
Madhan Neethiraj
Mar 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2507: updated HBase hook to use : as separator between namespace and table names
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
45d3872b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
HBaseAtlasHook.java
...in/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java
+7
-3
ImportHBaseEntitiesBase.java
.../org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java
+7
-5
No files found.
addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java
View file @
c26e9bcd
...
@@ -116,6 +116,10 @@ public class HBaseAtlasHook extends AtlasHook {
...
@@ -116,6 +116,10 @@ public class HBaseAtlasHook extends AtlasHook {
public
static
final
String
ATTR_CF_EVICT_BLOCK_ONCLOSE
=
"evictBlocksOnClose"
;
public
static
final
String
ATTR_CF_EVICT_BLOCK_ONCLOSE
=
"evictBlocksOnClose"
;
public
static
final
String
ATTR_CF_PREFETCH_BLOCK_ONOPEN
=
"prefetchBlocksOnOpen"
;
public
static
final
String
ATTR_CF_PREFETCH_BLOCK_ONOPEN
=
"prefetchBlocksOnOpen"
;
public
static
final
String
HBASE_NAMESPACE_QUALIFIED_NAME
=
"%s@%s"
;
public
static
final
String
HBASE_TABLE_QUALIFIED_NAME_FORMAT
=
"%s:%s@%s"
;
public
static
final
String
HBASE_COLUMN_FAMILY_QUALIFIED_NAME_FORMAT
=
"%s:%s.%s@%s"
;
private
static
final
String
REFERENCEABLE_ATTRIBUTE_NAME
=
"qualifiedName"
;
private
static
final
String
REFERENCEABLE_ATTRIBUTE_NAME
=
"qualifiedName"
;
private
String
clusterName
=
null
;
private
String
clusterName
=
null
;
...
@@ -377,7 +381,7 @@ public class HBaseAtlasHook extends AtlasHook {
...
@@ -377,7 +381,7 @@ public class HBaseAtlasHook extends AtlasHook {
if
(
clusterName
==
null
||
nameSpace
==
null
||
tableName
==
null
||
columnFamily
==
null
)
{
if
(
clusterName
==
null
||
nameSpace
==
null
||
tableName
==
null
||
columnFamily
==
null
)
{
return
null
;
return
null
;
}
else
{
}
else
{
return
String
.
format
(
"%s.%s.%s@%s"
,
nameSpace
.
toLowerCase
(),
stripNameSpace
(
tableName
.
toLowerCase
()),
columnFamily
.
toLowerCase
(),
clusterName
);
return
String
.
format
(
HBASE_COLUMN_FAMILY_QUALIFIED_NAME_FORMAT
,
nameSpace
.
toLowerCase
(),
stripNameSpace
(
tableName
.
toLowerCase
()),
columnFamily
.
toLowerCase
(),
clusterName
);
}
}
}
}
...
@@ -393,7 +397,7 @@ public class HBaseAtlasHook extends AtlasHook {
...
@@ -393,7 +397,7 @@ public class HBaseAtlasHook extends AtlasHook {
if
(
clusterName
==
null
||
nameSpace
==
null
||
tableName
==
null
)
{
if
(
clusterName
==
null
||
nameSpace
==
null
||
tableName
==
null
)
{
return
null
;
return
null
;
}
else
{
}
else
{
return
String
.
format
(
"%s.%s@%s"
,
nameSpace
.
toLowerCase
(),
stripNameSpace
(
tableName
.
toLowerCase
()),
clusterName
);
return
String
.
format
(
HBASE_TABLE_QUALIFIED_NAME_FORMAT
,
nameSpace
.
toLowerCase
(),
stripNameSpace
(
tableName
.
toLowerCase
()),
clusterName
);
}
}
}
}
...
@@ -408,7 +412,7 @@ public class HBaseAtlasHook extends AtlasHook {
...
@@ -408,7 +412,7 @@ public class HBaseAtlasHook extends AtlasHook {
if
(
clusterName
==
null
||
nameSpace
==
null
)
{
if
(
clusterName
==
null
||
nameSpace
==
null
)
{
return
null
;
return
null
;
}
else
{
}
else
{
return
String
.
format
(
"%s@%s"
,
nameSpace
.
toLowerCase
(),
clusterName
);
return
String
.
format
(
HBASE_NAMESPACE_QUALIFIED_NAME
,
nameSpace
.
toLowerCase
(),
clusterName
);
}
}
}
}
...
...
addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java
View file @
c26e9bcd
...
@@ -92,6 +92,10 @@ public class ImportHBaseEntitiesBase {
...
@@ -92,6 +92,10 @@ public class ImportHBaseEntitiesBase {
public
static
final
String
ATTR_CF_EVICT_BLOCK_ONCLOSE
=
"evictBlocksOnClose"
;
public
static
final
String
ATTR_CF_EVICT_BLOCK_ONCLOSE
=
"evictBlocksOnClose"
;
public
static
final
String
ATTR_CF_PREFETCH_BLOCK_ONOPEN
=
"prefetchBlocksOnOpen"
;
public
static
final
String
ATTR_CF_PREFETCH_BLOCK_ONOPEN
=
"prefetchBlocksOnOpen"
;
public
static
final
String
HBASE_NAMESPACE_QUALIFIED_NAME
=
"%s@%s"
;
public
static
final
String
HBASE_TABLE_QUALIFIED_NAME_FORMAT
=
"%s:%s@%s"
;
public
static
final
String
HBASE_COLUMN_FAMILY_QUALIFIED_NAME_FORMAT
=
"%s:%s.%s@%s"
;
protected
final
HBaseAdmin
hbaseAdmin
;
protected
final
HBaseAdmin
hbaseAdmin
;
protected
final
boolean
failOnError
;
protected
final
boolean
failOnError
;
protected
final
String
namespaceToImport
;
protected
final
String
namespaceToImport
;
...
@@ -380,8 +384,7 @@ public class ImportHBaseEntitiesBase {
...
@@ -380,8 +384,7 @@ public class ImportHBaseEntitiesBase {
*/
*/
private
static
String
getColumnFamilyQualifiedName
(
String
clusterName
,
String
nameSpace
,
String
tableName
,
String
columnFamily
)
{
private
static
String
getColumnFamilyQualifiedName
(
String
clusterName
,
String
nameSpace
,
String
tableName
,
String
columnFamily
)
{
tableName
=
stripNameSpace
(
tableName
.
toLowerCase
());
tableName
=
stripNameSpace
(
tableName
.
toLowerCase
());
return
String
.
format
(
HBASE_COLUMN_FAMILY_QUALIFIED_NAME_FORMAT
,
nameSpace
.
toLowerCase
(),
tableName
,
columnFamily
.
toLowerCase
(),
clusterName
);
return
String
.
format
(
"%s.%s.%s@%s"
,
nameSpace
.
toLowerCase
(),
tableName
,
columnFamily
.
toLowerCase
(),
clusterName
);
}
}
/**
/**
...
@@ -393,8 +396,7 @@ public class ImportHBaseEntitiesBase {
...
@@ -393,8 +396,7 @@ public class ImportHBaseEntitiesBase {
*/
*/
private
static
String
getTableQualifiedName
(
String
clusterName
,
String
nameSpace
,
String
tableName
)
{
private
static
String
getTableQualifiedName
(
String
clusterName
,
String
nameSpace
,
String
tableName
)
{
tableName
=
stripNameSpace
(
tableName
.
toLowerCase
());
tableName
=
stripNameSpace
(
tableName
.
toLowerCase
());
return
String
.
format
(
HBASE_TABLE_QUALIFIED_NAME_FORMAT
,
nameSpace
.
toLowerCase
(),
tableName
,
clusterName
);
return
String
.
format
(
"%s.%s@%s"
,
nameSpace
.
toLowerCase
(),
tableName
,
clusterName
);
}
}
/**
/**
...
@@ -404,7 +406,7 @@ public class ImportHBaseEntitiesBase {
...
@@ -404,7 +406,7 @@ public class ImportHBaseEntitiesBase {
* @return Unique qualified name to identify the HBase NameSpace instance in Atlas.
* @return Unique qualified name to identify the HBase NameSpace instance in Atlas.
*/
*/
private
static
String
getNameSpaceQualifiedName
(
String
clusterName
,
String
nameSpace
)
{
private
static
String
getNameSpaceQualifiedName
(
String
clusterName
,
String
nameSpace
)
{
return
String
.
format
(
"%s@%s"
,
nameSpace
.
toLowerCase
(),
clusterName
);
return
String
.
format
(
HBASE_NAMESPACE_QUALIFIED_NAME
,
nameSpace
.
toLowerCase
(),
clusterName
);
}
}
private
static
String
stripNameSpace
(
String
tableName
){
private
static
String
stripNameSpace
(
String
tableName
){
...
...
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