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
9dc96c46
Commit
9dc96c46
authored
Nov 19, 2016
by
Apoorv Naik
Committed by
Madhan Neethiraj
Nov 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1292: Integration test fixes caused by recent bootstrap changes
parent
774975c9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
124 deletions
+139
-124
EntityNotificationIT.java
...a/org/apache/atlas/notification/EntityNotificationIT.java
+9
-2
NotificationHookConsumerIT.java
...apache/atlas/notification/NotificationHookConsumerIT.java
+35
-15
BaseResourceIT.java
...t/java/org/apache/atlas/web/resources/BaseResourceIT.java
+13
-10
DataSetLineageJerseyResourceIT.java
...e/atlas/web/resources/DataSetLineageJerseyResourceIT.java
+11
-14
EntityJerseyResourceIT.java
...rg/apache/atlas/web/resources/EntityJerseyResourceIT.java
+66
-19
EntityLineageJerseyResourceIT.java
...he/atlas/web/resources/EntityLineageJerseyResourceIT.java
+5
-64
No files found.
webapp/src/test/java/org/apache/atlas/notification/EntityNotificationIT.java
View file @
9dc96c46
...
...
@@ -80,8 +80,11 @@ public class EntityNotificationIT extends BaseResourceIT {
@Test
public
void
testCreateEntity
()
throws
Exception
{
Referenceable
tableInstance
=
createHiveTableInstance
(
DATABASE_NAME
,
TABLE_NAME
);
Referenceable
hiveDBInstance
=
createHiveDBInstance
(
DATABASE_NAME
);
Id
dbID
=
createInstance
(
hiveDBInstance
);
hiveDBInstance
.
replaceWithNewId
(
dbID
);
Referenceable
tableInstance
=
createHiveTableInstance
(
hiveDBInstance
,
TABLE_NAME
);
tableId
=
createInstance
(
tableInstance
);
final
String
guid
=
tableId
.
_getId
();
...
...
@@ -107,7 +110,11 @@ public class EntityNotificationIT extends BaseResourceIT {
public
void
testDeleteEntity
()
throws
Exception
{
final
String
tableName
=
"table-"
+
randomString
();
final
String
dbName
=
"db-"
+
randomString
();
Referenceable
tableInstance
=
createHiveTableInstance
(
dbName
,
tableName
);
Referenceable
hiveDBInstance
=
createHiveDBInstance
(
dbName
);
Id
dbID
=
createInstance
(
hiveDBInstance
);
hiveDBInstance
.
replaceWithNewId
(
dbID
);
Referenceable
tableInstance
=
createHiveTableInstance
(
hiveDBInstance
,
tableName
);
final
Id
tableId
=
createInstance
(
tableInstance
);
final
String
guid
=
tableId
.
_getId
();
...
...
webapp/src/test/java/org/apache/atlas/notification/NotificationHookConsumerIT.java
View file @
9dc96c46
...
...
@@ -65,8 +65,11 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
//send valid message
final
Referenceable
entity
=
new
Referenceable
(
DATABASE_TYPE
);
entity
.
set
(
"name"
,
"db"
+
randomString
());
String
dbName
=
"db"
+
randomString
();
entity
.
set
(
"name"
,
dbName
);
entity
.
set
(
"description"
,
randomString
());
entity
.
set
(
"qualifiedName"
,
dbName
);
entity
.
set
(
"clusterName"
,
randomString
());
sendHookMessage
(
new
HookNotification
.
EntityCreateRequest
(
TEST_USER
,
entity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
...
...
@@ -81,21 +84,24 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
@Test
public
void
testCreateEntity
()
throws
Exception
{
final
Referenceable
entity
=
new
Referenceable
(
DATABASE_TYPE
);
entity
.
set
(
"name"
,
"db"
+
randomString
());
String
dbName
=
"db"
+
randomString
();
entity
.
set
(
"name"
,
dbName
);
entity
.
set
(
"description"
,
randomString
());
entity
.
set
(
"qualifiedName"
,
dbName
);
entity
.
set
(
"clusterName"
,
randomString
());
sendHookMessage
(
new
HookNotification
.
EntityCreateRequest
(
TEST_USER
,
entity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
public
boolean
evaluate
()
throws
Exception
{
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
name='%s'"
,
DATABASE_TYPE
,
entity
.
get
(
"n
ame"
)));
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
qualifiedName='%s'"
,
DATABASE_TYPE
,
entity
.
get
(
"qualifiedN
ame"
)));
return
results
.
length
()
==
1
;
}
});
//Assert that user passed in hook message is used in audit
Referenceable
instance
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
name"
,
(
String
)
entity
.
get
(
"n
ame"
));
Referenceable
instance
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
qualifiedName"
,
(
String
)
entity
.
get
(
"qualifiedN
ame"
));
List
<
EntityAuditEvent
>
events
=
serviceClient
.
getEntityAuditEvents
(
instance
.
getId
().
_getId
(),
(
short
)
1
);
assertEquals
(
events
.
size
(),
1
);
...
...
@@ -108,22 +114,25 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
String
dbName
=
"db"
+
randomString
();
entity
.
set
(
"name"
,
dbName
);
entity
.
set
(
"description"
,
randomString
());
entity
.
set
(
"qualifiedName"
,
dbName
);
entity
.
set
(
"clusterName"
,
randomString
());
serviceClient
.
createEntity
(
entity
);
final
Referenceable
newEntity
=
new
Referenceable
(
DATABASE_TYPE
);
newEntity
.
set
(
"owner"
,
randomString
());
sendHookMessage
(
new
HookNotification
.
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE
,
"
n
ame"
,
dbName
,
newEntity
));
new
HookNotification
.
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE
,
"
qualifiedN
ame"
,
dbName
,
newEntity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
public
boolean
evaluate
()
throws
Exception
{
Referenceable
localEntity
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
n
ame"
,
dbName
);
Referenceable
localEntity
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
qualifiedN
ame"
,
dbName
);
return
(
localEntity
.
get
(
"owner"
)
!=
null
&&
localEntity
.
get
(
"owner"
).
equals
(
newEntity
.
get
(
"owner"
)));
}
});
//Its partial update and un-set fields are not updated
Referenceable
actualEntity
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
n
ame"
,
dbName
);
Referenceable
actualEntity
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
qualifiedN
ame"
,
dbName
);
assertEquals
(
actualEntity
.
get
(
"description"
),
entity
.
get
(
"description"
));
}
...
...
@@ -133,24 +142,27 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
String
dbName
=
"db"
+
randomString
();
entity
.
set
(
"name"
,
dbName
);
entity
.
set
(
"description"
,
randomString
());
entity
.
set
(
"qualifiedName"
,
dbName
);
entity
.
set
(
"clusterName"
,
randomString
());
serviceClient
.
createEntity
(
entity
);
final
Referenceable
newEntity
=
new
Referenceable
(
DATABASE_TYPE
);
final
String
newName
=
"db"
+
randomString
();
newEntity
.
set
(
"
n
ame"
,
newName
);
newEntity
.
set
(
"
qualifiedN
ame"
,
newName
);
sendHookMessage
(
new
HookNotification
.
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE
,
"
n
ame"
,
dbName
,
newEntity
));
new
HookNotification
.
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE
,
"
qualifiedN
ame"
,
dbName
,
newEntity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
public
boolean
evaluate
()
throws
Exception
{
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
n
ame='%s'"
,
DATABASE_TYPE
,
newName
));
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
qualifiedN
ame='%s'"
,
DATABASE_TYPE
,
newName
));
return
results
.
length
()
==
1
;
}
});
//no entity with the old qualified name
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
n
ame='%s'"
,
DATABASE_TYPE
,
dbName
));
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
qualifiedN
ame='%s'"
,
DATABASE_TYPE
,
dbName
));
assertEquals
(
results
.
length
(),
0
);
}
...
...
@@ -161,10 +173,13 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
String
dbName
=
"db"
+
randomString
();
entity
.
set
(
"name"
,
dbName
);
entity
.
set
(
"description"
,
randomString
());
entity
.
set
(
"qualifiedName"
,
dbName
);
entity
.
set
(
"clusterName"
,
randomString
());
final
String
dbId
=
serviceClient
.
createEntity
(
entity
).
get
(
0
);
sendHookMessage
(
new
HookNotification
.
EntityDeleteRequest
(
TEST_USER
,
DATABASE_TYPE
,
"
n
ame"
,
dbName
));
new
HookNotification
.
EntityDeleteRequest
(
TEST_USER
,
DATABASE_TYPE
,
"
qualifiedN
ame"
,
dbName
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
public
boolean
evaluate
()
throws
Exception
{
...
...
@@ -180,24 +195,29 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
String
dbName
=
"db"
+
randomString
();
entity
.
set
(
"name"
,
dbName
);
entity
.
set
(
"description"
,
randomString
());
entity
.
set
(
"qualifiedName"
,
dbName
);
entity
.
set
(
"clusterName"
,
randomString
());
serviceClient
.
createEntity
(
entity
);
final
Referenceable
newEntity
=
new
Referenceable
(
DATABASE_TYPE
);
newEntity
.
set
(
"name"
,
dbName
);
newEntity
.
set
(
"name"
,
randomString
()
);
newEntity
.
set
(
"description"
,
randomString
());
newEntity
.
set
(
"owner"
,
randomString
());
newEntity
.
set
(
"qualifiedName"
,
dbName
);
newEntity
.
set
(
"clusterName"
,
randomString
());
//updating unique attribute
sendHookMessage
(
new
HookNotification
.
EntityUpdateRequest
(
TEST_USER
,
newEntity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
public
boolean
evaluate
()
throws
Exception
{
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
name='%s'"
,
DATABASE_TYPE
,
dbName
));
JSONArray
results
=
searchByDSL
(
String
.
format
(
"%s where
qualifiedName='%s'"
,
DATABASE_TYPE
,
newEntity
.
get
(
"qualifiedName"
)
));
return
results
.
length
()
==
1
;
}
});
Referenceable
actualEntity
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
n
ame"
,
dbName
);
Referenceable
actualEntity
=
serviceClient
.
getEntity
(
DATABASE_TYPE
,
"
qualifiedN
ame"
,
dbName
);
assertEquals
(
actualEntity
.
get
(
"description"
),
newEntity
.
get
(
"description"
));
assertEquals
(
actualEntity
.
get
(
"owner"
),
newEntity
.
get
(
"owner"
));
}
...
...
webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java
View file @
9dc96c46
...
...
@@ -90,14 +90,11 @@ public abstract class BaseResourceIT {
}
protected
void
createType
(
TypesDef
typesDef
)
throws
Exception
{
HierarchicalTypeDefinition
<
ClassType
>
sampleType
=
typesDef
.
classTypesAsJavaList
().
get
(
0
);
try
{
serviceClient
.
getType
(
sampleType
.
typeName
);
LOG
.
info
(
"Types already exist. Skipping type creation"
);
}
catch
(
AtlasServiceException
ase
)
{
//Expected if type doesnt exist
String
typesAsJSON
=
TypesSerialization
.
toJson
(
typesDef
);
createType
(
typesAsJSON
);
}
catch
(
AtlasServiceException
ase
)
{
LOG
.
info
(
"Types failed. Tests might malfunction"
);
}
}
...
...
@@ -186,6 +183,7 @@ public abstract class BaseResourceIT {
TypesDef
typesDef
=
TypesUtil
.
getTypesDef
(
ImmutableList
.
of
(
enumTypeDefinition
),
ImmutableList
.
of
(
structTypeDefinition
),
ImmutableList
.
of
(
classificationTrait
,
piiTrait
,
phiTrait
,
pciTrait
,
soxTrait
,
secTrait
,
financeTrait
),
// ImmutableList.<HierarchicalTypeDefinition<ClassType>>of());
ImmutableList
.
of
(
dbClsDef
,
columnClsDef
,
tblClsDef
,
loadProcessClsDef
));
createType
(
typesDef
);
...
...
@@ -210,11 +208,7 @@ public abstract class BaseResourceIT {
return
RandomStringUtils
.
randomAlphanumeric
(
10
);
}
protected
Referenceable
createHiveTableInstance
(
String
dbName
,
String
tableName
)
throws
Exception
{
Referenceable
databaseInstance
=
new
Referenceable
(
DATABASE_TYPE
);
databaseInstance
.
set
(
"name"
,
dbName
);
databaseInstance
.
set
(
"description"
,
"foo database"
);
protected
Referenceable
createHiveTableInstance
(
Referenceable
databaseInstance
,
String
tableName
)
throws
Exception
{
Referenceable
tableInstance
=
new
Referenceable
(
HIVE_TABLE_TYPE
,
"classification"
,
"pii"
,
"phi"
,
"pci"
,
"sox"
,
"sec"
,
"finance"
);
tableInstance
.
set
(
"name"
,
tableName
);
...
...
@@ -246,6 +240,15 @@ public abstract class BaseResourceIT {
return
tableInstance
;
}
protected
Referenceable
createHiveDBInstance
(
String
dbName
)
{
Referenceable
databaseInstance
=
new
Referenceable
(
DATABASE_TYPE
);
databaseInstance
.
set
(
"name"
,
dbName
);
databaseInstance
.
set
(
"qualifiedName"
,
dbName
);
databaseInstance
.
set
(
"clusterName"
,
randomString
());
databaseInstance
.
set
(
"description"
,
"foo database"
);
return
databaseInstance
;
}
public
interface
Predicate
{
/**
...
...
webapp/src/test/java/org/apache/atlas/web/resources/DataSetLineageJerseyResourceIT.java
View file @
9dc96c46
...
...
@@ -167,9 +167,10 @@ public class DataSetLineageJerseyResourceIT extends BaseResourceIT {
for
(
int
index
=
0
;
index
<
rows
.
length
();
index
++)
{
final
JSONObject
row
=
rows
.
getJSONObject
(
index
);
LOG
.
info
(
"JsonRow - {}"
,
row
);
Assert
.
assertNotNull
(
row
.
getString
(
"name"
));
Assert
.
assertNotNull
(
row
.
getString
(
"comment"
));
Assert
.
assertNotNull
(
row
.
getString
(
"
dataT
ype"
));
Assert
.
assertNotNull
(
row
.
getString
(
"
t
ype"
));
Assert
.
assertEquals
(
row
.
getString
(
"$typeName$"
),
"hive_column"
);
}
}
...
...
@@ -185,23 +186,15 @@ public class DataSetLineageJerseyResourceIT extends BaseResourceIT {
for
(
int
index
=
0
;
index
<
rows
.
length
();
index
++)
{
final
JSONObject
row
=
rows
.
getJSONObject
(
index
);
LOG
.
info
(
"JsonRow - {}"
,
row
);
Assert
.
assertNotNull
(
row
.
getString
(
"name"
));
Assert
.
assertNotNull
(
row
.
getString
(
"comment"
));
Assert
.
assertNotNull
(
row
.
getString
(
"
dataT
ype"
));
Assert
.
assertNotNull
(
row
.
getString
(
"
t
ype"
));
Assert
.
assertEquals
(
row
.
getString
(
"$typeName$"
),
"hive_column"
);
}
}
@Test
public
void
testSchemaForEmptyTable
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
BASE_URI
).
path
(
""
).
path
(
"schema"
);
ClientResponse
clientResponse
=
resource
.
accept
(
Servlets
.
JSON_MEDIA_TYPE
).
type
(
Servlets
.
JSON_MEDIA_TYPE
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
NOT_FOUND
.
getStatusCode
());
}
@Test
public
void
testSchemaForInvalidTable
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
BASE_URI
).
path
(
"blah"
).
path
(
"schema"
);
...
...
@@ -264,6 +257,8 @@ public class DataSetLineageJerseyResourceIT extends BaseResourceIT {
throws
Exception
{
Referenceable
referenceable
=
new
Referenceable
(
DATABASE_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
"qualifiedName"
,
name
);
referenceable
.
set
(
"clusterName"
,
locationUri
+
name
);
referenceable
.
set
(
"description"
,
description
);
referenceable
.
set
(
"owner"
,
owner
);
referenceable
.
set
(
"locationUri"
,
locationUri
);
...
...
@@ -272,10 +267,11 @@ public class DataSetLineageJerseyResourceIT extends BaseResourceIT {
return
createInstance
(
referenceable
);
}
Referenceable
column
(
String
name
,
String
dataT
ype
,
String
comment
,
String
...
traitNames
)
throws
Exception
{
Referenceable
column
(
String
name
,
String
t
ype
,
String
comment
,
String
...
traitNames
)
throws
Exception
{
Referenceable
referenceable
=
new
Referenceable
(
COLUMN_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
"dataType"
,
dataType
);
referenceable
.
set
(
"qualifiedName"
,
name
);
referenceable
.
set
(
"type"
,
type
);
referenceable
.
set
(
"comment"
,
comment
);
return
referenceable
;
...
...
@@ -304,13 +300,14 @@ public class DataSetLineageJerseyResourceIT extends BaseResourceIT {
Referenceable
referenceable
=
new
Referenceable
(
HIVE_PROCESS_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
name
);
referenceable
.
set
(
"user"
,
user
);
referenceable
.
set
(
"user
Name
"
,
user
);
referenceable
.
set
(
"startTime"
,
System
.
currentTimeMillis
());
referenceable
.
set
(
"endTime"
,
System
.
currentTimeMillis
()
+
10000
);
referenceable
.
set
(
"inputs"
,
inputTables
);
referenceable
.
set
(
"outputs"
,
outputTables
);
referenceable
.
set
(
"operationType"
,
"testOperation"
);
referenceable
.
set
(
"queryText"
,
queryText
);
referenceable
.
set
(
"queryPlan"
,
queryPlan
);
referenceable
.
set
(
"queryId"
,
queryId
);
...
...
webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
View file @
9dc96c46
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/web/resources/EntityLineageJerseyResourceIT.java
View file @
9dc96c46
...
...
@@ -41,13 +41,13 @@ import java.util.Set;
/**
* Entity Lineage v2 Integration Tests.
*/
public
class
EntityLineageJerseyResourceIT
extends
Base
ResourceIT
{
public
class
EntityLineageJerseyResourceIT
extends
DataSetLineageJersey
ResourceIT
{
private
static
final
String
BASE_URI
=
"api/atlas/v2/lineage/"
;
private
static
final
String
INPUT_DIRECTION
=
"INPUT"
;
private
static
final
String
INPUT_DIRECTION
=
"INPUT"
;
private
static
final
String
OUTPUT_DIRECTION
=
"OUTPUT"
;
private
static
final
String
BOTH_DIRECTION
=
"BOTH"
;
private
static
final
String
DIRECTION_PARAM
=
"direction"
;
private
static
final
String
DEPTH_PARAM
=
"depth"
;
private
static
final
String
BOTH_DIRECTION
=
"BOTH"
;
private
static
final
String
DIRECTION_PARAM
=
"direction"
;
private
static
final
String
DEPTH_PARAM
=
"depth"
;
private
String
salesFactTable
;
private
String
salesMonthlyTable
;
...
...
@@ -191,63 +191,4 @@ public class EntityLineageJerseyResourceIT extends BaseResourceIT {
loadProcess
(
"loadSalesMonthly"
+
randomString
(),
"John ETL"
,
ImmutableList
.
of
(
salesFactDaily
),
ImmutableList
.
of
(
salesFactMonthly
),
"create table as select "
,
"plan"
,
"id"
,
"graph"
);
}
Id
database
(
String
name
,
String
description
,
String
owner
,
String
locationUri
,
String
...
traitNames
)
throws
Exception
{
Referenceable
referenceable
=
new
Referenceable
(
DATABASE_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
"description"
,
description
);
referenceable
.
set
(
"owner"
,
owner
);
referenceable
.
set
(
"locationUri"
,
locationUri
);
referenceable
.
set
(
"createTime"
,
System
.
currentTimeMillis
());
return
createInstance
(
referenceable
);
}
Referenceable
column
(
String
name
,
String
dataType
,
String
comment
,
String
...
traitNames
)
throws
Exception
{
Referenceable
referenceable
=
new
Referenceable
(
COLUMN_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
"dataType"
,
dataType
);
referenceable
.
set
(
"comment"
,
comment
);
return
referenceable
;
}
Id
table
(
String
name
,
String
description
,
Id
dbId
,
String
owner
,
String
tableType
,
List
<
Referenceable
>
columns
,
String
...
traitNames
)
throws
Exception
{
Referenceable
referenceable
=
new
Referenceable
(
HIVE_TABLE_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
name
);
referenceable
.
set
(
"description"
,
description
);
referenceable
.
set
(
"owner"
,
owner
);
referenceable
.
set
(
"tableType"
,
tableType
);
referenceable
.
set
(
"createTime"
,
System
.
currentTimeMillis
());
referenceable
.
set
(
"lastAccessTime"
,
System
.
currentTimeMillis
());
referenceable
.
set
(
"retention"
,
System
.
currentTimeMillis
());
referenceable
.
set
(
"db"
,
dbId
);
referenceable
.
set
(
"columns"
,
columns
);
return
createInstance
(
referenceable
);
}
Id
loadProcess
(
String
name
,
String
user
,
List
<
Id
>
inputTables
,
List
<
Id
>
outputTables
,
String
queryText
,
String
queryPlan
,
String
queryId
,
String
queryGraph
,
String
...
traitNames
)
throws
Exception
{
Referenceable
referenceable
=
new
Referenceable
(
HIVE_PROCESS_TYPE
,
traitNames
);
referenceable
.
set
(
"name"
,
name
);
referenceable
.
set
(
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
name
);
referenceable
.
set
(
"user"
,
user
);
referenceable
.
set
(
"startTime"
,
System
.
currentTimeMillis
());
referenceable
.
set
(
"endTime"
,
System
.
currentTimeMillis
()
+
10000
);
referenceable
.
set
(
"inputs"
,
inputTables
);
referenceable
.
set
(
"outputs"
,
outputTables
);
referenceable
.
set
(
"queryText"
,
queryText
);
referenceable
.
set
(
"queryPlan"
,
queryPlan
);
referenceable
.
set
(
"queryId"
,
queryId
);
referenceable
.
set
(
"queryGraph"
,
queryGraph
);
return
createInstance
(
referenceable
);
}
}
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