-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to kafka: initial changes, a separate service
Signed-off-by: Laszlo Bende <[email protected]>
- Loading branch information
Showing
4 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...src/main/scala/com/mwam/kafkakewl/deploy/services/TopologyDeploymentsToKafkaService.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Marshall Wace <[email protected]> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.mwam.kafkakewl.deploy.services | ||
|
||
import com.mwam.kafkakewl.domain.{Deployments, DeploymentsSuccess, TopologyDeploymentStatus} | ||
import zio.* | ||
|
||
class TopologyDeploymentsToKafkaService { | ||
def deploy(deployments: Deployments): Task[DeploymentsSuccess] = { | ||
ZIO.succeed { | ||
// For now we just return empty statuses for all deploy/delete topologies | ||
DeploymentsSuccess( | ||
deployments.deploy.map(topology => (topology.id, TopologyDeploymentStatus())).toMap ++ | ||
deployments.delete.map(tid => (tid, TopologyDeploymentStatus())).toMap | ||
) | ||
} | ||
} | ||
} | ||
|
||
object TopologyDeploymentsToKafkaService { | ||
def live: ZLayer[Any, Nothing, TopologyDeploymentsToKafkaService] = | ||
// TODO proper dependencies, etc... | ||
ZLayer.succeed { | ||
TopologyDeploymentsToKafkaService() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters