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
214f2a76
Commit
214f2a76
authored
May 15, 2020
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3798: Import percentage display fix.
parent
935d0ab6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
BulkImporterImpl.java
...che/atlas/repository/store/graph/v2/BulkImporterImpl.java
+2
-2
BulkImportPercentTest.java
...tlas/repository/store/graph/v2/BulkImportPercentTest.java
+12
-3
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/BulkImporterImpl.java
View file @
214f2a76
...
...
@@ -89,11 +89,11 @@ public class BulkImporterImpl implements BulkImporter {
}
@VisibleForTesting
public
static
float
updateImportProgress
(
Logger
log
,
int
currentIndex
,
int
streamSize
,
float
currentPercent
,
String
additionalInfo
)
{
public
static
float
updateImportProgress
(
Logger
log
,
long
currentIndex
,
long
streamSize
,
float
currentPercent
,
String
additionalInfo
)
{
final
double
tolerance
=
0.000001
;
final
int
MAX_PERCENT
=
100
;
int
maxSize
=
(
currentIndex
<=
streamSize
)
?
streamSize
:
currentIndex
;
long
maxSize
=
(
currentIndex
<=
streamSize
)
?
streamSize
:
currentIndex
;
if
(
maxSize
<=
0
)
{
return
currentPercent
;
}
...
...
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/BulkImportPercentTest.java
View file @
214f2a76
...
...
@@ -39,7 +39,7 @@ public class BulkImportPercentTest {
private
List
<
Integer
>
percentHolder
;
private
Logger
log
;
public
void
setupPercentHolder
(
int
max
)
{
public
void
setupPercentHolder
(
long
max
)
{
percentHolder
=
new
ArrayList
<>();
}
...
...
@@ -127,6 +127,15 @@ public class BulkImportPercentTest {
}
@Test
public
void
percentTest_Equal100M
()
throws
Exception
{
long
streamSize
=
100000000
;
double
[]
expected
=
fillPercentHolderWith100
();
runWithSize
(
streamSize
);
assertEqualsForPercentHolder
(
expected
);
}
@Test
public
void
percentTest_Equal4323
()
throws
Exception
{
int
streamSize
=
4323
;
...
...
@@ -153,7 +162,7 @@ public class BulkImportPercentTest {
assertTrue
((
f
-
MAX_PERCENT_FLOAT
)
<=
0.0001
);
}
private
void
runWithSize
(
int
streamSize
)
throws
Exception
{
private
void
runWithSize
(
long
streamSize
)
throws
Exception
{
float
currentPercent
=
0
;
setupPercentHolder
(
streamSize
);
for
(
int
currentIndex
=
0
;
currentIndex
<
streamSize
;
currentIndex
++)
{
...
...
@@ -161,7 +170,7 @@ public class BulkImportPercentTest {
}
}
private
float
invokeBulkImportProgress
(
int
currentIndex
,
int
streamSize
,
float
currentPercent
)
throws
Exception
{
private
float
invokeBulkImportProgress
(
int
currentIndex
,
long
streamSize
,
float
currentPercent
)
throws
Exception
{
return
BulkImporterImpl
.
updateImportProgress
(
log
,
currentIndex
,
streamSize
,
currentPercent
,
"additional info"
);
}
...
...
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