forked from twitter/finagle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem The current API is asymmetric: apply() doesn't refer to the same thing as update(). This is highly confusing and even dangerous. The relationship between the base Dtab and the local Dtab is unclear and confusing. It's a bad API. Further, Java usage of Dtab was littered with MODULE$ references. Solution Deconflate 'base' from 'local'. Instead of Dtab() and Dtab.base, we have instead Dtab.base and Dtab.local. These are accessed and updated in the standard way. Dtab users (i.e. BindingFactory, a class in ConfigBus) must now compose the Dtab explicitly: Dtab.base++Dtab.local. Also get rid of Dtab.baseDiff() -- protocols simply encode Dtab.local. We also ensure that Dtabs are tested with a nonempty Dtab.base, so that this does not accidentally leak. RB_ID=363999
- Loading branch information
Showing
22 changed files
with
870 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
finagle-core/src/test/java/com/twitter/finagle/MyTestDtab.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.twitter.finagle; | ||
|
||
/** | ||
* A Java compilation test for Dtab manipulation. | ||
*/ | ||
|
||
public class MyTestDtab { | ||
static { | ||
Dtab d = Dtab.empty(); | ||
d = Dtab.local(); | ||
d = Dtab.base(); | ||
Dtab.setLocal(d); | ||
Dtab base = Dtab.base(); | ||
Dtab.setBase(Dtab.empty()); | ||
Dtab.setBase(base); | ||
d = Dtab.local().concat(Dtab.base()); | ||
d = Dtab.local().append(Dentry.read("/foo=>/bar")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.