Skip to content
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 #18

Merged
merged 10 commits into from
Mar 1, 2024

Conversation

SuDarina
Copy link
Contributor

@SuDarina SuDarina commented Feb 19, 2024

HW1

public class Server extends HttpServer {

private ReferenceDao dao;
private List<Integer> permittedMethods = List.of(Request.METHOD_GET, Request.METHOD_PUT, Request.METHOD_DELETE);
Copy link

Choose a reason for hiding this comment

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

Private field 'permittedMethods' could be made final; it is only initialized in the declaration or constructor.


@Override
public Service create(ServiceConfig serviceConfig) {
Config referenceDaoConfig = new Config(Path.of(serviceConfig.workingDir().toUri()), 1024 * 1024);
Copy link
Contributor

Choose a reason for hiding this comment

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

1024 * 1024 - очень невнятное число, особенно для того кто смотрит со стороны и не знает API. Лучше вынести в константу и назвать как-то осознанно


public class Server extends HttpServer {

private final ReferenceDao dao;
Copy link
Contributor

Choose a reason for hiding this comment

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

В полях лучше использовать как можно более общий тип, т/е/ интерфейс

public class Server extends HttpServer {

private final ReferenceDao dao;
private final List<Integer> permittedMethods =
Copy link
Contributor

Choose a reason for hiding this comment

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

для этих целей лучше использовать Set

public class ServiceIml implements Service {

private Server server;
private ReferenceDao dao;
Copy link
Contributor

Choose a reason for hiding this comment

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

тот же комментарий про более общий тип - лучше интерфейс

}

@Override
public CompletableFuture<Void> start() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

старт/стоп лучше сделать синхронизированными

@atimofeyev
Copy link
Contributor

надо добавить обработку неожиданных ошибок

@SuDarina
Copy link
Contributor Author

надо добавить обработку неожиданных ошибок

исправила

@atimofeyev atimofeyev merged commit 31b5ca6 into polis-vk:main Mar 1, 2024
2 checks passed
osokindm pushed a commit to osokindm/2024-highload-dht that referenced this pull request Mar 6, 2024
* HW1: add realization

* HW1: fix code style

* HW1: change exception constructor

* HW1: add report

* HW1: add flame graphs description

* HW1: add flame graphs description

* HW1: fix code style

* HW1: fixes according to review

---------

Co-authored-by: atimofeyev <[email protected]>
axothy pushed a commit to axothy/2024-highload-dht that referenced this pull request Mar 13, 2024
* HW1: add realization

* HW1: fix code style

* HW1: change exception constructor

* HW1: add report

* HW1: add flame graphs description

* HW1: add flame graphs description

* HW1: fix code style

* HW1: fixes according to review

---------

Co-authored-by: atimofeyev <[email protected]>
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.

3 participants