-
Notifications
You must be signed in to change notification settings - Fork 963
Turn Bookie into an interface #2717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good.
I know that this is a "draft", but I left a couple of comments
thanks for this contribution
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
Outdated
Show resolved
Hide resolved
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
Outdated
Show resolved
Hide resolved
Bookie was previously a concrete class that was used and abused all over the place, especially in tests. A classic example of the God object antipattern. The extensive use in tests, resulted in test cases which spin up many instances of the whole system, which is very heavy and very slow, especially when trying to unit tests a particular feature. This change is the first step to resolving this situation. Bookie is now an interface, implemented by BookieImpl. Subsequent changes will break out parts of the interface, cleanup calls and add dependency injection.
c9c36ee to
db69026
Compare
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
+1
hsaputra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
LGTM
|
Will merge this by EOD if no more comment or concern. Thank you |
dlg99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
### Motivation Bookie was previously a concrete class that was used and abused all over the place, especially in tests. A classic example of the God object antipattern. The extensive use in tests, resulted in test cases which spin up many instances of the whole system, which is very heavy and very slow, especially when trying to unit tests a particular feature. This change is the first step to resolving this situation. Bookie is now an interface, implemented by BookieImpl. Subsequent changes will break out parts of the interface, cleanup calls and add dependency injection. Reviewers: Matteo Merli <mmerli@apache.org>, Andrey Yegorov, Henry Saputra <hsaputra@apache.org>, Enrico Olivelli <eolivelli@gmail.com> This closes apache#2717 from pkumar-singh/merge_back_to_oss and squashes the following commits: 3edee49 [Prashant] Replace SettableFuture with CompletableFuture db69026 [Ivan Kelly] Turn Bookie into an interface
### Motivation Bookie was previously a concrete class that was used and abused all over the place, especially in tests. A classic example of the God object antipattern. The extensive use in tests, resulted in test cases which spin up many instances of the whole system, which is very heavy and very slow, especially when trying to unit tests a particular feature. This change is the first step to resolving this situation. Bookie is now an interface, implemented by BookieImpl. Subsequent changes will break out parts of the interface, cleanup calls and add dependency injection. Reviewers: Matteo Merli <mmerli@apache.org>, Andrey Yegorov, Henry Saputra <hsaputra@apache.org>, Enrico Olivelli <eolivelli@gmail.com> This closes apache#2717 from pkumar-singh/merge_back_to_oss and squashes the following commits: 3edee49 [Prashant] Replace SettableFuture with CompletableFuture db69026 [Ivan Kelly] Turn Bookie into an interface
Motivation
Bookie was previously a concrete class that was used and abused all
over the place, especially in tests. A classic example of the God
object antipattern. The extensive use in tests, resulted in test cases
which spin up many instances of the whole system, which is very heavy
and very slow, especially when trying to unit tests a particular
feature.
This change is the first step to resolving this situation. Bookie is
now an interface, implemented by BookieImpl. Subsequent changes will
break out parts of the interface, cleanup calls and add dependency
injection.