Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9448ed1
Adding track multiple impressions
ldecheverz-split Nov 12, 2021
83600b8
Merge pull request #275 from splitio/multiple-impressions
ldecheverz-split Nov 16, 2021
e29cf60
Adding evaluateFeatures
ldecheverz-split Nov 16, 2021
4bb7cc1
Fixing PR comments
ldecheverz-split Nov 17, 2021
254a9c2
Merge pull request #276 from splitio/evaluate-features
ldecheverz-split Nov 17, 2021
56ffd45
Adding getTreatments
ldecheverz-split Nov 18, 2021
4977bcf
updated client with new apis for splitClient
Nov 18, 2021
242e92e
Merge pull request #277 from splitio/task/get-treatments-tests
ldecheverz-split Nov 18, 2021
c368aa0
Fixing missed results
ldecheverz-split Nov 18, 2021
6cd56d3
Fixing impressions track
ldecheverz-split Nov 19, 2021
8f83473
Checking splits list condition
ldecheverz-split Nov 19, 2021
11ef3bd
Fixing wrong handling of getTreatments result
ldecheverz-split Nov 19, 2021
eac49f5
Adding tests to treatments
ldecheverz-split Dec 9, 2021
f2a1160
Fixing PR Comments
ldecheverz-split Dec 13, 2021
264b5ae
Adding redis expire and exception.
ldecheverz-split Dec 14, 2021
0648783
Adding redis Storage Mode
ldecheverz-split Dec 14, 2021
3e319f0
Fixing PR comments
ldecheverz-split Dec 14, 2021
eca9d06
PR comments
ldecheverz-split Dec 14, 2021
e8fb730
Returning empty map instead of null
ldecheverz-split Dec 14, 2021
ecb2198
Merge pull request #278 from splitio/get-treatments
ldecheverz-split Dec 14, 2021
5238908
Merge branches 'redis-exceptions' and 'redis-v2' of github.com:spliti…
ldecheverz-split Dec 14, 2021
8537eb3
Fixing missing method
ldecheverz-split Dec 15, 2021
5d1d0a2
Changing method to avoid errors
ldecheverz-split Dec 15, 2021
e802577
moving to rc1
ldecheverz-split Dec 15, 2021
a11c858
added ltrim instead of rpop
Dec 17, 2021
94c2209
version
Dec 20, 2021
7eebe69
Merge pull request #279 from splitio/redis-exceptions
ldecheverz-split Jan 5, 2022
ebdcc27
Adding logs to see segments error
ldecheverz-split Jan 6, 2022
88dd69d
rc2
ldecheverz-split Jan 6, 2022
6758fca
one more log for fetchOptions
ldecheverz-split Jan 6, 2022
84ab67e
changing log level
ldecheverz-split Jan 6, 2022
a3e4596
Rollingback logs and preparing poms and changes.txt for release
ldecheverz-split Jan 7, 2022
ba3b73d
Merge pull request #280 from splitio/redis-v2
ldecheverz-split Jan 11, 2022
1c78863
Updating date
ldecheverz-split Jan 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
4.4.0 (Oct 29, 2021)
4.4.0 (Jan 11, 2022)
- Added support for Redis to keep consistency across multiple SDK instances.
- Added logic to fetch multiple splits at once on GetTreatments/GetTreatmentsWithChanges.

4.3.0 (Oct 19, 2021)
- Added support for the SDK to run with a custom implementation of it's internal storage modules, enabling customers to implement this caching in any storage technology of choice and connect it to the SDK instance itself which will use it instead of the in-memory structures.
Expand Down
8 changes: 2 additions & 6 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
<parent>
<groupId>io.split.client</groupId>
<artifactId>java-client-parent</artifactId>
<version>4.4.0-beta</version>
<version>4.4.0</version>
</parent>
<artifactId>java-client</artifactId>
<packaging>jar</packaging>
<name>Java Client</name>
<description>Java SDK for Split</description>

<properties>
<pluggable.storage>1.0.0-beta</pluggable.storage>
</properties>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -126,7 +122,7 @@
<dependency>
<groupId>io.split.client</groupId>
<artifactId>pluggable-storage</artifactId>
<version>${pluggable.storage}</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down

This file was deleted.

128 changes: 128 additions & 0 deletions client/src/main/java/io/split/client/SplitClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.split.client.api.Key;
import io.split.client.api.SplitResult;

import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;

Expand Down Expand Up @@ -139,6 +140,133 @@ public interface SplitClient {
*/
SplitResult getTreatmentWithConfig(Key key, String split, Map<String, Object> attributes);

/**
* Returns a map of feature name and treatments to show this key for these features. The set of treatments
* for a feature can be configured on the Split web console.
* <p/>
* <p/>
* This method returns for each feature the string 'control' if:
* <ol>
* <li>Any of the parameters were null</li>
* <li>There was an exception in evaluating the treatment</li>
* <li>The SDK does not know of the existence of this feature</li>
* <li>The feature was deleted through the web console.</li>
* </ol>
* 'control' is a reserved treatment (you cannot create a treatment with the
* same name) to highlight these exceptional circumstances.
* <p/>
* <p/>
* The sdk returns for each feature the default treatment of this feature if:
* <ol>
* <li>The feature was killed</li>
* <li>The key did not match any of the conditions in the feature roll-out plan</li>
* </ol>
* The default treatment of a feature is set on the Split web console.
* <p/>
* <p/>
* This method does not throw any exceptions. It also never returns null.
*
* @param key a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
* @param splits the features we want to evaluate. MUST NOT be null.
* @return for each feature the evaluated treatment, the default treatment for each feature, or 'control'.
*/
Map<String, String> getTreatments(String key, List<String> splits);

/**
* This method is useful when you want to determine the treatments to show
* to a customer (user, account etc.) based on an attribute of that customer
* instead of their key.
* <p/>
* <p/>
* Examples include showing different treatments to users on trial plan
* vs. premium plan. Another example is to show different treatments
* to users created after a certain date.
*
* @param key a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
* @param splits the features we want to evaluate. MUST NOT be null.
* @param attributes of the customer (user, account etc.) to use in evaluation. Can be null or empty.
* @return the evaluated treatment, the default treatment of this feature, or 'control'.
*/
Map<String, String> getTreatments(String key, List<String> splits, Map<String, Object> attributes);

/**
* To understand why this method is useful, consider the following simple Split as an example:
*
* if user is in segment employees then split 100%:on
* else if user is in segment all then split 20%:on,80%:off
*
* There are two concepts here: matching and bucketing. Matching
* refers to ‘user is in segment employees’ or ‘user is in segment
* all’ whereas bucketing refers to ‘100%:on’ or ‘20%:on,80%:off’.
*
* By default, the same customer key is used for both matching and
* bucketing. However, for some advanced use cases, you may want
* to use different keys. For such cases, use this method.
*
* As an example, suppose you want to rollout to percentages of
* users in specific accounts. You can achieve that by matching
* via account id, but bucketing by user id.
*
* Another example is when you want to ensure that a user continues to get
* the same treatment after they sign up for your product that they used
* to get when they were simply a visitor to your site. In that case,
* before they sign up, you can use their visitor id for both matching and bucketing, but
* post log-in you can use their user id for matching and visitor id for bucketing.
*
*
* @param key the matching and bucketing keys. MUST NOT be null.
* @param splits the features we want to evaluate. MUST NOT be null.
* @param attributes of the entity (user, account etc.) to use in evaluation. Can be null or empty.
*
* @return for each feature the evaluated treatment, the default treatment of the feature, or 'control'.
*/
Map<String, String> getTreatments(Key key, List<String> splits, Map<String, Object> attributes);

/**
* Same as {@link #getTreatments(String, List<String>)} but it returns the configuration associated to the
* matching treatments if any. Otherwise {@link SplitResult.configurations()} will be null.
* <p/>
* <p/>
* Examples include showing a different treatment to users on trial plan
* vs. premium plan. Another example is to show a different treatment
* to users created after a certain date.
*
* @param key a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
* @param splits the features we want to evaluate. MUST NOT be null.
* @return Map<String, SplitResult> containing for each feature the evaluated treatment (the default treatment of this feature, or 'control') and
* a configuration associated to this treatment if set.
*/
Map<String, SplitResult> getTreatmentsWithConfig(String key, List<String> splits);

/**
* Same as {@link #getTreatments(String, List<String>, Map)} but it returns for each feature the configuration associated to the
* matching treatment if any. Otherwise {@link SplitResult.configurations()} will be null.
* <p/>
* <p/>
* Examples include showing a different treatment to users on trial plan
* vs. premium plan. Another example is to show a different treatment
* to users created after a certain date.
*
* @param key a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
* @param splits the features we want to evaluate. MUST NOT be null.
* @param attributes of the customer (user, account etc.) to use in evaluation. Can be null or empty.
* @return for each feature a SplitResult containing the evaluated treatment (the default treatment of this feature, or 'control') and
* a configuration associated to this treatment if set.
*/
Map<String, SplitResult> getTreatmentsWithConfig(String key, List<String> splits, Map<String, Object> attributes);

/**
* Same as {@link #getTreatments(Key, List<String>, Map)} but it returns for each feature the configuration associated to the
* matching treatment if any. Otherwise {@link SplitResult.configurations()} will be null.
*
* @param key the matching and bucketing keys. MUST NOT be null.
* @param splits the features we want to evaluate. MUST NOT be null.
* @param attributes of the entity (user, account etc.) to use in evaluation. Can be null or empty.
*
* @return for each feature a SplitResult containing the evaluated treatment (the default treatment of this feature, or 'control') and
* a configuration associated to this treatment if set.
*/
Map<String, SplitResult> getTreatmentsWithConfig(Key key, List<String> splits, Map<String, Object> attributes);

/**
* Destroys the background processes and clears the cache, releasing the resources used by
Expand Down
10 changes: 10 additions & 0 deletions client/src/main/java/io/split/client/SplitClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,16 @@ public Builder operationMode(OperationMode mode) {
return this;
}

/**
*
* @param storage mode
* @return this builder
*/
public Builder storageMode(StorageMode mode) {
_storageMode = mode;
return this;
}

/**
* Storage wrapper
*
Expand Down
Loading