Skip to content

Commit

Permalink
Repackage blocking clients to prepare for introducing non-blocking cl…
Browse files Browse the repository at this point in the history
…ients
  • Loading branch information
mmodzelewski committed Jan 4, 2024
1 parent 1f34ac5 commit 09230ad
Show file tree
Hide file tree
Showing 43 changed files with 116 additions and 122 deletions.
30 changes: 0 additions & 30 deletions src/main/java/rs/iggy/IggyClient.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package rs.iggy.consumergroup;
package rs.iggy.clients.blocking;

import rs.iggy.consumergroup.ConsumerGroup;
import rs.iggy.consumergroup.ConsumerGroupDetails;
import rs.iggy.identifier.ConsumerGroupId;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package rs.iggy.consumeroffset;
package rs.iggy.clients.blocking;

import rs.iggy.consumeroffset.ConsumerOffsetInfo;
import rs.iggy.identifier.ConsumerId;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/rs/iggy/clients/blocking/IggyClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package rs.iggy.clients.blocking;

public interface IggyClient {

SystemClient system();

StreamsClient streams();

UsersClient users();

TopicsClient topics();

PartitionsClient partitions();

ConsumerGroupsClient consumerGroups();

ConsumerOffsetsClient consumerOffsets();

MessagesClient messages();

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package rs.iggy.message;
package rs.iggy.clients.blocking;

import rs.iggy.identifier.ConsumerId;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
import rs.iggy.message.MessageToSend;
import rs.iggy.message.Partitioning;
import rs.iggy.message.PolledMessages;
import rs.iggy.message.PollingStrategy;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rs.iggy.partition;
package rs.iggy.clients.blocking;

import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package rs.iggy.stream;
package rs.iggy.clients.blocking;

import rs.iggy.identifier.StreamId;
import rs.iggy.stream.StreamBase;
import rs.iggy.stream.StreamDetails;
import java.util.List;

public interface StreamsClient {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package rs.iggy.system;
package rs.iggy.clients.blocking;

import rs.iggy.system.ClientInfo;
import rs.iggy.system.ClientInfoDetails;
import rs.iggy.system.Stats;
import java.util.List;

public interface SystemClient {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package rs.iggy.topic;
package rs.iggy.clients.blocking;

import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
import rs.iggy.topic.Topic;
import rs.iggy.topic.TopicDetails;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rs.iggy.user;
package rs.iggy.clients.blocking;

import rs.iggy.identifier.UserId;
import rs.iggy.user.*;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.core.type.TypeReference;
import rs.iggy.clients.blocking.ConsumerGroupsClient;
import rs.iggy.consumergroup.ConsumerGroup;
import rs.iggy.consumergroup.ConsumerGroupDetails;
import rs.iggy.consumergroup.ConsumerGroupsClient;
import rs.iggy.identifier.ConsumerGroupId;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import org.apache.hc.core5.http.message.BasicNameValuePair;
import rs.iggy.clients.blocking.ConsumerOffsetsClient;
import rs.iggy.consumeroffset.ConsumerOffsetInfo;
import rs.iggy.consumeroffset.ConsumerOffsetsClient;
import rs.iggy.identifier.ConsumerId;
import rs.iggy.identifier.SingleConsumerId;
import rs.iggy.identifier.StreamId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
Expand All @@ -11,8 +11,8 @@
import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rs.iggy.http.error.IggyHttpError;
import rs.iggy.http.error.IggyHttpException;
import rs.iggy.clients.blocking.http.error.IggyHttpError;
import rs.iggy.clients.blocking.http.error.IggyHttpException;
import java.io.IOException;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import rs.iggy.IggyClient;
import rs.iggy.consumergroup.ConsumerGroupsClient;
import rs.iggy.consumeroffset.ConsumerOffsetsClient;
import rs.iggy.message.MessagesClient;
import rs.iggy.partition.PartitionsClient;
import rs.iggy.stream.StreamsClient;
import rs.iggy.system.SystemClient;
import rs.iggy.topic.TopicsClient;
import rs.iggy.user.UsersClient;
import rs.iggy.clients.blocking.*;

public class IggyHttpClient implements IggyClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import org.apache.hc.core5.http.message.BasicNameValuePair;
import rs.iggy.clients.blocking.MessagesClient;
import rs.iggy.identifier.ConsumerId;
import rs.iggy.identifier.SingleConsumerId;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
import rs.iggy.message.*;
import rs.iggy.message.MessageToSend;
import rs.iggy.message.Partitioning;
import rs.iggy.message.PolledMessages;
import rs.iggy.message.PollingStrategy;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import org.apache.hc.core5.http.message.BasicNameValuePair;
import rs.iggy.clients.blocking.PartitionsClient;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
import rs.iggy.partition.PartitionsClient;

class PartitionsHttpClient implements PartitionsClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.core.type.TypeReference;
import rs.iggy.clients.blocking.StreamsClient;
import rs.iggy.identifier.StreamId;
import rs.iggy.stream.StreamBase;
import rs.iggy.stream.StreamDetails;
import rs.iggy.stream.StreamsClient;
import java.util.List;

class StreamsHttpClient implements StreamsClient {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.core.type.TypeReference;
import rs.iggy.clients.blocking.SystemClient;
import rs.iggy.system.ClientInfo;
import rs.iggy.system.ClientInfoDetails;
import rs.iggy.system.Stats;
import rs.iggy.system.SystemClient;
import java.util.List;

class SystemHttpClient implements SystemClient {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.core.type.TypeReference;
import rs.iggy.clients.blocking.TopicsClient;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
import rs.iggy.topic.Topic;
import rs.iggy.topic.TopicDetails;
import rs.iggy.topic.TopicsClient;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import com.fasterxml.jackson.core.type.TypeReference;
import rs.iggy.clients.blocking.UsersClient;
import rs.iggy.identifier.UserId;
import rs.iggy.user.*;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rs.iggy.http.error;
package rs.iggy.clients.blocking.http.error;

public record IggyHttpError(
String id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rs.iggy.http.error;
package rs.iggy.clients.blocking.http.error;

public class IggyHttpException extends RuntimeException {
private final IggyHttpError error;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@NonNullApi
package rs.iggy.http;
package rs.iggy.clients.blocking.http;

import rs.iggy.NonNullApi;
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
package rs.iggy.tcp;
package rs.iggy.clients.blocking.tcp;

import reactor.netty.Connection;
import reactor.netty.tcp.TcpClient;
import rs.iggy.IggyClient;
import rs.iggy.consumergroup.ConsumerGroupsClient;
import rs.iggy.consumeroffset.ConsumerOffsetsClient;
import rs.iggy.message.MessagesClient;
import rs.iggy.partition.PartitionsClient;
import rs.iggy.stream.StreamsClient;
import rs.iggy.system.SystemClient;
import rs.iggy.topic.TopicsClient;
import rs.iggy.user.UsersClient;
import rs.iggy.clients.blocking.*;

public class IggyTcpClient implements IggyClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package rs.iggy.tcp;
package rs.iggy.clients.blocking.tcp;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import reactor.core.publisher.Mono;
import reactor.netty.Connection;
import rs.iggy.clients.blocking.UsersClient;
import rs.iggy.identifier.UserId;
import rs.iggy.user.*;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@NonNullApi
package rs.iggy.tcp;
package rs.iggy.clients.blocking.tcp;

import rs.iggy.NonNullApi;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package rs.iggy.consumergroup;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import rs.iggy.IntegrationTest;
import rs.iggy.consumergroup.ConsumerGroup;
import rs.iggy.identifier.ConsumerGroupId;
import rs.iggy.identifier.StreamId;
import rs.iggy.identifier.TopicId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rs.iggy;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.testcontainers.containers.GenericContainer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package rs.iggy.message;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import rs.iggy.IntegrationTest;
import rs.iggy.message.MessageToSend;
import rs.iggy.message.Partitioning;
import rs.iggy.message.PollingKind;
import rs.iggy.message.PollingStrategy;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package rs.iggy.partition;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import rs.iggy.IntegrationTest;
import rs.iggy.topic.TopicDetails;
import rs.iggy.topic.TopicsClient;
import static org.assertj.core.api.Assertions.assertThat;

public abstract class PartitionsClientBaseTest extends IntegrationTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package rs.iggy.stream;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import rs.iggy.IntegrationTest;
import static org.assertj.core.api.Assertions.assertThat;

public abstract class StreamClientBaseTest extends IntegrationTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package rs.iggy.topic;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import rs.iggy.IntegrationTest;
import static java.util.Optional.empty;
import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package rs.iggy.user;
package rs.iggy.clients.blocking;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import rs.iggy.IntegrationTest;
import static org.assertj.core.api.Assertions.assertThat;

public abstract class UsersClientBaseTest extends IntegrationTest {
Expand Down
Loading

0 comments on commit 09230ad

Please sign in to comment.