Skip to content

Commit

Permalink
finagle-core: Add a deny list to LoadService
Browse files Browse the repository at this point in the history
Motivation

`c.t.f.util.LoadService` puts users at the mercy of their transitive
dependencies as to what implementation gets loaded. This is simple but
can be difficult for users to manage and control.

Solution

Introduce a global flag that is a deny list for implementations.
For a given LoadService interface, if the implementation is found in the
deny list, it will not be loaded.

  -com.twitter.finagle.util.loadServiceDenied=com.twitter.finagle.stats.OstrichStatsReceiver,com.twitter.finagle.stats.CommonsStatsReceiver

Result

Users have more control over the loaded implemetation when needed.

RB_ID=748750
TBR=true
  • Loading branch information
kevinoliver authored and jenkins committed Oct 5, 2015
1 parent f2a6ff2 commit fb2018b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions util-app/src/test/scala/com/twitter/app/FlagTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ class FlagTest extends FunSuite {
}

test("Flaggable: parse maps with comma-separated values") {
assert(Flaggable.ofMap[String, Seq[Int]].parse("a=1,2,3,b=4,5") ===
Map("a" -> Seq(1,2,3), "b" -> Seq(4,5)))
assert(Flaggable.ofMap[String, Seq[Int]].parse("a=1,2,3,3,b=4,5") ===
Map("a" -> Seq(1,2,3,3), "b" -> Seq(4,5)))
}

test("Flaggable: parse maps of sets with comma-separated values") {
assert(Flaggable.ofMap[String, Set[Int]].parse("a=1,2,3,3,b=4,5") ===
Map("a" -> Set(1,2,3), "b" -> Set(4,5)))
}

test("Flaggable: parse tuples") {
Expand Down

0 comments on commit fb2018b

Please sign in to comment.