|
20 | 20 | import com.atlan.model.enums.AssetCreationHandling;
|
21 | 21 | import com.atlan.model.relations.Reference;
|
22 | 22 | import com.atlan.model.search.FluentSearch;
|
| 23 | +import com.atlan.model.search.IndexSearchDSL; |
23 | 24 | import com.atlan.serde.Serde;
|
24 | 25 | import java.io.Closeable;
|
25 | 26 | import java.io.IOException;
|
@@ -485,11 +486,12 @@ public synchronized AssetMutationResponse flush() throws AtlanException {
|
485 | 486 | } else {
|
486 | 487 | builder = client.assets.select(true).where(Asset.QUALIFIED_NAME.in(qualifiedNames));
|
487 | 488 | }
|
488 |
| - builder.pageSize(maxSize).stream().forEach(asset -> { |
489 |
| - AssetIdentity assetId = |
490 |
| - new AssetIdentity(asset.getTypeName(), asset.getQualifiedName(), caseInsensitive); |
491 |
| - found.put(assetId, asset.getQualifiedName()); |
492 |
| - }); |
| 489 | + builder.pageSize(Math.max(maxSize * 2, IndexSearchDSL.DEFAULT_PAGE_SIZE)).stream() |
| 490 | + .forEach(asset -> { |
| 491 | + AssetIdentity assetId = |
| 492 | + new AssetIdentity(asset.getTypeName(), asset.getQualifiedName(), caseInsensitive); |
| 493 | + found.put(assetId, asset.getQualifiedName()); |
| 494 | + }); |
493 | 495 | revised = new ArrayList<>();
|
494 | 496 | for (Asset asset : _batch) {
|
495 | 497 | AssetIdentity assetId =
|
@@ -519,7 +521,7 @@ public synchronized AssetMutationResponse flush() throws AtlanException {
|
519 | 521 | addPartialAsset(asset, revised);
|
520 | 522 | } else if (creationHandling == AssetCreationHandling.FULL) {
|
521 | 523 | // Still create it (full), if not found and full asset creation is allowed
|
522 |
| - revised.addAll(_batch); |
| 524 | + revised.add(asset); |
523 | 525 | } else {
|
524 | 526 | // Otherwise, if it still does not match any fallback and cannot be created, skip it
|
525 | 527 | track(skipped, asset);
|
|
0 commit comments