-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add thread-pool implementation to read byte stream #3
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3 +/- ##
============================================
+ Coverage 74.16% 74.35% +0.19%
- Complexity 381 384 +3
============================================
Files 19 21 +2
Lines 1819 1833 +14
Branches 420 420
============================================
+ Hits 1349 1363 +14
Misses 370 370
Partials 100 100 ☔ View full report in Codecov by Sentry. |
native/src/main/java/io/ballerina/stdlib/data/xmldata/io/DataReaderTask.java
Outdated
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/data/xmldata/io/DataReaderThreadPool.java
Outdated
Show resolved
Hide resolved
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
@prakanth97 @SasinduDilshara Please check this again. |
public class DataReaderThreadPool { | ||
|
||
// TODO : Make this configurable, in Ballerina Library. | ||
public static final ExecutorService EXECUTOR_SERVICE = new ThreadPoolExecutor(0, 50, 60L, TimeUnit.SECONDS, |
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.
Shall we make this 0, 50, 60L as constants. Because if we need to change these things in future, it will be easier
Other than #3 (comment), LGTM |
@Override | ||
public Thread newThread(Runnable runnable) { | ||
Thread balThread = new Thread(runnable); | ||
balThread.setName("bal-data-xmldata-thread"); |
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.
if this is along with the repo name, better to make it a constant as well.
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Moved to this PR #7 |
Fix namspace behaviours
This pull request adds a thread-pool implementation to read byte streams. It includes the addition of two new classes:
DataReaderThreadPool
andDataReaderTask
. TheDataReaderThreadPool
class provides a thread pool for data readers, while theDataReaderTask
class reads data from a Ballerina stream of byte blocks in a non-blocking manner. These additions enhance the performance and efficiency of reading byte streams in the application.