Skip to content

Anna br#4

Open
Ann0808 wants to merge 13 commits intokamyshova:masterfrom
Ann0808:anna_br
Open

Anna br#4
Ann0808 wants to merge 13 commits intokamyshova:masterfrom
Ann0808:anna_br

Conversation

@Ann0808
Copy link
Copy Markdown

@Ann0808 Ann0808 commented Apr 13, 2017

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

  • Added or modified tests to cover changes and any new functionality
  • Edited the README / documentation (if applicable)
  • All tests passing on Travis

Review

  • Final thumbs-up from reviewer
  • Rebase, squash and reword as applicable

For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests

@Ann0808
Copy link
Copy Markdown
Author

Ann0808 commented Apr 13, 2017

without jmh

Copy link
Copy Markdown
Owner

@kamyshova kamyshova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправьте замечания + поработайте с sonar. Попробуйте сделать проще, не используя lock. Или хотя бы подумайте над схемой как это могло было быть.

*/
public abstract class SinglePassSamProgram extends CommandLineProgram {

public static final int MAX_PAIRS = 1000, CAPACITY=50,SEM=2;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Никогда не стоит использовать подобного рода (в одну строку) инициализацию или объявления полей.

try {
queue.put(pairs);
} catch (InterruptedException e) {
e.printStackTrace();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В данном случае неправильно так обрабатывать InterruptedException, т.к. нужно закрыть все потоки и перебросить исключение.

final ProgressLogger progress = new ProgressLogger(log);
final ExecutorService service = Executors.newCachedThreadPool();
BlockingQueue<List<Object[]>> queue= new LinkedBlockingQueue<>(CAPACITY);
Semaphore semaphore = new Semaphore(SEM);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно не использовать здесь семафор для ограничения CachedThreadPool. Используйте FixedThreadPool, например.

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.

2 participants