Skip to content

Commit

Permalink
Providing an OSLC4JUtils property (set/hasLyoStorePagingPreciseLimit) to
Browse files Browse the repository at this point in the history
allow the application to indicate whether query paging should return an
exact number of elements in a paged query, or not.
  • Loading branch information
jad-elkhoury committed Feb 10, 2022
1 parent e5c1dc9 commit 706441e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- 🧨 Jena is upgraded to 4.1.0
- Jena renamed `RDFReader/RDFWriter` to `RDFReaderI/RDFWriterI`
- LyoStore: Ordering resources by their subject IDs when doing a query to store. This ordering can be disabled with a call to `OSLC4JUtils.setLyoStorePagingUnsafe(true)`
- LyoStore: Providing an OSLC4JUtils property (set/hasLyoStorePagingPreciseLimit) to allow the application to indicate whether query paging should return an exact number of elements in a paged query, or not.


### Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public interface OSLC4JConstants {
* When "true", do not add such an OrderBy clause, in the hope that the triplestore sorting algorithm is stable-
* properties.
*/
String LYO_STORE_PAGING_UNSAFE = OSLC4J + "unsafePaging";

String LYO_STORE_PAGING_UNSAFE = OSLC4J + "storePagingUnsafe";

/**
* System property {@value} : When "true" (default), expect the store to return exactly the number of entries in the request when dealing with paging.
* When "false", expect the store to return an additional element to indicate that additional pages exist.
*/
String LYO_STORE_PAGING_PRECISE_LIMIT = OSLC4J + "storePagingPreciseLimit";

}
Original file line number Diff line number Diff line change
Expand Up @@ -752,4 +752,17 @@ public static void setLyoStorePagingUnsafe(boolean value) {
System.setProperty(OSLC4JConstants.LYO_STORE_PAGING_UNSAFE, Boolean.toString(value));
}

/**
* @see OSLC4JConstants#LYO_STORE_PAGING_UNSAFE
* @return the boolean value of org.eclipse.lyo.oslc4j.unsafePaging
* Default is false if not set.

This comment has been minimized.

Copy link
@berezovskyi

berezovskyi Feb 10, 2022

Member

true

*/
public static boolean hasLyoStorePagingPreciseLimit() {
return parseBooleanPropertyOrDefault(OSLC4JConstants.LYO_STORE_PAGING_PRECISE_LIMIT, true);
}

public static void setLyoStorePagingPreciseLimit(boolean value) {
System.setProperty(OSLC4JConstants.LYO_STORE_PAGING_PRECISE_LIMIT, Boolean.toString(value));
}

}

0 comments on commit 706441e

Please sign in to comment.