-
Notifications
You must be signed in to change notification settings - Fork 47
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 1 #4
Conversation
src/main/java/ru/vk/itmo/test/viktorkorotkikh/LSMServerImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/LSMServerImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/io/write/AbstractSSTableWriter.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/io/write/AbstractSSTableWriter.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/io/write/AbstractSSTableWriter.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/sstable/SSTableUtils.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/sstable/SSTableUtils.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/sstable/SSTableUtils.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/sstable/SSTableUtils.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/sstable/SSTableUtils.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/dao/sstable/SSTableUtils.java
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/http/LSMCustomSession.java
Outdated
Show resolved
Hide resolved
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.
Здорово воспользовались результатами профилирования чтобы затюнить респонсы на put/delete
|
||
server.incRequestsProcessed(); | ||
|
||
String connection = handling.getHeader("Connection:"); |
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.
тут явно прослеживается копипаст с методом в 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.
Заменил на вызов статического метода из LSMConstantResponse
} | ||
|
||
public void startServer() { | ||
createLSMDao(); |
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.
вызовы методов которые что-то делают внутри с состоянием тяжелы для понимания, да и кто-то может случайно поменять местами вызов методов, в итоге все поломается.
Лучше чтобы метод createLSMDao() возвращал дао, и его уже надо было бы передать как агрумент в start()
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.
Создаю теперь дао в LSMServiceImpl вместе с LSMServerImpl, в конструктор которого и передаю дао. При остановке стопаю сервер и закрываю дао также в LSMServiceImpl.
return; | ||
} | ||
|
||
Response response = switch (request.getMethod()) { |
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.
Добавил локальную обработку exception в самих методах обработки запроса и глобальный try-catch в переопределённом методе handleRequest
|
||
@Override | ||
public CompletableFuture<Void> start() throws IOException { | ||
if (isRunning.getAndSet(true)) return CompletableFuture.completedFuture(null); |
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.
лучше сделать start/stop synchronized, а то все равно получилось не безопасно, если будут долюить параллельно
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.
Сделал методы start/stop synchronized
src/main/java/ru/vk/itmo/test/viktorkorotkikh/LSMServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/viktorkorotkikh/LSMServiceImpl.java
Outdated
Show resolved
Hide resolved
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.
15 баллов
* state-1: add dao impl * state-1: first implementation of httpserver * state-1: fix flushing after stress failure * state-1: refactoring * state-1: add scripts * state-1: wrk reports * state-1: fix codestyle * state-1: fix codestyle 2 * state-1: add report * state-1: fix getting id parameter * state-1: new report * state-1: fix new report * state-1: memory allocations fix * state-1: fix codeclimate * stage-1: fix review comments * stage-1: codeclimate fix * stage-1: add global exception handler
* state-1: add dao impl * state-1: first implementation of httpserver * state-1: fix flushing after stress failure * state-1: refactoring * state-1: add scripts * state-1: wrk reports * state-1: fix codestyle * state-1: fix codestyle 2 * state-1: add report * state-1: fix getting id parameter * state-1: new report * state-1: fix new report * state-1: memory allocations fix * state-1: fix codeclimate * stage-1: fix review comments * stage-1: codeclimate fix * stage-1: add global exception handler
Отчёт находится тут и тут.
Второй отчёт - новый отчёт с использованием новых скриптов для создания запросов. Оказалось, что прошлая версия не могла обеспечить большой RPS из-за долгой генерации тела запроса. То есть wrk физически не мог пропихнуть нужное количество запросов, потому что большую часть времени тратил на луа скрипт 🤕