Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit of number of files the flyway lambda can execute #10

Open
lokesha02 opened this issue Jun 8, 2019 · 1 comment
Open

limit of number of files the flyway lambda can execute #10

lokesha02 opened this issue Jun 8, 2019 · 1 comment

Comments

@lokesha02
Copy link

I have around 2000 DB schema files. But flyway lambda fails with error saying cannot find flyway.conf file. But when i reduce the file count to below 200 in the S3, it successfully deploys.

so what should we do if more files present. Any suggestions on running the scripts in batches

@lokesha02
Copy link
Author

I was able to resolve the above issue.
Limitation was with S3Client object, listObjects method will only first 1000 objects.
To fetch remaining object, listNextBatchOfObjects method need to be invoked till all objects are fetched based on the isTrucated method.
I modified the code which fetch objectsummary as below:

val objectSummaries = {
var objects = s3Client.listObjects(srcBucketName, srcPrefix)
val objectSummaryList = objects.getObjectSummaries()

  while(objects.isTruncated()){
	objects = s3Client.listNextBatchOfObjects(objects)
	objectSummaryList.addAll(objects.getObjectSummaries())
	logger.log(s"GetSummaries ${objectSummaryList.size()}")
  }
  objectSummaryList.asScala.toList.sortWith { (x, y) =>
    x.getKey.compareTo(y.getKey) < 1
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant