Skip to content

Commit

Permalink
fix read config from path. We were mixing config path with zookeeper …
Browse files Browse the repository at this point in the history
…path

fix lockpath and add repository visibility
  • Loading branch information
pmadrigal authored and pfcoperez committed Mar 10, 2017
1 parent c47eecf commit 21e4b6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ trait ZookeeperRepositoryComponent extends RepositoryComponent[String, Array[Byt
)

def getZookeeperConfig: Config = {
config.getConfig(path.getOrElse(ConfigZookeeper))
config.getConfig(ConfigZookeeper)
.getOrElse(throw new ZookeeperRepositoryException(s"Zookeeper config not found"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ trait ZookeeperRepositoryWithTransactionsComponent extends ZookeeperRepositoryCo

self: ConfigComponent with LoggerComponent =>

override val repository: ZookeeperRepositoryWithTransactions = new ZookeeperRepositoryWithTransactions(None)

class ZookeeperRepositoryWithTransactions(path: Option[String] = None) extends ZookeeperRepository(path)
with TransactionalRepository {

Expand Down Expand Up @@ -70,7 +72,7 @@ trait ZookeeperRepositoryWithTransactionsComponent extends ZookeeperRepositoryCo
}

private def lockPath(entity: String)(resource: TransactionResource): String = {
s"$entity/locks"
s"$entity/locks/${resource.id}"
}

override def atomically[T](
Expand Down

0 comments on commit 21e4b6f

Please sign in to comment.