()
| 740 | } |
| 741 | |
| 742 | public void stop() throws Exception { |
| 743 | lock(); |
| 744 | try { |
| 745 | if (null != checkpointFuture) { |
| 746 | checkpointFuture.get(); |
| 747 | checkpointFuture = null; |
| 748 | } |
| 749 | if (onz != null) { |
| 750 | onz.stop(); |
| 751 | onz = null; |
| 752 | } |
| 753 | |
| 754 | if (deadlockBreaker != null) { |
| 755 | deadlockBreaker.shutdown(); |
| 756 | deadlockBreaker = null; |
| 757 | } |
| 758 | |
| 759 | if (startState == StartState.eStopped) |
| 760 | return; |
| 761 | startState = StartState.eStartingOrStopping; |
| 762 | ShutdownHook.remove(this); |
| 763 | logger.info("Stop ServerId={}", conf.getServerId()); |
| 764 | |
| 765 | if (achillesHeelDaemon != null) { |
| 766 | achillesHeelDaemon.stopAndJoin(); |
| 767 | achillesHeelDaemon = null; |
| 768 | } |
| 769 | |
| 770 | if (globalAgent != null) { |
| 771 | globalAgent.close(); |
| 772 | globalAgent = null; |
| 773 | } |
| 774 | if (flushWhenReduceTimerTask != null) { |
| 775 | flushWhenReduceTimerTask.cancel(false); |
| 776 | flushWhenReduceTimerTask = null; |
| 777 | } |
| 778 | |
| 779 | if (checkpoint != null) { |
| 780 | checkpoint.stopAndJoin(); |
| 781 | checkpoint = null; |
| 782 | } |
| 783 | |
| 784 | if (delayRemove != null) { |
| 785 | delayRemove.stop(); |
| 786 | delayRemove = null; |
| 787 | } |
| 788 | |
| 789 | if (timer != null) { |
| 790 | timer.stop(); |
| 791 | timer = null; |
| 792 | } |
| 793 | |
| 794 | if (auth != null) { |
| 795 | auth.stop(); |
| 796 | auth = null; |
| 797 | } |
| 798 | |
| 799 | if (LocalRocksCacheDb != null) { |
no test coverage detected