Skip to content
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

Updates for Sets and GSets support. #8

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions content/riak/kv/2.2.6/developing/data-types/gsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Let's create a Riak gset stored in the key `2019-11-17` in the bucket `account-1
// before you perform operations on them:

Location citiesSet =
new Location(new Namespace("sets", "travel"), "cities");
new Location(new Namespace("gsets", "account-12345678"), "2019-11-17");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep the gsets/travel/cities thing the same as from sets, as we add cities to it below.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniel020403 Can you see this?

```

```ruby
Expand Down Expand Up @@ -322,7 +322,7 @@ But let's say that a pair of transactions occurred today. Let's add them to our
```java
// Using our "cities" Location from above:

SetUpdate su = new SetUpdate()
GSetUpdate su = new GSetUpdate()
.add("Toronto")
.add("Montreal");
UpdateSet update = new UpdateSet.Builder(citiesSet, su)
Expand Down Expand Up @@ -519,8 +519,13 @@ Or we can see whether our gset includes a specific member:
```java
// Using our "citiesSet" from above:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "citiesSet" still correct? Or should this now be "citiesGSet"?


System.out.println(citiesSet.contains(("Vancouver"));
System.out.println(citiesSet.contains("Ottawa"));
FetchSet fetch = new FetchSet.Builder(citiesSet)
.build();
FetchSet.Response response = client.execute(fetch);
Set<BinaryValue> binarySet = response.getDatatype().view();

System.out.println(binarySet.contains(BinaryValue.createFromUtf8("Vancouver")));
System.out.println(binarySet.contains(BinaryValue.createFromUtf8("Ottawa")));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really requires a BinaryValue conversion for a string? Also, does it no longer work offline? Now requires a server fetch?

```

```ruby
Expand Down
9 changes: 7 additions & 2 deletions content/riak/kv/2.2.6/developing/data-types/sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,13 @@ Or we can see whether our set includes a specific member:
```java
// Using our "citiesSet" from above:

System.out.println(citiesSet.contains(("Vancouver"));
System.out.println(citiesSet.contains("Ottawa"));
FetchSet fetch = new FetchSet.Builder(citiesSet)
.build();
FetchSet.Response response = client.execute(fetch);
Set<BinaryValue> binarySet = response.getDatatype().view();

System.out.println(binarySet.contains(BinaryValue.createFromUtf8("Vancouver")));
System.out.println(binarySet.contains(BinaryValue.createFromUtf8("Ottawa")));
```

```ruby
Expand Down