atlas git commit: ATLAS-2982: import fails to create classification-def - #2

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 73185dc51 -> 943e5c711


ATLAS-2982: import fails to create classification-def - #2

(cherry picked from commit 9a5553731b3ace19b2bca05f91676ec61b33f338)


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

Branch: refs/heads/branch-1.0
Commit: 943e5c7c29f9f46bcb9a2e120a97e539efb5
Parents: 73185dc
Author: Madhan Neethiraj 
Authored: Thu Nov 29 16:48:58 2018 -0800
Committer: Madhan Neethiraj 
Committed: Thu Nov 29 17:33:20 2018 -0800

--
 .../java/org/apache/atlas/repository/impexp/ImportService.java | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/943e5c71/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
index d06fd4a..a52c3f9 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
@@ -80,8 +80,6 @@ public class ImportService {
 
 public AtlasImportResult run(ZipSource source, AtlasImportRequest request, 
String userName,
  String hostName, String requestingIP) throws 
AtlasBaseException {
-RequestContext.get().setImportInProgress(true);
-
 if (request == null) {
 request = new AtlasImportRequest();
 }
@@ -91,6 +89,8 @@ public class ImportService {
 try {
 LOG.info("==> import(user={}, from={}, request={})", userName, 
requestingIP, request);
 
+RequestContext.get().setImportInProgress(true);
+
 String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMS_KEY) : null;
 setImportTransform(source, transforms);
 
@@ -110,6 +110,8 @@ public class ImportService {
 
 throw new AtlasBaseException(excp);
 } finally {
+RequestContext.get().setImportInProgress(false);
+
 source.close();
 LOG.info("<== import(user={}, from={}): status={}", userName, 
requestingIP, result.getOperationStatus());
 }



atlas git commit: ATLAS-2982: import fails to create classification-def - #2

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/master 18a4984a4 -> 9a5553731


ATLAS-2982: import fails to create classification-def - #2


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

Branch: refs/heads/master
Commit: 9a5553731b3ace19b2bca05f91676ec61b33f338
Parents: 18a4984
Author: Madhan Neethiraj 
Authored: Thu Nov 29 16:48:58 2018 -0800
Committer: Madhan Neethiraj 
Committed: Thu Nov 29 17:32:47 2018 -0800

--
 .../java/org/apache/atlas/repository/impexp/ImportService.java | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/9a555373/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
index d06fd4a..a52c3f9 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
@@ -80,8 +80,6 @@ public class ImportService {
 
 public AtlasImportResult run(ZipSource source, AtlasImportRequest request, 
String userName,
  String hostName, String requestingIP) throws 
AtlasBaseException {
-RequestContext.get().setImportInProgress(true);
-
 if (request == null) {
 request = new AtlasImportRequest();
 }
@@ -91,6 +89,8 @@ public class ImportService {
 try {
 LOG.info("==> import(user={}, from={}, request={})", userName, 
requestingIP, request);
 
+RequestContext.get().setImportInProgress(true);
+
 String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMS_KEY) : null;
 setImportTransform(source, transforms);
 
@@ -110,6 +110,8 @@ public class ImportService {
 
 throw new AtlasBaseException(excp);
 } finally {
+RequestContext.get().setImportInProgress(false);
+
 source.close();
 LOG.info("<== import(user={}, from={}): status={}", userName, 
requestingIP, result.getOperationStatus());
 }