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

Add thread-pool implementation to read byte stream #3

Closed
wants to merge 3 commits into from

Conversation

hasithaa
Copy link
Contributor

@hasithaa hasithaa commented Jan 3, 2024

This pull request adds a thread-pool implementation to read byte streams. It includes the addition of two new classes: DataReaderThreadPool and DataReaderTask. The DataReaderThreadPool class provides a thread pool for data readers, while the DataReaderTask 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.

@hasithaa hasithaa requested a review from prakanth97 as a code owner January 3, 2024 05:29
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: Patch coverage is 76.31579% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 74.35%. Comparing base (e7a9b64) to head (931e925).
Report is 4 commits behind head on main.

❗ Current head 931e925 differs from pull request most recent head 8682d51. Consider uploading reports for the commit 8682d51 to get more accurate results

Files Patch % Lines
...llerina/stdlib/data/xmldata/io/DataReaderTask.java 72.41% 6 Missing and 2 partials ⚠️
...a/stdlib/data/xmldata/io/DataReaderThreadPool.java 83.33% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

prakanth97
prakanth97 previously approved these changes Jan 9, 2024
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Jan 24, 2024
@hasithaa hasithaa removed the Stale label Jan 25, 2024
@hasithaa
Copy link
Contributor Author

@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,
Copy link
Contributor

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

@SasinduDilshara
Copy link
Contributor

@prakanth97 @SasinduDilshara Please check this again.

Other than #3 (comment), LGTM

@Override
public Thread newThread(Runnable runnable) {
Thread balThread = new Thread(runnable);
balThread.setName("bal-data-xmldata-thread");
Copy link
Contributor

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.

Copy link

github-actions bot commented Feb 9, 2024

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Feb 9, 2024
@prakanth97 prakanth97 removed the Stale label Feb 10, 2024
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@prakanth97
Copy link
Contributor

Moved to this PR #7

@prakanth97 prakanth97 closed this Mar 5, 2024
prakanth97 added a commit to prakanth97/module-ballerina-data-xmldata that referenced this pull request Aug 14, 2024
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

Successfully merging this pull request may close these issues.

3 participants