From ccd5f3d9871d2c2d731294d3ce807047dd79fc62 Mon Sep 17 00:00:00 2001 From: mu <59917266+4eUeP@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:35:32 +0800 Subject: [PATCH 1/3] Move common/kafka to hstream-kafka --- cabal.project | 2 +- common/kafka/LICENSE | 1 - hstream-kafka/LICENSE | 1 + {common/kafka => hstream-kafka}/README.md | 0 {common/kafka => hstream-kafka}/hstream-kafka.cabal | 0 {common/kafka => hstream-kafka}/message/ApiVersionsRequest.json | 0 .../kafka => hstream-kafka}/message/ApiVersionsResponse.json | 0 .../kafka => hstream-kafka}/message/CreateTopicsRequest.json | 0 .../kafka => hstream-kafka}/message/CreateTopicsResponse.json | 0 .../kafka => hstream-kafka}/message/DeleteTopicsRequest.json | 0 .../kafka => hstream-kafka}/message/DeleteTopicsResponse.json | 0 .../kafka => hstream-kafka}/message/DescribeGroupsRequest.json | 0 .../kafka => hstream-kafka}/message/DescribeGroupsResponse.json | 0 {common/kafka => hstream-kafka}/message/FetchRequest.json | 0 {common/kafka => hstream-kafka}/message/FetchResponse.json | 0 .../kafka => hstream-kafka}/message/FindCoordinatorRequest.json | 0 .../message/FindCoordinatorResponse.json | 0 {common/kafka => hstream-kafka}/message/HeartbeatRequest.json | 0 {common/kafka => hstream-kafka}/message/HeartbeatResponse.json | 0 {common/kafka => hstream-kafka}/message/JoinGroupRequest.json | 0 {common/kafka => hstream-kafka}/message/JoinGroupResponse.json | 0 {common/kafka => hstream-kafka}/message/LeaveGroupRequest.json | 0 {common/kafka => hstream-kafka}/message/LeaveGroupResponse.json | 0 {common/kafka => hstream-kafka}/message/ListGroupsRequest.json | 0 {common/kafka => hstream-kafka}/message/ListGroupsResponse.json | 0 {common/kafka => hstream-kafka}/message/ListOffsetsRequest.json | 0 .../kafka => hstream-kafka}/message/ListOffsetsResponse.json | 0 {common/kafka => hstream-kafka}/message/MetadataRequest.json | 0 {common/kafka => hstream-kafka}/message/MetadataResponse.json | 0 .../kafka => hstream-kafka}/message/OffsetCommitRequest.json | 0 .../kafka => hstream-kafka}/message/OffsetCommitResponse.json | 0 {common/kafka => hstream-kafka}/message/OffsetFetchRequest.json | 0 .../kafka => hstream-kafka}/message/OffsetFetchResponse.json | 0 {common/kafka => hstream-kafka}/message/ProduceRequest.json | 0 {common/kafka => hstream-kafka}/message/ProduceResponse.json | 0 {common/kafka => hstream-kafka}/message/README.md | 0 {common/kafka => hstream-kafka}/message/SyncGroupRequest.json | 0 {common/kafka => hstream-kafka}/message/SyncGroupResponse.json | 0 .../kafka => hstream-kafka}/src/Kafka/Common/OffsetManager.hs | 0 .../kafka => hstream-kafka}/src/Kafka/Common/RecordFormat.hs | 0 {common/kafka => hstream-kafka}/src/Kafka/Protocol.hs | 0 {common/kafka => hstream-kafka}/src/Kafka/Protocol/Encoding.hs | 0 .../src/Kafka/Protocol/Encoding/Encode.hs | 0 .../src/Kafka/Protocol/Encoding/Internal.hs | 0 .../src/Kafka/Protocol/Encoding/Parser.hs | 0 {common/kafka => hstream-kafka}/src/Kafka/Protocol/Error.hs | 0 {common/kafka => hstream-kafka}/src/Kafka/Protocol/Message.hs | 0 .../src/Kafka/Protocol/Message/Struct.hs | 0 {common/kafka => hstream-kafka}/src/Kafka/Protocol/Service.hs | 0 {common/kafka => hstream-kafka}/src/Kafka/Server.hs | 0 .../kafka => hstream-kafka}/test/Kafka/Protocol/EncodingSpec.hs | 0 .../kafka => hstream-kafka}/test/Kafka/QuickCheck/Instances.hs | 0 {common/kafka => hstream-kafka}/test/Spec.hs | 0 script/kafka_gen.py | 2 +- 54 files changed, 3 insertions(+), 3 deletions(-) delete mode 120000 common/kafka/LICENSE create mode 120000 hstream-kafka/LICENSE rename {common/kafka => hstream-kafka}/README.md (100%) rename {common/kafka => hstream-kafka}/hstream-kafka.cabal (100%) rename {common/kafka => hstream-kafka}/message/ApiVersionsRequest.json (100%) rename {common/kafka => hstream-kafka}/message/ApiVersionsResponse.json (100%) rename {common/kafka => hstream-kafka}/message/CreateTopicsRequest.json (100%) rename {common/kafka => hstream-kafka}/message/CreateTopicsResponse.json (100%) rename {common/kafka => hstream-kafka}/message/DeleteTopicsRequest.json (100%) rename {common/kafka => hstream-kafka}/message/DeleteTopicsResponse.json (100%) rename {common/kafka => hstream-kafka}/message/DescribeGroupsRequest.json (100%) rename {common/kafka => hstream-kafka}/message/DescribeGroupsResponse.json (100%) rename {common/kafka => hstream-kafka}/message/FetchRequest.json (100%) rename {common/kafka => hstream-kafka}/message/FetchResponse.json (100%) rename {common/kafka => hstream-kafka}/message/FindCoordinatorRequest.json (100%) rename {common/kafka => hstream-kafka}/message/FindCoordinatorResponse.json (100%) rename {common/kafka => hstream-kafka}/message/HeartbeatRequest.json (100%) rename {common/kafka => hstream-kafka}/message/HeartbeatResponse.json (100%) rename {common/kafka => hstream-kafka}/message/JoinGroupRequest.json (100%) rename {common/kafka => hstream-kafka}/message/JoinGroupResponse.json (100%) rename {common/kafka => hstream-kafka}/message/LeaveGroupRequest.json (100%) rename {common/kafka => hstream-kafka}/message/LeaveGroupResponse.json (100%) rename {common/kafka => hstream-kafka}/message/ListGroupsRequest.json (100%) rename {common/kafka => hstream-kafka}/message/ListGroupsResponse.json (100%) rename {common/kafka => hstream-kafka}/message/ListOffsetsRequest.json (100%) rename {common/kafka => hstream-kafka}/message/ListOffsetsResponse.json (100%) rename {common/kafka => hstream-kafka}/message/MetadataRequest.json (100%) rename {common/kafka => hstream-kafka}/message/MetadataResponse.json (100%) rename {common/kafka => hstream-kafka}/message/OffsetCommitRequest.json (100%) rename {common/kafka => hstream-kafka}/message/OffsetCommitResponse.json (100%) rename {common/kafka => hstream-kafka}/message/OffsetFetchRequest.json (100%) rename {common/kafka => hstream-kafka}/message/OffsetFetchResponse.json (100%) rename {common/kafka => hstream-kafka}/message/ProduceRequest.json (100%) rename {common/kafka => hstream-kafka}/message/ProduceResponse.json (100%) rename {common/kafka => hstream-kafka}/message/README.md (100%) rename {common/kafka => hstream-kafka}/message/SyncGroupRequest.json (100%) rename {common/kafka => hstream-kafka}/message/SyncGroupResponse.json (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Common/OffsetManager.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Common/RecordFormat.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Encoding.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Encoding/Encode.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Encoding/Internal.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Encoding/Parser.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Error.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Message.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Message/Struct.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Protocol/Service.hs (100%) rename {common/kafka => hstream-kafka}/src/Kafka/Server.hs (100%) rename {common/kafka => hstream-kafka}/test/Kafka/Protocol/EncodingSpec.hs (100%) rename {common/kafka => hstream-kafka}/test/Kafka/QuickCheck/Instances.hs (100%) rename {common/kafka => hstream-kafka}/test/Spec.hs (100%) diff --git a/cabal.project b/cabal.project index 5114f6e63..1e7e222cf 100644 --- a/cabal.project +++ b/cabal.project @@ -18,7 +18,6 @@ packages: common/api/hstream-api-hs.cabal common/hstream/hstream-common.cabal common/stats/hstream-common-stats.cabal - common/kafka/hstream-kafka.cabal hstream-store hstream-diffflow @@ -27,6 +26,7 @@ packages: hstream-io hstream-gossip hstream-admin/server/hstream-admin-server.cabal + hstream-kafka hstream hstream-admin/hstream-admin.cabal diff --git a/common/kafka/LICENSE b/common/kafka/LICENSE deleted file mode 120000 index 30cff7403..000000000 --- a/common/kafka/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE \ No newline at end of file diff --git a/hstream-kafka/LICENSE b/hstream-kafka/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/hstream-kafka/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/common/kafka/README.md b/hstream-kafka/README.md similarity index 100% rename from common/kafka/README.md rename to hstream-kafka/README.md diff --git a/common/kafka/hstream-kafka.cabal b/hstream-kafka/hstream-kafka.cabal similarity index 100% rename from common/kafka/hstream-kafka.cabal rename to hstream-kafka/hstream-kafka.cabal diff --git a/common/kafka/message/ApiVersionsRequest.json b/hstream-kafka/message/ApiVersionsRequest.json similarity index 100% rename from common/kafka/message/ApiVersionsRequest.json rename to hstream-kafka/message/ApiVersionsRequest.json diff --git a/common/kafka/message/ApiVersionsResponse.json b/hstream-kafka/message/ApiVersionsResponse.json similarity index 100% rename from common/kafka/message/ApiVersionsResponse.json rename to hstream-kafka/message/ApiVersionsResponse.json diff --git a/common/kafka/message/CreateTopicsRequest.json b/hstream-kafka/message/CreateTopicsRequest.json similarity index 100% rename from common/kafka/message/CreateTopicsRequest.json rename to hstream-kafka/message/CreateTopicsRequest.json diff --git a/common/kafka/message/CreateTopicsResponse.json b/hstream-kafka/message/CreateTopicsResponse.json similarity index 100% rename from common/kafka/message/CreateTopicsResponse.json rename to hstream-kafka/message/CreateTopicsResponse.json diff --git a/common/kafka/message/DeleteTopicsRequest.json b/hstream-kafka/message/DeleteTopicsRequest.json similarity index 100% rename from common/kafka/message/DeleteTopicsRequest.json rename to hstream-kafka/message/DeleteTopicsRequest.json diff --git a/common/kafka/message/DeleteTopicsResponse.json b/hstream-kafka/message/DeleteTopicsResponse.json similarity index 100% rename from common/kafka/message/DeleteTopicsResponse.json rename to hstream-kafka/message/DeleteTopicsResponse.json diff --git a/common/kafka/message/DescribeGroupsRequest.json b/hstream-kafka/message/DescribeGroupsRequest.json similarity index 100% rename from common/kafka/message/DescribeGroupsRequest.json rename to hstream-kafka/message/DescribeGroupsRequest.json diff --git a/common/kafka/message/DescribeGroupsResponse.json b/hstream-kafka/message/DescribeGroupsResponse.json similarity index 100% rename from common/kafka/message/DescribeGroupsResponse.json rename to hstream-kafka/message/DescribeGroupsResponse.json diff --git a/common/kafka/message/FetchRequest.json b/hstream-kafka/message/FetchRequest.json similarity index 100% rename from common/kafka/message/FetchRequest.json rename to hstream-kafka/message/FetchRequest.json diff --git a/common/kafka/message/FetchResponse.json b/hstream-kafka/message/FetchResponse.json similarity index 100% rename from common/kafka/message/FetchResponse.json rename to hstream-kafka/message/FetchResponse.json diff --git a/common/kafka/message/FindCoordinatorRequest.json b/hstream-kafka/message/FindCoordinatorRequest.json similarity index 100% rename from common/kafka/message/FindCoordinatorRequest.json rename to hstream-kafka/message/FindCoordinatorRequest.json diff --git a/common/kafka/message/FindCoordinatorResponse.json b/hstream-kafka/message/FindCoordinatorResponse.json similarity index 100% rename from common/kafka/message/FindCoordinatorResponse.json rename to hstream-kafka/message/FindCoordinatorResponse.json diff --git a/common/kafka/message/HeartbeatRequest.json b/hstream-kafka/message/HeartbeatRequest.json similarity index 100% rename from common/kafka/message/HeartbeatRequest.json rename to hstream-kafka/message/HeartbeatRequest.json diff --git a/common/kafka/message/HeartbeatResponse.json b/hstream-kafka/message/HeartbeatResponse.json similarity index 100% rename from common/kafka/message/HeartbeatResponse.json rename to hstream-kafka/message/HeartbeatResponse.json diff --git a/common/kafka/message/JoinGroupRequest.json b/hstream-kafka/message/JoinGroupRequest.json similarity index 100% rename from common/kafka/message/JoinGroupRequest.json rename to hstream-kafka/message/JoinGroupRequest.json diff --git a/common/kafka/message/JoinGroupResponse.json b/hstream-kafka/message/JoinGroupResponse.json similarity index 100% rename from common/kafka/message/JoinGroupResponse.json rename to hstream-kafka/message/JoinGroupResponse.json diff --git a/common/kafka/message/LeaveGroupRequest.json b/hstream-kafka/message/LeaveGroupRequest.json similarity index 100% rename from common/kafka/message/LeaveGroupRequest.json rename to hstream-kafka/message/LeaveGroupRequest.json diff --git a/common/kafka/message/LeaveGroupResponse.json b/hstream-kafka/message/LeaveGroupResponse.json similarity index 100% rename from common/kafka/message/LeaveGroupResponse.json rename to hstream-kafka/message/LeaveGroupResponse.json diff --git a/common/kafka/message/ListGroupsRequest.json b/hstream-kafka/message/ListGroupsRequest.json similarity index 100% rename from common/kafka/message/ListGroupsRequest.json rename to hstream-kafka/message/ListGroupsRequest.json diff --git a/common/kafka/message/ListGroupsResponse.json b/hstream-kafka/message/ListGroupsResponse.json similarity index 100% rename from common/kafka/message/ListGroupsResponse.json rename to hstream-kafka/message/ListGroupsResponse.json diff --git a/common/kafka/message/ListOffsetsRequest.json b/hstream-kafka/message/ListOffsetsRequest.json similarity index 100% rename from common/kafka/message/ListOffsetsRequest.json rename to hstream-kafka/message/ListOffsetsRequest.json diff --git a/common/kafka/message/ListOffsetsResponse.json b/hstream-kafka/message/ListOffsetsResponse.json similarity index 100% rename from common/kafka/message/ListOffsetsResponse.json rename to hstream-kafka/message/ListOffsetsResponse.json diff --git a/common/kafka/message/MetadataRequest.json b/hstream-kafka/message/MetadataRequest.json similarity index 100% rename from common/kafka/message/MetadataRequest.json rename to hstream-kafka/message/MetadataRequest.json diff --git a/common/kafka/message/MetadataResponse.json b/hstream-kafka/message/MetadataResponse.json similarity index 100% rename from common/kafka/message/MetadataResponse.json rename to hstream-kafka/message/MetadataResponse.json diff --git a/common/kafka/message/OffsetCommitRequest.json b/hstream-kafka/message/OffsetCommitRequest.json similarity index 100% rename from common/kafka/message/OffsetCommitRequest.json rename to hstream-kafka/message/OffsetCommitRequest.json diff --git a/common/kafka/message/OffsetCommitResponse.json b/hstream-kafka/message/OffsetCommitResponse.json similarity index 100% rename from common/kafka/message/OffsetCommitResponse.json rename to hstream-kafka/message/OffsetCommitResponse.json diff --git a/common/kafka/message/OffsetFetchRequest.json b/hstream-kafka/message/OffsetFetchRequest.json similarity index 100% rename from common/kafka/message/OffsetFetchRequest.json rename to hstream-kafka/message/OffsetFetchRequest.json diff --git a/common/kafka/message/OffsetFetchResponse.json b/hstream-kafka/message/OffsetFetchResponse.json similarity index 100% rename from common/kafka/message/OffsetFetchResponse.json rename to hstream-kafka/message/OffsetFetchResponse.json diff --git a/common/kafka/message/ProduceRequest.json b/hstream-kafka/message/ProduceRequest.json similarity index 100% rename from common/kafka/message/ProduceRequest.json rename to hstream-kafka/message/ProduceRequest.json diff --git a/common/kafka/message/ProduceResponse.json b/hstream-kafka/message/ProduceResponse.json similarity index 100% rename from common/kafka/message/ProduceResponse.json rename to hstream-kafka/message/ProduceResponse.json diff --git a/common/kafka/message/README.md b/hstream-kafka/message/README.md similarity index 100% rename from common/kafka/message/README.md rename to hstream-kafka/message/README.md diff --git a/common/kafka/message/SyncGroupRequest.json b/hstream-kafka/message/SyncGroupRequest.json similarity index 100% rename from common/kafka/message/SyncGroupRequest.json rename to hstream-kafka/message/SyncGroupRequest.json diff --git a/common/kafka/message/SyncGroupResponse.json b/hstream-kafka/message/SyncGroupResponse.json similarity index 100% rename from common/kafka/message/SyncGroupResponse.json rename to hstream-kafka/message/SyncGroupResponse.json diff --git a/common/kafka/src/Kafka/Common/OffsetManager.hs b/hstream-kafka/src/Kafka/Common/OffsetManager.hs similarity index 100% rename from common/kafka/src/Kafka/Common/OffsetManager.hs rename to hstream-kafka/src/Kafka/Common/OffsetManager.hs diff --git a/common/kafka/src/Kafka/Common/RecordFormat.hs b/hstream-kafka/src/Kafka/Common/RecordFormat.hs similarity index 100% rename from common/kafka/src/Kafka/Common/RecordFormat.hs rename to hstream-kafka/src/Kafka/Common/RecordFormat.hs diff --git a/common/kafka/src/Kafka/Protocol.hs b/hstream-kafka/src/Kafka/Protocol.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol.hs rename to hstream-kafka/src/Kafka/Protocol.hs diff --git a/common/kafka/src/Kafka/Protocol/Encoding.hs b/hstream-kafka/src/Kafka/Protocol/Encoding.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Encoding.hs rename to hstream-kafka/src/Kafka/Protocol/Encoding.hs diff --git a/common/kafka/src/Kafka/Protocol/Encoding/Encode.hs b/hstream-kafka/src/Kafka/Protocol/Encoding/Encode.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Encoding/Encode.hs rename to hstream-kafka/src/Kafka/Protocol/Encoding/Encode.hs diff --git a/common/kafka/src/Kafka/Protocol/Encoding/Internal.hs b/hstream-kafka/src/Kafka/Protocol/Encoding/Internal.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Encoding/Internal.hs rename to hstream-kafka/src/Kafka/Protocol/Encoding/Internal.hs diff --git a/common/kafka/src/Kafka/Protocol/Encoding/Parser.hs b/hstream-kafka/src/Kafka/Protocol/Encoding/Parser.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Encoding/Parser.hs rename to hstream-kafka/src/Kafka/Protocol/Encoding/Parser.hs diff --git a/common/kafka/src/Kafka/Protocol/Error.hs b/hstream-kafka/src/Kafka/Protocol/Error.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Error.hs rename to hstream-kafka/src/Kafka/Protocol/Error.hs diff --git a/common/kafka/src/Kafka/Protocol/Message.hs b/hstream-kafka/src/Kafka/Protocol/Message.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Message.hs rename to hstream-kafka/src/Kafka/Protocol/Message.hs diff --git a/common/kafka/src/Kafka/Protocol/Message/Struct.hs b/hstream-kafka/src/Kafka/Protocol/Message/Struct.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Message/Struct.hs rename to hstream-kafka/src/Kafka/Protocol/Message/Struct.hs diff --git a/common/kafka/src/Kafka/Protocol/Service.hs b/hstream-kafka/src/Kafka/Protocol/Service.hs similarity index 100% rename from common/kafka/src/Kafka/Protocol/Service.hs rename to hstream-kafka/src/Kafka/Protocol/Service.hs diff --git a/common/kafka/src/Kafka/Server.hs b/hstream-kafka/src/Kafka/Server.hs similarity index 100% rename from common/kafka/src/Kafka/Server.hs rename to hstream-kafka/src/Kafka/Server.hs diff --git a/common/kafka/test/Kafka/Protocol/EncodingSpec.hs b/hstream-kafka/test/Kafka/Protocol/EncodingSpec.hs similarity index 100% rename from common/kafka/test/Kafka/Protocol/EncodingSpec.hs rename to hstream-kafka/test/Kafka/Protocol/EncodingSpec.hs diff --git a/common/kafka/test/Kafka/QuickCheck/Instances.hs b/hstream-kafka/test/Kafka/QuickCheck/Instances.hs similarity index 100% rename from common/kafka/test/Kafka/QuickCheck/Instances.hs rename to hstream-kafka/test/Kafka/QuickCheck/Instances.hs diff --git a/common/kafka/test/Spec.hs b/hstream-kafka/test/Spec.hs similarity index 100% rename from common/kafka/test/Spec.hs rename to hstream-kafka/test/Spec.hs diff --git a/script/kafka_gen.py b/script/kafka_gen.py index 8f7a572e1..5107e733a 100755 --- a/script/kafka_gen.py +++ b/script/kafka_gen.py @@ -541,7 +541,7 @@ def cli_get_json(path): "Path can be both directory and file, a directory mean parse all " "*.json files under it. (Default: %(default)s)" ), - default="./common/kafka/message", + default="./hstream-kafka/message", dest="files", ) # TODO: since python3.9 there is BooleanOptionalAction available in argparse From fe3ef0c6533dbb99095a3af87c8afa2afde5aa1f Mon Sep 17 00:00:00 2001 From: mu <59917266+4eUeP@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:38:26 +0800 Subject: [PATCH 2/3] make Kafka.Protocol.Message.Struct private --- hstream-kafka/hstream-kafka.cabal | 2 +- hstream-kafka/src/Kafka/Protocol/Message.hs | 2 ++ hstream/src/HStream/Server/KafkaHandler.hs | 2 +- .../src/HStream/Server/KafkaHandler/Basic.hs | 34 +++++++++---------- .../src/HStream/Server/KafkaHandler/Topic.hs | 30 ++++++++-------- 5 files changed, 36 insertions(+), 34 deletions(-) diff --git a/hstream-kafka/hstream-kafka.cabal b/hstream-kafka/hstream-kafka.cabal index 988db0c64..083b9dae9 100644 --- a/hstream-kafka/hstream-kafka.cabal +++ b/hstream-kafka/hstream-kafka.cabal @@ -49,7 +49,6 @@ library Kafka.Protocol.Encoding Kafka.Protocol.Error Kafka.Protocol.Message - Kafka.Protocol.Message.Struct Kafka.Protocol.Service Kafka.Server @@ -57,6 +56,7 @@ library Kafka.Protocol.Encoding.Encode Kafka.Protocol.Encoding.Internal Kafka.Protocol.Encoding.Parser + Kafka.Protocol.Message.Struct hs-source-dirs: src build-tool-depends: hpp:hpp >=0.6 && <0.7 diff --git a/hstream-kafka/src/Kafka/Protocol/Message.hs b/hstream-kafka/src/Kafka/Protocol/Message.hs index e7ae7eae8..0bf9913be 100644 --- a/hstream-kafka/src/Kafka/Protocol/Message.hs +++ b/hstream-kafka/src/Kafka/Protocol/Message.hs @@ -1,6 +1,8 @@ module Kafka.Protocol.Message ( RequestHeader (..) , ResponseHeader (..) + + , module Kafka.Protocol.Message.Struct ) where import Data.Int diff --git a/hstream/src/HStream/Server/KafkaHandler.hs b/hstream/src/HStream/Server/KafkaHandler.hs index a2144020d..967bab558 100644 --- a/hstream/src/HStream/Server/KafkaHandler.hs +++ b/hstream/src/HStream/Server/KafkaHandler.hs @@ -6,7 +6,7 @@ module HStream.Server.KafkaHandler (handlers) where import HStream.Server.KafkaHandler.Basic import HStream.Server.KafkaHandler.Topic import HStream.Server.Types (ServerContext (..)) -import qualified Kafka.Protocol.Message.Struct as K +import qualified Kafka.Protocol.Message as K import qualified Kafka.Protocol.Service as K handlers :: ServerContext -> [K.ServiceHandler] diff --git a/hstream/src/HStream/Server/KafkaHandler/Basic.hs b/hstream/src/HStream/Server/KafkaHandler/Basic.hs index 8993f690c..73cb25c65 100644 --- a/hstream/src/HStream/Server/KafkaHandler/Basic.hs +++ b/hstream/src/HStream/Server/KafkaHandler/Basic.hs @@ -8,26 +8,26 @@ module HStream.Server.KafkaHandler.Basic , handleMetadataV1 ) where -import Control.Concurrent.STM (readTVarIO) +import Control.Concurrent.STM (readTVarIO) import Control.Exception import Control.Monad -import Data.Functor ((<&>)) -import Data.Int (Int32) -import Data.Text (Text) -import qualified Data.Text as Text -import qualified Data.Vector as V +import Data.Functor ((<&>)) +import Data.Int (Int32) +import Data.Text (Text) +import qualified Data.Text as Text +import qualified Data.Vector as V -import qualified HStream.Logger as Log -import qualified HStream.Server.Core.Cluster as Core -import qualified HStream.Server.Core.Common as Core -import qualified HStream.Server.HStreamApi as GRPC -import HStream.Server.Types (ServerContext (..), - transToStreamName) -import qualified HStream.Store as S -import qualified HStream.Utils as Utils -import qualified Kafka.Protocol.Error as K -import qualified Kafka.Protocol.Message.Struct as K -import qualified Kafka.Protocol.Service as K +import qualified HStream.Logger as Log +import qualified HStream.Server.Core.Cluster as Core +import qualified HStream.Server.Core.Common as Core +import qualified HStream.Server.HStreamApi as GRPC +import HStream.Server.Types (ServerContext (..), + transToStreamName) +import qualified HStream.Store as S +import qualified HStream.Utils as Utils +import qualified Kafka.Protocol.Error as K +import qualified Kafka.Protocol.Message as K +import qualified Kafka.Protocol.Service as K -------------------- -- 18: ApiVersions diff --git a/hstream/src/HStream/Server/KafkaHandler/Topic.hs b/hstream/src/HStream/Server/KafkaHandler/Topic.hs index e6c17b394..44db214c1 100644 --- a/hstream/src/HStream/Server/KafkaHandler/Topic.hs +++ b/hstream/src/HStream/Server/KafkaHandler/Topic.hs @@ -11,24 +11,24 @@ module HStream.Server.KafkaHandler.Topic import Control.Exception import Control.Monad -import qualified Data.Map.Strict as M +import qualified Data.Map.Strict as M import Data.Maybe -import qualified Data.Text as T -import qualified Data.Vector as V +import qualified Data.Text as T +import qualified Data.Vector as V -import qualified HStream.Base.Time as BaseTime -import qualified HStream.Common.Types as CommonTypes -import qualified HStream.Logger as Log -import qualified HStream.Server.MetaData as P -import qualified HStream.Server.Shard as Shard -import qualified HStream.Server.Types as HsTypes -import qualified HStream.Stats as Stats -import qualified HStream.Store as S -import qualified HStream.Utils as Utils +import qualified HStream.Base.Time as BaseTime +import qualified HStream.Common.Types as CommonTypes +import qualified HStream.Logger as Log +import qualified HStream.Server.MetaData as P +import qualified HStream.Server.Shard as Shard +import qualified HStream.Server.Types as HsTypes +import qualified HStream.Stats as Stats +import qualified HStream.Store as S +import qualified HStream.Utils as Utils -import qualified Kafka.Protocol.Error as K -import qualified Kafka.Protocol.Message.Struct as K -import qualified Kafka.Protocol.Service as K +import qualified Kafka.Protocol.Error as K +import qualified Kafka.Protocol.Message as K +import qualified Kafka.Protocol.Service as K -------------------- -- 19: CreateTopics From f43f05f7cc50a947320332f88a49d98e3597dd54 Mon Sep 17 00:00:00 2001 From: mu <59917266+4eUeP@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:41:00 +0800 Subject: [PATCH 3/3] generate hie.yaml by gen-hie --- hie.yaml | 317 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 160 insertions(+), 157 deletions(-) diff --git a/hie.yaml b/hie.yaml index 609fa67fb..e1be36f7a 100644 --- a/hie.yaml +++ b/hie.yaml @@ -1,17 +1,41 @@ cradle: cabal: - - path: "common/hstream/." - component: "lib:hstream-common" + - path: "clients/cpp/." + component: "lib:hstream-client-cpp" - - path: "common/base/." - component: "lib:hstream-common-base" + - path: "common/api/cpp/." + component: "lib:hstream-api-cpp" - path: "common/api/." component: "lib:hstream-api-hs" - - path: "common/hstream/test/." + - path: "common/api/gen-hs" + component: "lib:hstream-api-hs" + + - path: "common/base/." + component: "lib:hstream-common-base" + + - path: "common/base/test" + component: "hstream-common-base:test:hstream-common-base-test" + + - path: "common/hstream/." + component: "lib:hstream-common" + + - path: "common/hstream/test" component: "hstream-common:test:hstream-common-test" + - path: "common/hstream/bench/Bench.hs" + component: "hstream-common:bench:codec-bench" + + - path: "common/hstream/bench/CodecBench.hs" + component: "hstream-common:bench:codec-bench" + + - path: "common/hstream/bench/CompresstionBench.hs" + component: "hstream-common:bench:codec-bench" + + - path: "common/hstream/bench/Util.hs" + component: "hstream-common:bench:codec-bench" + - path: "common/stats/." component: "lib:hstream-common-stats" @@ -21,9 +45,6 @@ cradle: - path: "common/stats/bench/stats.hs" component: "hstream-common-stats:bench:common-bench-stats" - - path: "common/hstream/bench" - component: "hstream-common:bench:codec-bench" - - path: "external/gRPC-haskell/core/src" component: "lib:grpc-haskell-core" @@ -69,179 +90,134 @@ cradle: - path: "external/gRPC-haskell/bench/Bench.hs" component: "grpc-haskell:bench:bench" - - path: "external/hsthrift/common/github/./" - component: "lib:fb-stubs" - - - path: "external/hsthrift/common/mangle/./" - component: "lib:mangle" - - - path: "external/hsthrift/common/mangle/./Main.hs" - component: "mangle:exe:mangle" - - - path: "external/hsthrift/common/mangle/./Mangle.hs" - component: "mangle:exe:mangle" + - path: "external/haskell-rocksdb-bindings/src" + component: "lib:rocksdb-haskell-bindings" - - path: "external/hsthrift/common/mangle/tests" - component: "mangle:test:mangle-test" + - path: "external/haskell-rocksdb-bindings/test" + component: "rocksdb-haskell-bindings:test:rocksdb-haskell-bindings-test" - - path: "external/hsthrift/common/mangle/tests/github" - component: "mangle:test:mangle-test" + - path: "external/hs-grpc/hs-grpc-server/." + component: "lib:hs-grpc-server" - - path: "external/hsthrift/common/util/." - component: "lib:fb-util" + - path: "external/hs-grpc/hs-grpc-server/test" + component: "hs-grpc-server:test:hs-grpc-server-test" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:stream" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:movavgrl" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:rlmap" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:iobuf" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:alloc-limit" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:unit-tests" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:rwvar" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:th" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:filepath" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:optparse" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:lens" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:toexp" - - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:aeson" + - path: "external/proto3-suite/src/swagger-wrapper-format" + component: "lib:proto3-suite" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:buffer" + - path: "external/proto3-suite/src/no-swagger-wrapper-format" + component: "lib:proto3-suite" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:exception" + - path: "external/proto3-suite/src" + component: "lib:proto3-suite" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:control-exception" + - path: "external/proto3-suite/gen" + component: "proto3-suite:test:tests" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:json-pretty" + - path: "external/proto3-suite/tests" + component: "proto3-suite:test:tests" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:io" + - path: "external/proto3-suite/tools/compile-proto-file/Main.hs" + component: "proto3-suite:exe:compile-proto-file_hstream" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:time-sec" + - path: "external/proto3-suite/tools/canonicalize-proto-file/Main.hs" + component: "proto3-suite:exe:canonicalize-proto-file_hstream" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:list" + - path: "external/proto3-wire/src" + component: "lib:proto3-wire" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:graph" + - path: "external/proto3-wire/test" + component: "proto3-wire:test:tests" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:concurrent" + - path: "external/proto3-wire/bench/Main.hs" + component: "proto3-wire:bench:bench" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:md5" + - path: "external/table-layout/src" + component: "lib:table-layout" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:control-monad" + - path: "external/table-layout/src/Test.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:string-quasi" + - path: "external/table-layout/src/Text/Layout/Table.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:dynamic" + - path: "external/table-layout/src/Text/Layout/Table/Cell.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/common/util/./" - component: "fb-util:test:hs-struct" + - path: "external/table-layout/src/Text/Layout/Table/Cell/Formatted.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/cpp-channel/." - component: "lib:thrift-cpp-channel" + - path: "external/table-layout/src/Text/Layout/Table/Cell/WideString.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/cpp-channel/test" - component: "thrift-cpp-channel:test:header-channel" + - path: "external/table-layout/src/Text/Layout/Table/Justify.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/cpp-channel/test/if/gen-hs2" - component: "thrift-cpp-channel:test:header-channel" + - path: "external/table-layout/src/Text/Layout/Table/LineStyle.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/." - component: "lib:thrift-lib" + - path: "external/table-layout/src/Text/Layout/Table/Style.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/gen-hs2" - component: "lib:thrift-lib" + - path: "external/table-layout/src/Text/Layout/Table/Vertical.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/test/helpers" - component: "thrift-lib:lib:test-helpers" + - path: "external/table-layout/src/Text/Layout/Table/Primitives/AlignInfo.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/test/lib" - component: "thrift-lib:lib:test-lib" + - path: "external/table-layout/src/Text/Layout/Table/Primitives/Basic.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/test/gen-hs2" - component: "thrift-lib:lib:test-lib" + - path: "external/table-layout/src/Text/Layout/Table/Primitives/ColumnModifier.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:channel" + - path: "external/table-layout/src/Text/Layout/Table/Primitives/Header.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:socket-channel" + - path: "external/table-layout/src/Text/Layout/Table/Primitives/Table.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:client" + - path: "external/table-layout/src/Text/Layout/Table/StringBuilder.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:binary-parser" + - path: "external/table-layout/src/Text/Layout/Table/Spec/AlignSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:json-parsing" + - path: "external/table-layout/src/Text/Layout/Table/Spec/ColSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:json-num" + - path: "external/table-layout/src/Text/Layout/Table/Spec/CutMark.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/hsthrift/lib/./" - component: "thrift-lib:test:json-null" + - path: "external/table-layout/src/Text/Layout/Table/Spec/HeaderColSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/src/swagger-wrapper-format" - component: "lib:proto3-suite" + - path: "external/table-layout/src/Text/Layout/Table/Spec/HeaderSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/src/no-swagger-wrapper-format" - component: "lib:proto3-suite" + - path: "external/table-layout/src/Text/Layout/Table/Spec/LenSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/src" - component: "lib:proto3-suite" + - path: "external/table-layout/src/Text/Layout/Table/Spec/OccSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/gen" - component: "proto3-suite:test:tests" + - path: "external/table-layout/src/Text/Layout/Table/Spec/Position.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/tests" - component: "proto3-suite:test:tests" + - path: "external/table-layout/src/Text/Layout/Table/Spec/RowGroup.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/tools/compile-proto-file/Main.hs" - component: "proto3-suite:exe:compile-proto-file_hstream" + - path: "external/table-layout/src/Text/Layout/Table/Spec/TableSpec.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-suite/tools/canonicalize-proto-file/Main.hs" - component: "proto3-suite:exe:canonicalize-proto-file_hstream" + - path: "external/table-layout/src/Text/Layout/Table/Spec/Util.hs" + component: "table-layout:exe:table-layout-test-styles" - - path: "external/proto3-wire/src" - component: "lib:proto3-wire" + - path: "external/table-layout/test-suite" + component: "table-layout:test:table-layout-tests" - - path: "external/proto3-wire/test" - component: "proto3-wire:test:tests" + - path: "external/table-layout/src" + component: "table-layout:test:table-layout-tests" - path: "hstream/src" component: "lib:hstream" @@ -258,15 +234,9 @@ cradle: - path: "hstream-admin/app/admin.hs" component: "hstream-admin:exe:hadmin" - - path: "hstream-admin/server" + - path: "hstream-admin/server/." component: "lib:hstream-admin-server" - - path: "hstream-admin/store" - component: "lib:hstream-admin-store" - - - path: "hstream-io/./" - component: "lib:hstream-io" - - path: "hstream-diffflow/src" component: "lib:diff-flow" @@ -288,8 +258,29 @@ cradle: - path: "hstream-diffflow/./bench/benchmark.hs" component: "diff-flow:bench:lib-bench" - - path: "hstream-diffflow/./bench/throughout.hs" - component: "diff-flow:exe:throughout-bench" + - path: "hstream-diffflow/./bench/throughout-reduce.hs" + component: "diff-flow:exe:throughout-bench-reduce" + + - path: "hstream-diffflow/./bench/throughout-join.hs" + component: "diff-flow:exe:throughout-bench-join" + + - path: "hstream-diffflow/./bench/throughout-map.hs" + component: "diff-flow:exe:throughout-bench-map" + + - path: "hstream-gossip/src" + component: "lib:hstream-gossip" + + - path: "hstream-io/./" + component: "lib:hstream-io" + + - path: "hstream-kafka/src" + component: "lib:hstream-kafka" + + - path: "hstream-kafka/test" + component: "hstream-kafka:test:hstream-kafka-test" + + - path: "hstream-processing/src" + component: "lib:hstream-processing" - path: "hstream-sql/src" component: "lib:hstream-sql" @@ -297,10 +288,22 @@ cradle: - path: "hstream-sql/gen-sql" component: "lib:hstream-sql" - - path: "hstream-sql/test" - component: "hstream-sql:test:hstream-sql-test" + - path: "hstream-sql/app" + component: "lib:hstream-sql" + + - path: "hstream-sql/app/SyntaxTestRunner.hs" + component: "hstream-sql:exe:syntax-test-runner" + + - path: "hstream-sql/app/Lib.hs" + component: "hstream-sql:exe:syntax-test-runner" + + - path: "hstream-sql/app/PlanTestRunner.hs" + component: "hstream-sql:exe:plan-test-runner" - - path: "hstream-store/." + - path: "hstream-sql/app/Lib.hs" + component: "hstream-sql:exe:plan-test-runner" + + - path: "hstream-store/./" component: "lib:hstream-store" - path: "hstream-store/test" @@ -312,11 +315,11 @@ cradle: - path: "hstream-store/bench/AppendBatchBench.hs" component: "hstream-store:bench:hstore-bench-append-batch" - - path: "hstream-store/app/writeBench.hs" - component: "hstream-store:exe:hstore-bench-writter" + - path: "hstream-store/bench/StreamBench.hs" + component: "hstream-store:bench:hstore-bench-stream" - - path: "hstream-gossip/src" - component: "lib:hstream-gossip" + - path: "hstream-store/bench/LogExtraAttrs.hs" + component: "hstream-store:bench:hstore-bench-log-extra-attrs" - - path: "hstream-processing/src" - component: "lib:hstream-processing" + - path: "hstream-store/app/writeBench.hs" + component: "hstream-store:exe:hstore-bench-writter"