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

HW6 #212

Merged
merged 81 commits into from
May 25, 2024
Merged

HW6 #212

merged 81 commits into from
May 25, 2024

Conversation

PetyaVasya
Copy link
Contributor

Игорь Ковалев Константинович, M33361

super(new byte[bufferSize], 0, 0, 0);
this.items = items;
this.current = items.next();
fillBuffer();
Copy link

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;
Copy link

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) {
Copy link

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);
Copy link

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();
Copy link

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.

@AlexeyShik AlexeyShik requested review from FedosOnGIT and removed request for AlexeyShik April 29, 2024 07:41
@AlexeyShik AlexeyShik assigned FedosOnGIT and unassigned AlexeyShik Apr 29, 2024
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) {
Copy link

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.

PetyaVasya and others added 6 commits May 1, 2024 22:31
# 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<>(
Copy link
Contributor

Choose a reason for hiding this comment

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

А зачем дополнительно в ArrayList засовывать?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Действительно, нет смысла)

Copy link
Contributor

@FedosOnGIT FedosOnGIT left a comment

Choose a reason for hiding this comment

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

окей 15

@incubos incubos merged commit a88dd7d into polis-vk:main May 25, 2024
2 checks passed
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.

5 participants