Skip to content

Commit

Permalink
Update initial pool size for topics
Browse files Browse the repository at this point in the history
  • Loading branch information
mmodzelewski committed Oct 9, 2024
1 parent 55a787a commit e539694
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public List<Topic> getTopics(StreamId streamId) {
@Override
public TopicDetails createTopic(StreamId streamId, Optional<Long> topicId, Long partitionsCount, CompressionAlgorithm compressionAlgorithm, BigInteger messageExpiry, BigInteger maxTopicSize, Optional<Short> replicationFactor, String name) {
var streamIdBytes = toBytes(streamId);
var payload = Unpooled.buffer(23 + streamIdBytes.capacity() + name.length());
var payload = Unpooled.buffer(27 + streamIdBytes.readableBytes() + name.length());

payload.writeBytes(streamIdBytes);
payload.writeIntLE(topicId.orElse(0L).intValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import rs.iggy.user.*;
import java.util.List;
import java.util.Optional;
import static rs.iggy.clients.blocking.tcp.BytesSerializer.nameToBytes;

class UsersTcpClient implements UsersClient {

Expand Down Expand Up @@ -58,10 +59,8 @@ public IdentityInfo login(String username, String password) {
var payloadSize = 2 + username.length() + password.length() + 4 + version.length() + 4 + context.length();
var payload = Unpooled.buffer(payloadSize);

payload.writeByte(username.length());
payload.writeBytes(username.getBytes());
payload.writeByte(password.length());
payload.writeBytes(password.getBytes());
payload.writeBytes(nameToBytes(username));
payload.writeBytes(nameToBytes(password));
payload.writeIntLE(version.length());
payload.writeBytes(version.getBytes());
payload.writeIntLE(context.length());
Expand Down

0 comments on commit e539694

Please sign in to comment.