Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat committed Oct 9, 2024
1 parent ee04a40 commit 0f32baa
Showing 1 changed file with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,28 +625,19 @@ void testSecondaryIndex() throws Exception {
@Cleanup
SyncOxiaClient client = OxiaClientBuilder.create(oxia.getServiceAddress()).syncClient();

client.put("si-a", "0".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "0")));
client.put("si-b", "1".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "1")));
client.put("si-c", "2".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "2")));
client.put("si-d", "3".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "3")));
client.put("si-e", "4".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "4")));
client.put("si-f", "5".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "5")));
client.put("si-g", "6".getBytes(),
Set.of(PutOption.SecondaryIndex("val", "6")));

List<String> list =
client.list("1", "4", Set.of(ListOption.UseIndex("val")));
client.put("si-a", "0".getBytes(), Set.of(PutOption.SecondaryIndex("val", "0")));
client.put("si-b", "1".getBytes(), Set.of(PutOption.SecondaryIndex("val", "1")));
client.put("si-c", "2".getBytes(), Set.of(PutOption.SecondaryIndex("val", "2")));
client.put("si-d", "3".getBytes(), Set.of(PutOption.SecondaryIndex("val", "3")));
client.put("si-e", "4".getBytes(), Set.of(PutOption.SecondaryIndex("val", "4")));
client.put("si-f", "5".getBytes(), Set.of(PutOption.SecondaryIndex("val", "5")));
client.put("si-g", "6".getBytes(), Set.of(PutOption.SecondaryIndex("val", "6")));

List<String> list = client.list("1", "4", Set.of(ListOption.UseIndex("val")));
assertThat(list).containsExactly("si-b", "si-c", "si-d");

Iterable<GetResult> iterable =
client.rangeScan(
"2", "5", Set.of(RangeScanOption.UseIndex("val")));
client.rangeScan("2", "5", Set.of(RangeScanOption.UseIndex("val")));
list =
StreamSupport.stream(iterable.spliterator(), false)
.map(GetResult::getKey)
Expand All @@ -660,9 +651,7 @@ void testSecondaryIndex() throws Exception {
list = client.list("0", "3", Set.of(ListOption.UseIndex("val")));
assertThat(list).containsExactly("si-a", "si-c");

iterable =
client.rangeScan(
"0", "3", Set.of(RangeScanOption.UseIndex("val")));
iterable = client.rangeScan("0", "3", Set.of(RangeScanOption.UseIndex("val")));
list =
StreamSupport.stream(iterable.spliterator(), false)
.map(GetResult::getKey)
Expand Down

0 comments on commit 0f32baa

Please sign in to comment.