Skip to content

Commit

Permalink
Merge branch 'release/1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
jtnelson committed Jul 4, 2022
2 parents 5945914 + 78e40a4 commit 72b9ed8
Show file tree
Hide file tree
Showing 15 changed files with 1,357 additions and 620 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/openjdk:8-jdk-browsers
- image: cimg/openjdk:8.0.322
resource_class: xlarge
environment:
GRADLE_OPTS: "-Djenkins=true"
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.2
1.9.3
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Changelog

#### Version 1.9.2 (TBD)
* Upgraded the underlying `Concourse` client dependency to version [`0.11.1`](https://github.com/cinchapi/concourse/releases/tag/v0.11.1), which means that Runway now supports specifying a CCL function statement as an operation key or an operation value if it is connected to a Concourse Server that is version `0.11.0+`.
#### Version 1.9.3 (TBD)
* For instances of Concourse Server at version [`0.11.3`](https://github.com/cinchapi/concourse/releases/tag/v0.11.3)) or greater, we improved overall read performance by pre-selecting data for linked Records, whenever possible. Previously, if a `Record` contained an attribute whose type was another `Record`, Runway would eagerly load the data for that reference in a separate database call. So, if Runway needed to process a read of many Records with references to other Records, performance was poor because there were too many database round trips required. Now, Runway will detect when a `Record` has references to other Records and will pre-select the data for those references while selecting the data for the parent `Record` if it is possible to do so. This greatly reduces the number of database round trips which drastically improves performance by up to `89.7%`.
* This improvement is automatically enabled whenever `Runway` is connected to a Concourse deployment at version [`0.11.3+`]. If necessary, it is possible to disable the functionality when building a `Runway` instance by invoking the `disablePreSelectLinkedRecords()` method.
* Added a new `Runway.properties()` method that exposes an interface to get metadata and other information about a `Runway` instance. This interface can be used to query whether a `Runway` is capable and configured to take advantage of pre-selection.
* Improved the performance of `Runway` commands that perform pagination when a `filter` or a `condition` that must be resolved locally (e.g., because it references derived or computed keys not in the database) is provided. Previously, in these cases, `Runway` would load all possible records before applying the `filter` or `condition` and lastly performing pagination. Now, `Runway` incrementally loads possible matching records and applies the `filter` or `condition` on the fly until the requested `Page` has been filled.
* Removed the `com.cinchapi.runway.util.Paging` class that was copied from the `concourse-server` project since it is no longer used for internal pagination logic.
* Removed unnecessary random result set access when lazily instantiating the Set of records that match a `Runway` operation.
* Optimized load performance by
* using more intelligent logic to scaffold a `Record` instance and
* performing static analysis and caching immutable metadata for `Record` types that was previously computed during each load.

#### Version 1.9.2 (March 18, 2022)
* Upgraded the underlying `Concourse` client dependency to version [`0.11.2`](https://github.com/cinchapi/concourse/releases/tag/v0.11.2), which means that Runway now supports specifying a CCL function statement as an operation key or an operation value if it is connected to a Concourse Server that is version `0.11.0+`.

#### Version 1.9.1 (February 20, 2022)
* Fixed a bug that randomly causes a spurious error to be thrown indicating that a Record attribute doesn't exist in the database when an attempt is made to access it.
Expand Down
47 changes: 21 additions & 26 deletions src/main/java/com/cinchapi/runway/DatabaseInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.cinchapi.concourse.lang.Criteria;
import com.cinchapi.concourse.lang.paginate.Page;
import com.cinchapi.concourse.lang.sort.Order;
import com.cinchapi.runway.util.Paging;
import com.cinchapi.runway.util.Pagination;
import com.google.common.collect.Sets;

/**
Expand Down Expand Up @@ -158,7 +158,7 @@ public default <T extends Record> int count(Class<T> clazz,
Predicate<T> filter) {
return count(clazz, filter, Realms.any());
}

/**
* Return the number of {@link Records} in the {@code clazz} that pass the
* {@code filter} among the provided {@code realms}.
Expand Down Expand Up @@ -423,9 +423,9 @@ public default <T extends Record> Set<T> find(Class<T> clazz,
public default <T extends Record> Set<T> find(Class<T> clazz,
Criteria criteria, Order order, Page page, Predicate<T> filter,
Realms realms) {
Set<T> unfiltered = find(clazz, criteria, order, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> find(clazz, criteria, order, $page, realms), filter,
page);
}

/**
Expand Down Expand Up @@ -591,9 +591,8 @@ public default <T extends Record> Set<T> find(Class<T> clazz,
*/
public default <T extends Record> Set<T> find(Class<T> clazz,
Criteria criteria, Page page, Predicate<T> filter, Realms realms) {
Set<T> unfiltered = find(clazz, criteria, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> find(clazz, criteria, $page, realms), filter, page);
}

/**
Expand Down Expand Up @@ -779,9 +778,9 @@ public default <T extends Record> Set<T> findAny(Class<T> clazz,
public default <T extends Record> Set<T> findAny(Class<T> clazz,
Criteria criteria, Order order, Page page, Predicate<T> filter,
Realms realms) {
Set<T> unfiltered = findAny(clazz, criteria, order, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> findAny(clazz, criteria, order, $page, realms), filter,
page);
}

/**
Expand Down Expand Up @@ -947,9 +946,9 @@ public default <T extends Record> Set<T> findAny(Class<T> clazz,
*/
public default <T extends Record> Set<T> findAny(Class<T> clazz,
Criteria criteria, Page page, Predicate<T> filter, Realms realms) {
Set<T> unfiltered = findAny(clazz, criteria, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> findAny(clazz, criteria, $page, realms), filter, page);

}

/**
Expand Down Expand Up @@ -1272,9 +1271,8 @@ public default <T extends Record> Set<T> load(Class<T> clazz, Order order,
*/
public default <T extends Record> Set<T> load(Class<T> clazz, Order order,
Page page, Predicate<T> filter, Realms realms) {
Set<T> unfiltered = load(clazz, order, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> load(clazz, order, $page, realms), filter, page);
}

/**
Expand Down Expand Up @@ -1474,9 +1472,8 @@ public default <T extends Record> Set<T> load(Class<T> clazz, Page page,
*/
public default <T extends Record> Set<T> load(Class<T> clazz, Page page,
Predicate<T> filter, Realms realms) {
Set<T> unfiltered = load(clazz, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> load(clazz, $page, realms), filter, page);
}

/**
Expand Down Expand Up @@ -1730,9 +1727,8 @@ public default <T extends Record> Set<T> loadAny(Class<T> clazz,
*/
public default <T extends Record> Set<T> loadAny(Class<T> clazz,
Order order, Page page, Predicate<T> filter, Realms realms) {
Set<T> unfiltered = loadAny(clazz, order, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> loadAny(clazz, order, $page, realms), filter, page);
}

/**
Expand Down Expand Up @@ -1958,9 +1954,8 @@ public default <T extends Record> Set<T> loadAny(Class<T> clazz, Page page,
*/
public default <T extends Record> Set<T> loadAny(Class<T> clazz, Page page,
Predicate<T> filter, Realms realms) {
Set<T> unfiltered = loadAny(clazz, realms);
Set<T> filtered = Sets.filter(unfiltered, filter::test);
return Paging.paginate(filtered, page);
return Pagination.applyFilterAndPage(
$page -> loadAny(clazz, $page, realms), filter, page);
}

/**
Expand Down
Loading

0 comments on commit 72b9ed8

Please sign in to comment.