Package org.projectnessie.client
Class StreamingUtil
- java.lang.Object
-
- org.projectnessie.client.StreamingUtil
-
public final class StreamingUtil extends Object
Helper and utility methods around streaming ofNessieApiV1et al.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<Reference>getAllReferencesStream(@NotNull NessieApiV1 api, OptionalInt maxRecords)Default implementation to return a stream of references, functionally equivalent to callingNessieApiV1.getAllReferences()with manual paging.static Stream<LogResponse.LogEntry>getCommitLogStream(@NotNull NessieApiV1 api, @NotNull String ref, String hashOnRef, String untilHash, String queryExpression, OptionalInt maxRecords)Default implementation to return a stream of commit-log entries, functionally equivalent to callingNessieApiV1.getCommitLog()with manual paging.static Stream<EntriesResponse.Entry>getEntriesStream(@NotNull NessieApiV1 api, @NotNull String ref, String hashOnRef, String queryExpression, OptionalInt maxRecords)Default implementation to return a stream of objects for a ref, functionally equivalent to callingNessieApiV1.getEntries()with manual paging.
-
-
-
Method Detail
-
getAllReferencesStream
public static Stream<Reference> getAllReferencesStream(@NotNull @NotNull NessieApiV1 api, OptionalInt maxRecords) throws NessieNotFoundException
Default implementation to return a stream of references, functionally equivalent to callingNessieApiV1.getAllReferences()with manual paging.- Returns:
- stream of
Referenceobjects - Throws:
NessieNotFoundException
-
getEntriesStream
public static Stream<EntriesResponse.Entry> getEntriesStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull String ref, @Nullable String hashOnRef, @Nullable String queryExpression, OptionalInt maxRecords) throws NessieNotFoundException
Default implementation to return a stream of objects for a ref, functionally equivalent to callingNessieApiV1.getEntries()with manual paging.The
Streamreturned bygetEntriesStream(ref, OptionalInt.empty()), if not limited, returns all commit-log entries.- Parameters:
ref- a named reference (branch or tag name) or a commit-hash- Returns:
- stream of
EntriesResponse.Entryobjects - Throws:
NessieNotFoundException
-
getCommitLogStream
public static Stream<LogResponse.LogEntry> getCommitLogStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull String ref, @Nullable String hashOnRef, @Nullable String untilHash, @Nullable String queryExpression, OptionalInt maxRecords) throws NessieNotFoundException
Default implementation to return a stream of commit-log entries, functionally equivalent to callingNessieApiV1.getCommitLog()with manual paging.The
Streamreturned bygetCommitLogStream(ref, OptionalInt.empty()), if not limited, returns all commit-log entries.- Parameters:
api- TheNessieApiV1to useref- a named reference (branch or tag name) or a commit-hash- Returns:
- stream of
CommitMetaobjects - Throws:
NessieNotFoundException
-
-