Commit 49db4cac by Ashutosh Mestry

ATLAS-3176: Fix for export order regression.

parent 73d2134a
...@@ -42,11 +42,9 @@ class ExportTypeProcessor { ...@@ -42,11 +42,9 @@ class ExportTypeProcessor {
private static final Logger LOG = LoggerFactory.getLogger(ExportTypeProcessor.class); private static final Logger LOG = LoggerFactory.getLogger(ExportTypeProcessor.class);
private AtlasTypeRegistry typeRegistry; private AtlasTypeRegistry typeRegistry;
private final ExportService.ExportContext context;
ExportTypeProcessor(AtlasTypeRegistry typeRegistry, ExportService.ExportContext context) { ExportTypeProcessor(AtlasTypeRegistry typeRegistry) {
this.typeRegistry = typeRegistry; this.typeRegistry = typeRegistry;
this.context = context;
} }
public void addTypes(AtlasEntity entity, ExportService.ExportContext context) { public void addTypes(AtlasEntity entity, ExportService.ExportContext context) {
......
...@@ -190,10 +190,10 @@ public class ZipSource implements EntityImportStream { ...@@ -190,10 +190,10 @@ public class ZipSource implements EntityImportStream {
T t; T t;
try { try {
t = AtlasType.fromJson(jsonData, clazz); t = AtlasType.fromJson(jsonData, clazz);
if(t == null) { if (t == null) {
throw new AtlasBaseException("Error converting file to JSON."); LOG.error("Error converting file to JSON.");
return null;
} }
} catch (Exception e) { } catch (Exception e) {
throw new AtlasBaseException("Error converting file to JSON.", e); throw new AtlasBaseException("Error converting file to JSON.", e);
} }
...@@ -238,7 +238,7 @@ public class ZipSource implements EntityImportStream { ...@@ -238,7 +238,7 @@ public class ZipSource implements EntityImportStream {
currentPosition++; currentPosition++;
return getEntityWithExtInfo(this.iterator.next()); return getEntityWithExtInfo(this.iterator.next());
} catch (AtlasBaseException e) { } catch (AtlasBaseException e) {
LOG.error("getNextEntityWithExtInfo", e); LOG.warn("getNextEntityWithExtInfo", e);
return null; return null;
} }
} }
......
...@@ -73,7 +73,7 @@ public class AdminExportImportTestIT extends BaseResourceIT { ...@@ -73,7 +73,7 @@ public class AdminExportImportTestIT extends BaseResourceIT {
@Test(dependsOnMethods = "importData") @Test(dependsOnMethods = "importData")
public void exportData() throws AtlasServiceException, IOException, AtlasBaseException { public void exportData() throws AtlasServiceException, IOException, AtlasBaseException {
final int EXPECTED_CREATION_ORDER_SIZE = 10; final int EXPECTED_CREATION_ORDER_SIZE = 6;
AtlasExportRequest request = TestResourceFileUtils.readObjectFromJson(".", EXPORT_REQUEST_FILE, AtlasExportRequest.class); AtlasExportRequest request = TestResourceFileUtils.readObjectFromJson(".", EXPORT_REQUEST_FILE, AtlasExportRequest.class);
InputStream exportedStream = atlasClientV2.exportData(request); InputStream exportedStream = atlasClientV2.exportData(request);
...@@ -81,7 +81,7 @@ public class AdminExportImportTestIT extends BaseResourceIT { ...@@ -81,7 +81,7 @@ public class AdminExportImportTestIT extends BaseResourceIT {
ZipSource zs = new ZipSource(exportedStream); ZipSource zs = new ZipSource(exportedStream);
assertNotNull(zs.getExportResult()); assertNotNull(zs.getExportResult());
assertTrue(zs.getCreationOrder().size() > EXPECTED_CREATION_ORDER_SIZE, "expected creationOrderSize > " + EXPECTED_CREATION_ORDER_SIZE + ", but found " + zs.getCreationOrder().size()); assertTrue(zs.getCreationOrder().size() >= EXPECTED_CREATION_ORDER_SIZE, "expected creationOrderSize > " + EXPECTED_CREATION_ORDER_SIZE + ", but found " + zs.getCreationOrder().size());
} }
private void performImport(String fileToImport, int expectedProcessedEntitiesCount) throws AtlasServiceException { private void performImport(String fileToImport, int expectedProcessedEntitiesCount) throws AtlasServiceException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment