-
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
HW6 #212
HW6 #212
Conversation
# Conflicts: # src/main/java/ru/vk/itmo/test/kovalevigor/config/DaoServerConfig.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/Server.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceFactoryImpl.java
+fix codeclimate
super(new byte[bufferSize], 0, 0, 0); | ||
this.items = items; | ||
this.current = items.next(); | ||
fillBuffer(); |
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.
Overridable method 'remaining' called during object construction
|
||
private final Iterator<ByteStorage> items; | ||
private ByteStorage current; | ||
private int itemOffset = 0; |
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.
Avoid using redundant field initializer for 'itemOffset'
|
||
private final byte[] data; | ||
|
||
public BaseByteStorage(byte[] data) { |
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 user-supplied array 'data' is stored directly.
public interface ByteStorage { | ||
|
||
long size(); | ||
void get(int srcOffset, byte[] dst, int dstOffset, int 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.
'METHOD_DEF' should be separated from previous statement.
@@ -98,6 +145,23 @@ private static Response addTimestamp(Response response, TimeEntry<?> entry) { | |||
return response; | |||
} | |||
|
|||
private static Session.QueueItem mapEntry(Entry<MemorySegment> entry) { | |||
long keySize = entry.key().byteSize(); | |||
long valueSize = entry.value() == null ? 0 : entry.value().byteSize(); |
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.
Use a single space to separate non-whitespace characters.
public static final MemorySegment CHUNK_LINE_END = MemorySegment.ofArray("\r\n".getBytes(CHARSET)); | ||
public static final MemorySegment KEY_VALUE_SEP = MemorySegment.ofArray("\n".getBytes(CHARSET)); | ||
private final List<MemorySegment> chunk; | ||
public ChunkQueueItem(int bufferSize) { |
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.
'CTOR_DEF' should be separated from previous statement.
# Conflicts: # src/main/java/ru/vk/itmo/test/kovalevigor/reports/scripts/sh/base.sh # src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceFactoryImpl.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/ServiceImpl.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/ServerRemoteStrategy.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/AckEitherCompletableFuture.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerReplicationStrategyDecorator.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/decorators/ServerSendResponseStrategyDecorator.java # src/main/java/ru/vk/itmo/test/kovalevigor/server/strategy/util/ServerUtil.java
|
||
public ChunkQueueItem(int bufferSize) { | ||
super(bufferSize); | ||
chunk = new ArrayList<>( |
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.
А зачем дополнительно в ArrayList
засовывать?
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.
окей 15
Игорь Ковалев Константинович, M33361