-
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
Тузиков Александр, ИТМО DWS, Stage 6 #217
Conversation
# Conflicts: # src/main/java/ru/vk/itmo/test/tuzikovalexandr/Server.java # src/main/java/ru/vk/itmo/test/tuzikovalexandr/ServerImpl.java # src/main/java/ru/vk/itmo/test/tuzikovalexandr/ServiceImpl.java
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 19082 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 19079 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 19079 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 19086 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 19086 lines exceeds the maximum allowed for the inline comments feature.
import java.nio.charset.StandardCharsets; | ||
import java.util.Iterator; | ||
|
||
public class StreamResponse extends Response { |
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.
если были на разборе 6го этапа, то наверное уже поняли что в этом решении вы потенциально все данные можете запихать в память, если с сетью какие-то проблемы
Тут надо обратить внимание на то что под капотом у sesion.write() и попробовать реализовать иенно асинхронную запись
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.
То есть надо было оставаться на том же алгоритме, что и у one.nio? Что мы можем не до конца сразу все записать, а вернуться к этому потом?
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.
да, надо запоминать сколько мы записали, а далее по событию о том что сеть опять готова на запись - записать остальное
byte[] entrySize = Integer.toHexString(keyInBytes.length + valueInBytes.length + Constants.NEW_LINE.length) | ||
.getBytes(StandardCharsets.UTF_8); | ||
|
||
byte[] resultValue = new byte[keyInBytes.length + valueInBytes.length + Constants.NEW_LINE.length |
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.
ну и достаточно много лишних аллокаций, которых можно было бы избежать.
Есть два варианта:
- Использовать какие-то пулы буфферов
- Попробовать писать в сокет прямо из MemorySegment-a
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.
The PR diff size of 20314 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 20333 lines exceeds the maximum allowed for the inline comments feature.
поправьте конфликт пожалуйста чтобы смежить |
# Conflicts: # src/main/java/ru/vk/itmo/test/tuzikovalexandr/ServiceImpl.java
Отчет в директории result/stage6 report.md
Хотел реализовать с использованием processWrite, но что-то не работало ничего(