-
Notifications
You must be signed in to change notification settings - Fork 364
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
Refactor IO thread pool usage #3007
Conversation
3eb37d0
to
691de3a
Compare
115e010
to
109a225
Compare
0914285
to
d81ecd0
Compare
abstract class COGCollectionLayerReader[ID] { self => | ||
implicit val ec: ExecutionContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird for two reasons.
COGCollectionLayerReader
is already abstract class, why not just make it a constructor parameter, that is way more explicit- Is it very painful to have this be non
implicit
? Its a little difficult to see where it is used .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the COGCollectionLayerReader.read
I think it makes not a lot of sense to pass execution context explicitly in the code that can work only 'locally' and is internal API in fact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also do I understand correct that your 1. comment can be applied to all our abstract classes? (CollectionLayerReader
for instance)
s3/src/main/scala/geotrellis/store/s3/cog/S3COGCollectionLayerReader.scala
Outdated
Show resolved
Hide resolved
spark/src/main/scala/geotrellis/spark/store/file/FileRDDReader.scala
Outdated
Show resolved
Hide resolved
spark/src/test/scala/geotrellis/spark/store/hadoop/util/HdfsRangeReaderProviderSpec.scala
Show resolved
Hide resolved
store/src/main/scala/geotrellis/store/file/FileCollectionLayerProvider.scala
Show resolved
Hide resolved
430c683
to
f4e9b05
Compare
f4e9b05
to
675235c
Compare
675235c
to
661530d
Compare
Overview
This PR refactors GeoTrellis blocking thread pool usages. Instead of having multiple thread pools for each particular backend / reader / writer there would be a single and configurable thread pool. By default it is a
FixedThreadPool
with ageotrellis-default-io-%d
name. In addition to that, it was decided to make it configurable by user. This PR allows users to use their own thread pools for all kind of readers / writers.In this PR we also introduced a new way to pass objects that should not be serialized (
ExecutionContext
andS3Client
) into objects constructors. Instead of passing a function to create an instance of a thing, it was decided to pass these objects asby-name
parameters. Such approach allows to simplify the API and makes the API more transparent.This PR touches all the project configuration files, and with this PR we introduce
hyphen-separated
case usage by default instead of acamel-case
.docs/CHANGELOG.rst
updated, if necessaryCloses #2945