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
45b84fa2
Commit
45b84fa2
authored
7 years ago
by
Ashutosh Mestry
Committed by
Madhan Neethiraj
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2129: import fix to handle shutdown while in the middle of import (unit test fix)
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
c623835f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
BulkImporterImpl.java
...che/atlas/repository/store/graph/v1/BulkImporterImpl.java
+3
-2
AtlasEntityStoreV1BulkImportPercentTest.java
...ore/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
+1
-2
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java
View file @
45b84fa2
...
...
@@ -17,6 +17,7 @@
*/
package
org
.
apache
.
atlas
.
repository
.
store
.
graph
.
v1
;
import
com.google.common.annotations.VisibleForTesting
;
import
org.apache.atlas.AtlasErrorCode
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.impexp.AtlasImportResult
;
...
...
@@ -131,8 +132,8 @@ public class BulkImporterImpl implements BulkImporter {
return
updateImportProgress
(
LOG
,
currentIndex
+
1
,
streamSize
,
currentPercent
,
lastEntityImported
);
}
private
static
float
updateImportProgress
(
Logger
log
,
int
currentIndex
,
int
streamSize
,
float
currentPercent
,
String
additionalInfo
)
{
@VisibleForTesting
static
float
updateImportProgress
(
Logger
log
,
int
currentIndex
,
int
streamSize
,
float
currentPercent
,
String
additionalInfo
)
{
final
double
tolerance
=
0.000001
;
final
int
MAX_PERCENT
=
100
;
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
View file @
45b84fa2
...
...
@@ -19,7 +19,6 @@ package org.apache.atlas.repository.store.graph.v1;
import
org.mockito.invocation.InvocationOnMock
;
import
org.mockito.stubbing.Answer
;
import
org.powermock.reflect.Whitebox
;
import
org.slf4j.Logger
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
...
...
@@ -153,7 +152,7 @@ public class AtlasEntityStoreV1BulkImportPercentTest {
}
private
float
invokeBulkImportProgress
(
int
currentIndex
,
int
streamSize
,
float
currentPercent
)
throws
Exception
{
return
Whitebox
.
invokeMethod
(
AtlasEntityStoreV1
.
class
,
"updateImportProgress"
,
log
,
currentIndex
,
streamSize
,
currentPercent
,
"additional info"
);
return
BulkImporterImpl
.
updateImportProgress
(
log
,
currentIndex
,
streamSize
,
currentPercent
,
"additional info"
);
}
private
double
[]
fillPercentHolderWith100
()
{
...
...
This diff is collapsed.
Click to expand it.
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