-
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 6 #206
Conversation
# Conflicts: # src/main/java/ru/vk/itmo/test/proninvalentin/MemorySegmentFactory.java # src/main/java/ru/vk/itmo/test/proninvalentin/Server.java # src/main/java/ru/vk/itmo/test/proninvalentin/ServiceImpl.java # src/main/java/ru/vk/itmo/test/proninvalentin/StartServer.java # src/main/java/ru/vk/itmo/test/proninvalentin/lua_scripts/get.lua # src/main/java/ru/vk/itmo/test/proninvalentin/lua_scripts/put.lua
…istent and Rendezvous hashing algorithms)
# Conflicts: # src/main/java/ru/vk/itmo/test/proninvalentin/MemorySegmentFactory.java # src/main/java/ru/vk/itmo/test/proninvalentin/Server.java # src/main/java/ru/vk/itmo/test/proninvalentin/ServiceImpl.java # src/main/java/ru/vk/itmo/test/proninvalentin/StartServer.java # src/main/java/ru/vk/itmo/test/proninvalentin/lua_scripts/put.lua # src/main/java/ru/vk/itmo/test/proninvalentin/reports/stage2/report.md
# Conflicts: # src/main/java/ru/vk/itmo/test/proninvalentin/Server.java # src/main/java/ru/vk/itmo/test/proninvalentin/ServerConfig.java # src/main/java/ru/vk/itmo/test/proninvalentin/ServiceImpl.java # src/main/java/ru/vk/itmo/test/proninvalentin/StartServer.java # src/main/java/ru/vk/itmo/test/proninvalentin/Utils.java # src/main/java/ru/vk/itmo/test/proninvalentin/sharding/ConsistentHashing.java # src/main/java/ru/vk/itmo/test/proninvalentin/sharding/ShardingAlgorithm.java # src/main/java/ru/vk/itmo/test/proninvalentin/workers/WorkerPool.java
# Conflicts: # src/main/java/ru/vk/itmo/test/reference/ReferenceServer.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 17435 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 17434 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 17434 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 20365 lines exceeds the maximum allowed for the inline comments feature.
|
||
private static final byte[] START_STREAM_HEADERS_BYTES = | ||
""" | ||
HTTP/1.1 200 OK\r |
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.
По спеке HTTP 1.1 не \r
, а \r\n
.
public void writePart(Socket socket) throws IOException { | ||
byte[] part = getNextPart(); | ||
String dataSize = Integer.toHexString(part.length); | ||
byte[] data = new ByteArrayBuilder(dataSize.length() + part.length + 2 * CRLF.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.
Зачем билдер? Можем же посчитать заранее сколько нужно байт
.append(part).append(CRLF) | ||
.toBytes(); | ||
|
||
socket.write(data, 0, data.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.
Здесь можем не все записать в сокет
"Returns:
The number of bytes written, possibly zero"
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 20365 lines exceeds the maximum allowed for the inline comments feature.
No description provided.