Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5
    • Component/s: lang.concurrent.*
    • Labels:
      None

      Description

      A circuit breaker is a useful component to protect an application against unreliable services or load peaks. A simple implementation could be a good fit for the concurrent package.

      A proposed implementation is attached. Feedback is welcome!

      1. CircuitBreaker.java
        25 kB
        Oliver Heger
      2. CircuitBreakerTest.java
        15 kB
        Oliver Heger

        Issue Links

          Activity

          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          New CircuitBreaker class with test class.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - New CircuitBreaker class with test class.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Oliver! Looks interesing. ElasticSearch has a circuit breaker to prevent the server from serving datasets too large, but I never looked at the code that handles it.

          I'll toy around with your circuit breaker during this weekend

          Thanks!
          Bruno

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Oliver! Looks interesing. ElasticSearch has a circuit breaker to prevent the server from serving datasets too large, but I never looked at the code that handles it. I'll toy around with your circuit breaker during this weekend Thanks! Bruno
          Hide
          britter Benedikt Ritter added a comment -

          Very nice! I'll need some time to have a look at it.

          Show
          britter Benedikt Ritter added a comment - Very nice! I'll need some time to have a look at it.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi again Oliver!

          The code looks really neat, including the tests! Kudos! I read Martin Fowler's article and your implementation, and looks like you followed his example. IIUC, the circuit trips only when you've reached the threshold of incidents over a certain period of time.

          I'd like to explore the CircuitBreaker design a bit more, to make it more generic. I'm not sure if I could implement a Memory Circuit Breaker as this one using the existing patch.

          Maybe the existing circuit breaker in the patch could become a TimeCircuitBreaker , a common interface extracted from it, and this way we could add more circuit breakers (memory, open/closed resources/quantity of connections open, etc)? The existing patch looks really nice, just food for thought

          Have a nice weekend,
          Bruno

          Show
          kinow Bruno P. Kinoshita added a comment - Hi again Oliver! The code looks really neat, including the tests! Kudos! I read Martin Fowler's article and your implementation, and looks like you followed his example. IIUC, the circuit trips only when you've reached the threshold of incidents over a certain period of time. I'd like to explore the CircuitBreaker design a bit more, to make it more generic. I'm not sure if I could implement a Memory Circuit Breaker as this one using the existing patch. Maybe the existing circuit breaker in the patch could become a TimeCircuitBreaker , a common interface extracted from it, and this way we could add more circuit breakers (memory, open/closed resources/quantity of connections open, etc)? The existing patch looks really nice, just food for thought Have a nice weekend, Bruno
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Oh, BTW, Java 8 became quite strict with Javadocs. Looks like there are some <p> tags that should be updated to avoid build errors with Java 8, and a trivial PMD warning. Code coverage is impressive!

          Show
          kinow Bruno P. Kinoshita added a comment - Oh, BTW, Java 8 became quite strict with Javadocs. Looks like there are some <p> tags that should be updated to avoid build errors with Java 8, and a trivial PMD warning. Code coverage is impressive!
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno,

          many thanks for your comments!

          I like your idea to have several circuit breaker implementations for different special purposes. If it was possible to use a common interface, the better. I guess such an interface would have methods like open(), close(), isOpen(), isClosed(), checkState(), incrementAndCheckState(). Do you think this is sufficient, or would we need some more to make this more generic (maybe rather than an increment by one, a generic add would be needed?)?

          In this respect, renaming the class to TimeCircuitBreaker would be fine with me.

          Regarding Java8 Javadoc compatibility: I have to confess that I did not check this; so there might be problems.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno, many thanks for your comments! I like your idea to have several circuit breaker implementations for different special purposes. If it was possible to use a common interface, the better. I guess such an interface would have methods like open() , close() , isOpen() , isClosed() , checkState() , incrementAndCheckState() . Do you think this is sufficient, or would we need some more to make this more generic (maybe rather than an increment by one, a generic add would be needed?)? In this respect, renaming the class to TimeCircuitBreaker would be fine with me. Regarding Java8 Javadoc compatibility: I have to confess that I did not check this; so there might be problems.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          > Do you think this is sufficient, or would we need some more to make this more generic (maybe rather than an increment by one, a generic add would be needed?)?

          I think it is worth exploring several design ideas. We could try to extract this common interface with the methods you suggested and implement some circuit breakers in order to validate its design. Let's give some time first to Benedikt and others to have a look at it too.

          Show
          kinow Bruno P. Kinoshita added a comment - > Do you think this is sufficient, or would we need some more to make this more generic (maybe rather than an increment by one, a generic add would be needed?)? I think it is worth exploring several design ideas. We could try to extract this common interface with the methods you suggested and implement some circuit breakers in order to validate its design. Let's give some time first to Benedikt and others to have a look at it too.
          Hide
          kinow Bruno P. Kinoshita added a comment - - edited

          Hello again Oliver!

          Had a look again at the patch today, and I really think making the CircuitBreaker more generic would be a good idea. My goal is to use your CircuitBreaker to create a MemoryCircuitBreaker, as in ElasticSearch. The MemoryCircuitBreaker doesn't need to be reset after a period of time, so it wouldn't fit into the current design of the CircuitBreaker contract.

          What do you think of the follow plan:

          • Create the following class hierarchy
                             +--------------+                   
                             |CircuitBreaker|                   
                             +------+-------+                   
                                    ^                           
                                    |                           
                                    |                           
                                    |                           
                                    |                           
                         +----------+------------+              
                         | AbstractCircuitBreaker|              
                         +----------+------------+              
                                    ^                           
                                    |                           
                                    |                           
                    +---------------+----------------+          
                    |                                |          
                    |                                |          
          +---------+---------+            ----------+---------+
          |TimedCircuitBreaker|           |MemoryCircuitBreaker|
          +-------------------+           +--------------------+
          
          • Move the `AtomicReference`'s and the `PropertyChangeSupport` to the abstract circuit breaker
          • Move the `Timer`'s to the timed circuit breaker (there is another class [lang] with this prefix)
          • Extract a generic contract for the `CircuitBreaker` interface

          > I guess such an interface would have methods like open(), close(), isOpen(), isClosed(), checkState(), incrementAndCheckState()

          +1 Sounds like good methods for our initial tests

          Do you think that makes sense?

          Show
          kinow Bruno P. Kinoshita added a comment - - edited Hello again Oliver! Had a look again at the patch today, and I really think making the CircuitBreaker more generic would be a good idea. My goal is to use your CircuitBreaker to create a MemoryCircuitBreaker, as in ElasticSearch. The MemoryCircuitBreaker doesn't need to be reset after a period of time, so it wouldn't fit into the current design of the CircuitBreaker contract. What do you think of the follow plan: Create the following class hierarchy +--------------+ |CircuitBreaker| +------+-------+ ^ | | | | +----------+------------+ | AbstractCircuitBreaker| +----------+------------+ ^ | | +---------------+----------------+ | | | | +---------+---------+ ----------+---------+ |TimedCircuitBreaker| |MemoryCircuitBreaker| +-------------------+ +--------------------+ Move the `AtomicReference`'s and the `PropertyChangeSupport` to the abstract circuit breaker Move the `Timer`'s to the timed circuit breaker (there is another class [lang] with this prefix) Extract a generic contract for the `CircuitBreaker` interface > I guess such an interface would have methods like open(), close(), isOpen(), isClosed(), checkState(), incrementAndCheckState() +1 Sounds like good methods for our initial tests Do you think that makes sense?
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno,

          I like your plan. Just go ahead, I am looking forward to see your results!

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno, I like your plan. Just go ahead, I am looking forward to see your results!
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Oliver!

          Here's a tentative https://github.com/kinow/circuit-breaker.

          Besides the code, here's a list of some issues related to Circuit Breakers in ASF JIRA:

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Oliver! Here's a tentative https://github.com/kinow/circuit-breaker . Besides the code, here's a list of some issues related to Circuit Breakers in ASF JIRA: CAMEL-8584 SOLR-6930 TEZ-965 HBASE-9049
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno,

          I had a look at your code. Great stuff! It is especially good to see that you managed to use the basic circuit breaker interface for different use cases (memory usage and timing conditions). I think this is a proof of concept that the interface we came up with is sufficiently generic.

          Some remarks about details:

          • When I wrote my original implementation I had complex if-then-else cascades related to the current state of the circuit breaker. I could significantly simplify the code by refactoring logic out into the State enumeration class. As State is now more generic in your model, you had to move this logic out of the class, and volia - here the if-then-else blocks are again! Maybe we can work-around this by using strategy classes associated with the different states.
          • TimedCircuitBreaker is pretty straight-forward - which is a good thing. Does it make sense to have logic to close the circuit breaker automatically when memory usage is decreasing again?
          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno, I had a look at your code. Great stuff! It is especially good to see that you managed to use the basic circuit breaker interface for different use cases (memory usage and timing conditions). I think this is a proof of concept that the interface we came up with is sufficiently generic. Some remarks about details: When I wrote my original implementation I had complex if-then-else cascades related to the current state of the circuit breaker. I could significantly simplify the code by refactoring logic out into the State enumeration class. As State is now more generic in your model, you had to move this logic out of the class, and volia - here the if-then-else blocks are again! Maybe we can work-around this by using strategy classes associated with the different states. TimedCircuitBreaker is pretty straight-forward - which is a good thing. Does it make sense to have logic to close the circuit breaker automatically when memory usage is decreasing again?
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Oliver!

          > I think this is a proof of concept that the interface we came up with is sufficiently generic.

          Hopefully That's why I also linked some other issues in ASF JIRA. We can use them to test our design and see if it needs to be made more generic to fit other use cases.

          >Maybe we can work-around this by using strategy classes associated with the different states.

          +1 would you be able to use the existing code and enhance it with the strategy pattern? Feel free to clone, create a new repo/gists, or let me know if you'd like to get full access over that repo.

          >Does it make sense to have logic to close the circuit breaker automatically when memory usage is decreasing again?

          I thought about doing that too, but wasn't sure about it because the use case of ElasticSearch is a bit different. When you query ES, it looks at its existing circuit breakers to see if the result set is below some given threshold. If it is not, the circuit opens and the query fails (useful to avoid OutOfMemoryException, when well configured).

          So the circuit breaker is related to the query result set size, and not to the system memory usage in ES. Maybe we could add some way to have the memory circuit breaker to return to closed when usage is decreasing, or create a new implementation for that.

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Oliver! > I think this is a proof of concept that the interface we came up with is sufficiently generic. Hopefully That's why I also linked some other issues in ASF JIRA. We can use them to test our design and see if it needs to be made more generic to fit other use cases. >Maybe we can work-around this by using strategy classes associated with the different states. +1 would you be able to use the existing code and enhance it with the strategy pattern? Feel free to clone, create a new repo/gists, or let me know if you'd like to get full access over that repo. >Does it make sense to have logic to close the circuit breaker automatically when memory usage is decreasing again? I thought about doing that too, but wasn't sure about it because the use case of ElasticSearch is a bit different. When you query ES, it looks at its existing circuit breakers to see if the result set is below some given threshold. If it is not, the circuit opens and the query fails (useful to avoid OutOfMemoryException, when well configured). So the circuit breaker is related to the query result set size, and not to the system memory usage in ES. Maybe we could add some way to have the memory circuit breaker to return to closed when usage is decreasing, or create a new implementation for that.
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno!

          Okay, I will try to implement the strategy pattern, but as I am currently pretty busy, this might take some time (at least a week).

          Regarding the memory circuit breaker: I agree that we should start with a simple implementation. The self-closing feature would increase complexity considerably.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno! Okay, I will try to implement the strategy pattern, but as I am currently pretty busy, this might take some time (at least a week). Regarding the memory circuit breaker: I agree that we should start with a simple implementation. The self-closing feature would increase complexity considerably.
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno,

          a pull request for the refactoring with strategy classes was created against your repository.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno, a pull request for the refactoring with strategy classes was created against your repository.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Oliver!

          Thanks for the pull request. The timed circuit breaker has a few secondary classes, but I think that way it may be easier to understand the code, and avoid those redundant `if`'s. That way it might be easier to write tests too.

          I believe now we need to tidy up the code, update the docs (I didn't pay attention to comments, code, tabs, etc), and then either create a pull request to lang or attach a new patch. What way do you think it would be easier for us to work on it?

          Probably it would be better if the repo was yours, as the original patch was yours too

          Thank you!

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Oliver! Thanks for the pull request. The timed circuit breaker has a few secondary classes, but I think that way it may be easier to understand the code, and avoid those redundant `if`'s. That way it might be easier to write tests too. I believe now we need to tidy up the code, update the docs (I didn't pay attention to comments, code, tabs, etc), and then either create a pull request to lang or attach a new patch. What way do you think it would be easier for us to work on it? Probably it would be better if the repo was yours, as the original patch was yours too Thank you!
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno!

          Some polishing of the code is certainly necessary. We also have to change the package names. I hope that a great deal of comments can be reused from the original patch. Some more has to be written for the newer classes.

          Regarding repositories: I really don't mind whether my repository or yours or somebody else's is used The goal is to get the code into [lang].

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno! Some polishing of the code is certainly necessary. We also have to change the package names. I hope that a great deal of comments can be reused from the original patch. Some more has to be written for the newer classes. Regarding repositories: I really don't mind whether my repository or yours or somebody else's is used The goal is to get the code into [lang] .
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Oliver!

          That's our mutual goal but I prefer to transfer the repository to your GitHub account if you are OK with that (alternatively you can drop it and create another one from scratch).

          So that you have the credit when people look at the provenance of that code. All I did was to break it into a few classes to show what I had in my mind, and mess around with the code.

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Oliver! That's our mutual goal but I prefer to transfer the repository to your GitHub account if you are OK with that (alternatively you can drop it and create another one from scratch). So that you have the credit when people look at the provenance of that code. All I did was to break it into a few classes to show what I had in my mind, and mess around with the code.
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno!

          It is fine with me either way, but your contribution is nevertheless very important as you turned the original specific use case into a much broader one.

          Regarding the next steps, I am pretty content with the current state of TimedCircuitBreaker. I will copy (and maybe slightly adapt) the class documentation from the original CircuitBreaker class. The tests should also be pretty complete. Do you want to work on the polishing of the other classes?

          So what would be easier for our collaboration? Can I somehow grant you direct access to my repository?

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno! It is fine with me either way, but your contribution is nevertheless very important as you turned the original specific use case into a much broader one. Regarding the next steps, I am pretty content with the current state of TimedCircuitBreaker. I will copy (and maybe slightly adapt) the class documentation from the original CircuitBreaker class. The tests should also be pretty complete. Do you want to work on the polishing of the other classes? So what would be easier for our collaboration? Can I somehow grant you direct access to my repository?
          Hide
          kinow Bruno P. Kinoshita added a comment -

          >Regarding the next steps, I am pretty content with the current state of TimedCircuitBreaker. I will copy (and maybe slightly adapt) the class documentation from the original CircuitBreaker class. The tests should also be pretty complete. Do you want to work on the polishing of the other classes?

          Excellent! I'll take care of the memory circuit breaker, tests and docs.

          >So what would be easier for our collaboration? Can I somehow grant you direct access to my repository?

          I think the best would be if you could fork [lang]'s GitHub repository, create a branch for the circuit breaker and move the classes there. I can submit a pull request to your repository. Then you can squash the commits and push a single one as a pull request to [lang]. That would make reviewing the changes very easy, what do you think?

          Show
          kinow Bruno P. Kinoshita added a comment - >Regarding the next steps, I am pretty content with the current state of TimedCircuitBreaker. I will copy (and maybe slightly adapt) the class documentation from the original CircuitBreaker class. The tests should also be pretty complete. Do you want to work on the polishing of the other classes? Excellent! I'll take care of the memory circuit breaker, tests and docs. >So what would be easier for our collaboration? Can I somehow grant you direct access to my repository? I think the best would be if you could fork [lang] 's GitHub repository, create a branch for the circuit breaker and move the classes there. I can submit a pull request to your repository. Then you can squash the commits and push a single one as a pull request to [lang] . That would make reviewing the changes very easy, what do you think?
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Ok, I forked the original repository at https://github.com/oheger/commons-lang, created a new branch circuitBreaker_lang1085, and imported the CircuitBreaker classes. So you should be able to start from there.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Ok, I forked the original repository at https://github.com/oheger/commons-lang , created a new branch circuitBreaker_lang1085, and imported the CircuitBreaker classes. So you should be able to start from there.
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          I renamed TimedCircuitBreaker to EventCountCircuitBreaker - this name seemed to be more appropriate IMHO. Documentation was added to the CircuitBreaker interface and to EventCountCircuitBreaker.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - I renamed TimedCircuitBreaker to EventCountCircuitBreaker - this name seemed to be more appropriate IMHO. Documentation was added to the CircuitBreaker interface and to EventCountCircuitBreaker.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hello Oliver!

          Here's my first try: https://github.com/oheger/commons-lang/pull/1

          +1 for renaming to EventCountCircuitBreaker. The JavaDocs are very comprehensive as well, so by the class name + its JavaDocs I think it's easy to tell what it is supposed to be.

          While writing tests I noticed that the MemoryCircuitBreaker was simply looking after a certain threshold, nothing related to memory (side note: the ES memory circuit takes into consideration the unit [KB, MB, GB, etc]). So I've renamed it too, to ThresholdCircuitBreaker.

          I thought about changing to ? extends Number instead of Long, or something like that, but comparing Double/Float can be tricky, and I thought we'd be overcomplicating it for now.

          Do you think it would be better to move the circuit breakers under its own separate package, or do you think it's fine to use the concurrent one? Just asking because with more implementations we may introduce new classes, and when the first patch was created using that package, it didn't take several implementations into consideration.

          Thanks a lot and sorry for the late reply
          Bruno

          Show
          kinow Bruno P. Kinoshita added a comment - Hello Oliver! Here's my first try: https://github.com/oheger/commons-lang/pull/1 +1 for renaming to EventCountCircuitBreaker. The JavaDocs are very comprehensive as well, so by the class name + its JavaDocs I think it's easy to tell what it is supposed to be. While writing tests I noticed that the MemoryCircuitBreaker was simply looking after a certain threshold, nothing related to memory (side note: the ES memory circuit takes into consideration the unit [KB, MB, GB, etc] ). So I've renamed it too, to ThresholdCircuitBreaker. I thought about changing to ? extends Number instead of Long, or something like that, but comparing Double/Float can be tricky, and I thought we'd be overcomplicating it for now. Do you think it would be better to move the circuit breakers under its own separate package, or do you think it's fine to use the concurrent one? Just asking because with more implementations we may introduce new classes, and when the first patch was created using that package, it didn't take several implementations into consideration. Thanks a lot and sorry for the late reply Bruno
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Hi Bruno!

          Everything looks good. I also fully agree to the name ThresholdCircuitBreaker.

          Regarding package organization: I am on the fence here. If more implementations are added, a separate package would be appropriate. However, I remember that in the past there were objections against adding too complex components to [lang]. Having a new package could be considered an indication that circuit breakers fall into this category. But I would like to have some opinions from other committers regarding this question.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Hi Bruno! Everything looks good. I also fully agree to the name ThresholdCircuitBreaker. Regarding package organization: I am on the fence here. If more implementations are added, a separate package would be appropriate. However, I remember that in the past there were objections against adding too complex components to [lang] . Having a new package could be considered an indication that circuit breakers fall into this category. But I would like to have some opinions from other committers regarding this question.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Good point I believe we can move forward and submit a pull request from your repository against apache/commons-lang and either drop an e-mail to the dev-list, or ask someone here to review our changes.

          Show
          kinow Bruno P. Kinoshita added a comment - Good point I believe we can move forward and submit a pull request from your repository against apache/commons-lang and either drop an e-mail to the dev-list, or ask someone here to review our changes.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user oheger opened a pull request:

          https://github.com/apache/commons-lang/pull/95

          Implementations of the circuit breaker pattern related to LANG-1085

          These are the results of Bruno's and my collaboration on a circuit breaker implementation. For further discussions refer to LANG-1085.

          commit 1b12db706b457408562a166c21bc6470a8064620
          Merge: edebd97 def7832
          Author: Oliver Heger <oliver.heger@oliver-heger.de>
          Date: Wed Jun 10 21:27:17 2015 +0200

          Merge pull request #1 from kinow/patch1

          This commit:

          commit def78320c5efcb734572c5b48623a952e3c94c75
          Author: Bruno P. Kinoshita <brunodepaulak@yahoo.com.br>
          Date: Wed Jun 10 22:57:33 2015 +1200

          This commit:

          • fixes JavaDocs warnings in Checkstyle
          • adds license headers
          • renames the MemoryCircuitBreaker to ThresholdCircuitBreaker
          • adds more tests to have a good coverage

          commit edebd970582ce2984258352c8482bcb51587f7d2
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Tue Jun 9 22:11:11 2015 +0200

          Documentation updates for EventCountCircuitBreaker.

          commit 3d8a4ff85a78173dd8f5437d9b4d931069128e20
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Tue Jun 9 21:55:02 2015 +0200

          Renamed TimedCircuitBreaker to EventCountCircuitBreaker.

          This name seems to be more appropriate as the main property of this circuit
          breaker implementation is that it counts specific events and changes its state
          when a certain threshold is reached.

          commit 0e4ce5a984ef699ddace61bbf430d695b011c6b5
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Tue Jun 9 21:51:22 2015 +0200

          Added documentation for CircuitBreaker interface.

          commit 0e6b22190ef1868655fec9b3814a2345ad206f76
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Mon Jun 8 22:27:05 2015 +0200

          Initial import of CircuitBreaker classes.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/oheger/commons-lang master

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/commons-lang/pull/95.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #95


          commit 52ba83bba8938cbc71529dda22cffd08e45ce96a
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: 2015-06-11T19:39:40Z

          Squashed commit of the following:

          commit 1b12db706b457408562a166c21bc6470a8064620
          Merge: edebd97 def7832
          Author: Oliver Heger <oliver.heger@oliver-heger.de>
          Date: Wed Jun 10 21:27:17 2015 +0200

          Merge pull request #1 from kinow/patch1

          This commit:

          commit def78320c5efcb734572c5b48623a952e3c94c75
          Author: Bruno P. Kinoshita <brunodepaulak@yahoo.com.br>
          Date: Wed Jun 10 22:57:33 2015 +1200

          This commit:

          • fixes JavaDocs warnings in Checkstyle
          • adds license headers
          • renames the MemoryCircuitBreaker to ThresholdCircuitBreaker
          • adds more tests to have a good coverage

          commit edebd970582ce2984258352c8482bcb51587f7d2
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Tue Jun 9 22:11:11 2015 +0200

          Documentation updates for EventCountCircuitBreaker.

          commit 3d8a4ff85a78173dd8f5437d9b4d931069128e20
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Tue Jun 9 21:55:02 2015 +0200

          Renamed TimedCircuitBreaker to EventCountCircuitBreaker.

          This name seems to be more appropriate as the main property of this circuit
          breaker implementation is that it counts specific events and changes its state
          when a certain threshold is reached.

          commit 0e4ce5a984ef699ddace61bbf430d695b011c6b5
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Tue Jun 9 21:51:22 2015 +0200

          Added documentation for CircuitBreaker interface.

          commit 0e6b22190ef1868655fec9b3814a2345ad206f76
          Author: oheger <oliver.heger@oliver-heger.de>
          Date: Mon Jun 8 22:27:05 2015 +0200

          Initial import of CircuitBreaker classes.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user oheger opened a pull request: https://github.com/apache/commons-lang/pull/95 Implementations of the circuit breaker pattern related to LANG-1085 These are the results of Bruno's and my collaboration on a circuit breaker implementation. For further discussions refer to LANG-1085 . commit 1b12db706b457408562a166c21bc6470a8064620 Merge: edebd97 def7832 Author: Oliver Heger <oliver.heger@oliver-heger.de> Date: Wed Jun 10 21:27:17 2015 +0200 Merge pull request #1 from kinow/patch1 This commit: commit def78320c5efcb734572c5b48623a952e3c94c75 Author: Bruno P. Kinoshita <brunodepaulak@yahoo.com.br> Date: Wed Jun 10 22:57:33 2015 +1200 This commit: fixes JavaDocs warnings in Checkstyle adds license headers renames the MemoryCircuitBreaker to ThresholdCircuitBreaker adds more tests to have a good coverage commit edebd970582ce2984258352c8482bcb51587f7d2 Author: oheger <oliver.heger@oliver-heger.de> Date: Tue Jun 9 22:11:11 2015 +0200 Documentation updates for EventCountCircuitBreaker. commit 3d8a4ff85a78173dd8f5437d9b4d931069128e20 Author: oheger <oliver.heger@oliver-heger.de> Date: Tue Jun 9 21:55:02 2015 +0200 Renamed TimedCircuitBreaker to EventCountCircuitBreaker. This name seems to be more appropriate as the main property of this circuit breaker implementation is that it counts specific events and changes its state when a certain threshold is reached. commit 0e4ce5a984ef699ddace61bbf430d695b011c6b5 Author: oheger <oliver.heger@oliver-heger.de> Date: Tue Jun 9 21:51:22 2015 +0200 Added documentation for CircuitBreaker interface. commit 0e6b22190ef1868655fec9b3814a2345ad206f76 Author: oheger <oliver.heger@oliver-heger.de> Date: Mon Jun 8 22:27:05 2015 +0200 Initial import of CircuitBreaker classes. You can merge this pull request into a Git repository by running: $ git pull https://github.com/oheger/commons-lang master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-lang/pull/95.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #95 commit 52ba83bba8938cbc71529dda22cffd08e45ce96a Author: oheger <oliver.heger@oliver-heger.de> Date: 2015-06-11T19:39:40Z Squashed commit of the following: commit 1b12db706b457408562a166c21bc6470a8064620 Merge: edebd97 def7832 Author: Oliver Heger <oliver.heger@oliver-heger.de> Date: Wed Jun 10 21:27:17 2015 +0200 Merge pull request #1 from kinow/patch1 This commit: commit def78320c5efcb734572c5b48623a952e3c94c75 Author: Bruno P. Kinoshita <brunodepaulak@yahoo.com.br> Date: Wed Jun 10 22:57:33 2015 +1200 This commit: fixes JavaDocs warnings in Checkstyle adds license headers renames the MemoryCircuitBreaker to ThresholdCircuitBreaker adds more tests to have a good coverage commit edebd970582ce2984258352c8482bcb51587f7d2 Author: oheger <oliver.heger@oliver-heger.de> Date: Tue Jun 9 22:11:11 2015 +0200 Documentation updates for EventCountCircuitBreaker. commit 3d8a4ff85a78173dd8f5437d9b4d931069128e20 Author: oheger <oliver.heger@oliver-heger.de> Date: Tue Jun 9 21:55:02 2015 +0200 Renamed TimedCircuitBreaker to EventCountCircuitBreaker. This name seems to be more appropriate as the main property of this circuit breaker implementation is that it counts specific events and changes its state when a certain threshold is reached. commit 0e4ce5a984ef699ddace61bbf430d695b011c6b5 Author: oheger <oliver.heger@oliver-heger.de> Date: Tue Jun 9 21:51:22 2015 +0200 Added documentation for CircuitBreaker interface. commit 0e6b22190ef1868655fec9b3814a2345ad206f76 Author: oheger <oliver.heger@oliver-heger.de> Date: Mon Jun 8 22:27:05 2015 +0200 Initial import of CircuitBreaker classes.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user PascalSchumacher commented on the pull request:

          https://github.com/apache/commons-lang/pull/95#issuecomment-221935689

          I guess this is ready to merge?

          Show
          githubbot ASF GitHub Bot added a comment - Github user PascalSchumacher commented on the pull request: https://github.com/apache/commons-lang/pull/95#issuecomment-221935689 I guess this is ready to merge?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user oheger commented on the pull request:

          https://github.com/apache/commons-lang/pull/95#issuecomment-221967722

          Well, the code is ready and fully unit-tested. When we created this pull request, we asked on the ML whether the lang concurrent package would be the right place for this code, but there was no reaction. So this question is still open.

          Show
          githubbot ASF GitHub Bot added a comment - Github user oheger commented on the pull request: https://github.com/apache/commons-lang/pull/95#issuecomment-221967722 Well, the code is ready and fully unit-tested. When we created this pull request, we asked on the ML whether the lang concurrent package would be the right place for this code, but there was no reaction. So this question is still open.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user britter commented on the pull request:

          https://github.com/apache/commons-lang/pull/95#issuecomment-222085429

          @oheger @PascalSchumacher: Nobody objected adding it to the concurrent package. So from PoV it can be integrated into LANG.

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter commented on the pull request: https://github.com/apache/commons-lang/pull/95#issuecomment-222085429 @oheger @PascalSchumacher: Nobody objected adding it to the concurrent package. So from PoV it can be integrated into LANG.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          +1 for merging it.

          Show
          kinow Bruno P. Kinoshita added a comment - +1 for merging it.
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Certainly no objections from my side!

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Certainly no objections from my side!
          Hide
          britter Benedikt Ritter added a comment -

          Oliver Heger it was your patch. Feel free to apply it!

          Show
          britter Benedikt Ritter added a comment - Oliver Heger it was your patch. Feel free to apply it!
          Hide
          oliver.heger@t-online.de Oliver Heger added a comment -

          Thanks for the honor, but I really do not mind if somebody else applies this patch. I currently do not even have an up-to-date repository checked out.

          Show
          oliver.heger@t-online.de Oliver Heger added a comment - Thanks for the honor, but I really do not mind if somebody else applies this patch. I currently do not even have an up-to-date repository checked out.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/commons-lang/pull/95

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/commons-lang/pull/95
          Hide
          pascalschumacher Pascal Schumacher added a comment -

          Merged the pull request. Thanks!

          Show
          pascalschumacher Pascal Schumacher added a comment - Merged the pull request. Thanks!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user PascalSchumacher commented on the issue:

          https://github.com/apache/commons-lang/pull/95

          Thanks! :+1:

          Show
          githubbot ASF GitHub Bot added a comment - Github user PascalSchumacher commented on the issue: https://github.com/apache/commons-lang/pull/95 Thanks! :+1:

            People

            • Assignee:
              pascalschumacher Pascal Schumacher
              Reporter:
              oliver.heger@t-online.de Oliver Heger
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development