Open
Conversation
Author
|
without jmh |
kamyshova
reviewed
Apr 16, 2017
Owner
kamyshova
left a comment
There was a problem hiding this comment.
Поправьте замечания + поработайте с sonar. Попробуйте сделать проще, не используя lock. Или хотя бы подумайте над схемой как это могло было быть.
| */ | ||
| public abstract class SinglePassSamProgram extends CommandLineProgram { | ||
|
|
||
| public static final int MAX_PAIRS = 1000, CAPACITY=50,SEM=2; |
Owner
There was a problem hiding this comment.
Никогда не стоит использовать подобного рода (в одну строку) инициализацию или объявления полей.
| try { | ||
| queue.put(pairs); | ||
| } catch (InterruptedException e) { | ||
| e.printStackTrace(); |
Owner
There was a problem hiding this comment.
В данном случае неправильно так обрабатывать InterruptedException, т.к. нужно закрыть все потоки и перебросить исключение.
| final ProgressLogger progress = new ProgressLogger(log); | ||
| final ExecutorService service = Executors.newCachedThreadPool(); | ||
| BlockingQueue<List<Object[]>> queue= new LinkedBlockingQueue<>(CAPACITY); | ||
| Semaphore semaphore = new Semaphore(SEM); |
Owner
There was a problem hiding this comment.
Можно не использовать здесь семафор для ограничения CachedThreadPool. Используйте FixedThreadPool, например.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Give your PR a concise yet descriptive title
Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?
Mention any issues fixed, addressed or otherwise related to this pull request, including issue numbers or hard links for issues in other repos.
You can delete these instructions once you have written your PR description.
Checklist (never delete this)
Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.
Content
Review
For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests