-
Notifications
You must be signed in to change notification settings - Fork 7
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
Rollout config #719
Merged
Merged
Rollout config #719
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
489bc31
WIP
gthea a5f7c5e
New tests
gthea a416b0c
Cleanup
gthea f5373dc
WIP integration
gthea ba92544
Merge branch 'SDKS-9072_baseline' into SDKS-9031
gthea 4d0b415
Tests modifications
gthea 428bb5b
WIP
gthea 4532d4a
Refactor
gthea fb3d56f
Fix tests
gthea ff03a85
Update tests
gthea 015180d
Track segments sync by Key
gthea f4ea326
Rollout config
gthea a9d47fe
Fixes
gthea dd951c8
Merge branch 'SDKS-9072_baseline' into SDKS-9031_2
gthea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
69 changes: 69 additions & 0 deletions
69
src/main/java/io/split/android/client/RolloutCacheConfiguration.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,69 @@ | ||
package io.split.android.client; | ||
|
||
import io.split.android.client.service.ServiceConstants; | ||
import io.split.android.client.utils.logger.Logger; | ||
|
||
public class RolloutCacheConfiguration { | ||
|
||
private final int mExpiration; | ||
private final boolean mClearOnInit; | ||
|
||
private RolloutCacheConfiguration(int expiration, boolean clearOnInit) { | ||
mExpiration = expiration; | ||
mClearOnInit = clearOnInit; | ||
} | ||
|
||
public int getExpiration() { | ||
return mExpiration; | ||
} | ||
|
||
public boolean clearOnInit() { | ||
return mClearOnInit; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
|
||
private static final int MIN_EXPIRATION_DAYS = 1; | ||
|
||
private int mExpiration = ServiceConstants.DEFAULT_ROLLOUT_CACHE_EXPIRATION; | ||
private boolean mClearOnInit = false; | ||
|
||
private Builder() { | ||
|
||
} | ||
|
||
/** | ||
* Set the expiration time for the rollout definitions cache, in days. Default is 10 days. | ||
* @param expiration in days | ||
* @return This builder | ||
*/ | ||
public Builder expiration(int expiration) { | ||
if (expiration < MIN_EXPIRATION_DAYS) { | ||
Logger.w("Cache expiration must be at least 1 day. Using default value."); | ||
mExpiration = ServiceConstants.DEFAULT_ROLLOUT_CACHE_EXPIRATION; | ||
} else { | ||
mExpiration = expiration; | ||
} | ||
|
||
return this; | ||
} | ||
|
||
/** | ||
* Set if the rollout definitions cache should be cleared on initialization. Default is false. | ||
* @param clearOnInit whether to clear cache on initialization. | ||
* @return This builder | ||
*/ | ||
public Builder clearOnInit(boolean clearOnInit) { | ||
mClearOnInit = clearOnInit; | ||
return this; | ||
} | ||
|
||
public RolloutCacheConfiguration build() { | ||
return new RolloutCacheConfiguration(mExpiration, mClearOnInit); | ||
} | ||
} | ||
} |
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
29 changes: 0 additions & 29 deletions
29
src/main/java/io/split/android/client/service/synchronizer/RolloutCacheManagerConfig.java
This file was deleted.
Oops, something went wrong.
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are
DEFAULT_SPLITS_CACHE_EXPIRATION_IN_SECONDS
andDEFAULT_ROLLOUT_CACHE_EXPIRATION
constants related? in that case, should we have only one, or derive one from the other?