atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject atlas git commit: ATLAS-2129: import fix to handle shutdown while in the middle of import (unit test fix)
Date Fri, 15 Sep 2017 18:24:37 GMT
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 81e5444f4 -> 4d5e69a85


ATLAS-2129: import fix to handle shutdown while in the middle of import (unit test fix)

Signed-off-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 45b84fa201bdd63cc36094613d33b16741e4fb7a)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4d5e69a8
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4d5e69a8
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4d5e69a8

Branch: refs/heads/branch-0.8
Commit: 4d5e69a85c5ca38ca2216e005feb21f46c5798b8
Parents: 81e5444
Author: Ashutosh Mestry <amestry@apache.org>
Authored: Fri Sep 15 10:39:42 2017 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Fri Sep 15 11:24:31 2017 -0700

----------------------------------------------------------------------
 .../atlas/repository/store/graph/v1/BulkImporterImpl.java       | 5 +++--
 .../store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/4d5e69a8/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java
index e929d7f..467ced7 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java
@@ -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;
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/4d5e69a8/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
index 10becc1..73dfe37 100644
--- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
+++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1BulkImportPercentTest.java
@@ -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() {


Mime
View raw message