-
Notifications
You must be signed in to change notification settings - Fork 23
updated storage, localhost and tests #551
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cfd6feb
updated storage, localhost and tests
chillaq 5ab09fb
polish
chillaq 5db3340
polish
chillaq 904ec28
polish
chillaq c8f8533
polish
chillaq 0c9e297
Merge remote-tracking branch 'origin/rbs-oldspec-fetcher' into rbs-ol…
chillaq 00402eb
resolve conflicts
chillaq fe83f0d
polish
chillaq d96a62d
Update client/src/main/java/io/split/client/HttpSplitChangeFetcher.java
chillaq efa44fa
Update client/src/main/java/io/split/client/HttpSplitChangeFetcher.java
chillaq 0af690d
polish
chillaq 0cfee56
Merge branch 'feature/rule-based-segment' into rbs-oldspec-storage
chillaq c17372b
polish
chillaq 39325f8
Update client/src/main/java/io/split/client/HttpSplitChangeFetcher.java
chillaq 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| package io.split.client.dtos; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class ChangeDto<T> { | ||
| public long s; | ||
| public long t; | ||
| public List<T> d; | ||
|
|
||
| public static ChangeDto createEmptyDto() { | ||
| ChangeDto dto = new ChangeDto<>(); | ||
| dto.d = new ArrayList<>(); | ||
| dto.t = -1; | ||
| dto.s = -1; | ||
| return dto; | ||
| } | ||
chillaq marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
9 changes: 0 additions & 9 deletions
9
client/src/main/java/io/split/client/dtos/RuleBasedSegmentChange.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
61 changes: 61 additions & 0 deletions
61
.../java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterProducer.java
This file contains hidden or 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,61 @@ | ||
| package io.split.storages.pluggable.adapters; | ||
|
|
||
| import io.split.client.dtos.RuleBasedSegment; | ||
| import io.split.client.utils.Json; | ||
| import io.split.engine.experiments.ParsedRuleBasedSegment; | ||
| import io.split.storages.RuleBasedSegmentCacheProducer; | ||
| import io.split.storages.pluggable.domain.PrefixAdapter; | ||
| import io.split.storages.pluggable.domain.UserStorageWrapper; | ||
| import io.split.storages.pluggable.utils.Helper; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import pluggable.CustomStorageWrapper; | ||
|
|
||
| import java.util.HashSet; | ||
| import java.util.List; | ||
| import java.util.Set; | ||
|
|
||
| import static com.google.common.base.Preconditions.checkNotNull; | ||
|
|
||
| public class UserCustomRuleBasedSegmentAdapterProducer implements RuleBasedSegmentCacheProducer { | ||
|
|
||
| private static final Logger _log = LoggerFactory.getLogger(UserCustomRuleBasedSegmentAdapterProducer.class); | ||
|
|
||
| private final UserStorageWrapper _userStorageWrapper; | ||
|
|
||
| public UserCustomRuleBasedSegmentAdapterProducer(CustomStorageWrapper customStorageWrapper) { | ||
| _userStorageWrapper = new UserStorageWrapper(checkNotNull(customStorageWrapper)); | ||
| } | ||
|
|
||
| @Override | ||
| public long getChangeNumber() { | ||
| String wrapperResponse = _userStorageWrapper.get(PrefixAdapter.buildRuleBasedSegmentChangeNumber()); | ||
| return Helper.responseToLong(wrapperResponse, -1L); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean remove(String ruleBasedSegmentName) { | ||
| // NoOp | ||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public void setChangeNumber(long changeNumber) { | ||
| //NoOp | ||
| } | ||
|
|
||
| @Override | ||
| public void clear() { | ||
| //NoOp | ||
| } | ||
|
|
||
| @Override | ||
| public void update(List<ParsedRuleBasedSegment> toAdd, List<String> toRemove, long changeNumber) { | ||
| //NoOp | ||
| } | ||
|
|
||
| public Set<String> getSegments() { | ||
| //NoOp | ||
| return new HashSet<>(); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.