-
Notifications
You must be signed in to change notification settings - Fork 48
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
Смирнов Андрей ИТМО КТ Stage 5 #181
Conversation
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.
Есть замечания к корректности многопоточки + в этом дз тоже нужен отчет
src/main/java/ru/vk/itmo/test/smirnovandrew/RendezvousClusterManager.java
Show resolved
Hide resolved
this.dao = new MyServerDao(dao); | ||
this.executor = new MyExecutor(corePoolSize, availableProcessors); | ||
this.logger = Logger.getLogger(MyServer.class.getName()); | ||
this.httpClient = HttpClient.newHttpClient(); |
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.
На каком пуле потоков выполняются запросы к другим репликам?
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.executor = new MyExecutor(corePoolSize, availableProcessors);
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.
}; | ||
|
||
completableResults.forEach(completableFuture -> { | ||
var responseFuture = completableFuture.whenComplete(whenComplete); |
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.
На каком пуле потоков выполняется агрегация ответов от реплик?
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.executor = new MyExecutor(corePoolSize, availableProcessors);
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.
Так как в явном виде не меняется пул потоков (не передается другой executor), то будет выполняться на том же пуле потоков, что и completableResults, то есть на том же пуле, что и sendAsync, на потоках из httpClient.
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.
The PR diff size of 14925 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 14929 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 14616 lines exceeds the maximum allowed for the inline comments feature.
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.
С учетом замечаний по многопоточке поставлю 13 баллов.
this.dao = new MyServerDao(dao); | ||
this.executor = new MyExecutor(corePoolSize, availableProcessors); | ||
this.logger = Logger.getLogger(MyServer.class.getName()); | ||
this.httpClient = HttpClient.newHttpClient(); |
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.
}; | ||
|
||
completableResults.forEach(completableFuture -> { | ||
var responseFuture = completableFuture.whenComplete(whenComplete); |
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.
Так как в явном виде не меняется пул потоков (не передается другой executor), то будет выполняться на том же пуле потоков, что и completableResults, то есть на том же пуле, что и sendAsync, на потоках из httpClient.
build.gradle
Outdated
@@ -68,8 +68,9 @@ compileTestJava { | |||
options.compilerArgs += ["--enable-preview"] | |||
} | |||
|
|||
application { | |||
mainClass = 'ru.vk.itmo.test.reference.ReferenceService' | |||
run { |
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.
Надо откатить перед мерджем
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.
JIT видно на профиле
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.
The PR diff size of 14616 lines exceeds the maximum allowed for the inline comments feature.
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.
Прошу откатить build.gradle
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.
The PR diff size of 14611 lines exceeds the maximum allowed for the inline comments feature.
No description provided.