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, @NotNull Function<GetAllReferencesBuilder,GetAllReferencesBuilder> builderCustomizer, @NotNull 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 Function<GetCommitLogBuilder,GetCommitLogBuilder> builderCustomizer, @NotNull 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 Function<GetEntriesBuilder,GetEntriesBuilder> builderCustomizer, @NotNull OptionalInt maxRecords)Default implementation to return a stream of objects for a ref, functionally equivalent to callingNessieApiV1.getEntries()with manual paging.static Stream<RefLogResponse.RefLogResponseEntry>getReflogStream(@NotNull NessieApiV1 api, @NotNull Function<GetRefLogBuilder,GetRefLogBuilder> builderCustomizer, @NotNull OptionalInt maxRecords)Default implementation to return a stream of reflog entries, functionally equivalent to callingNessieApiV1.getRefLog()with manual paging.
-
-
-
Method Detail
-
getAllReferencesStream
public static Stream<Reference> getAllReferencesStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull Function<GetAllReferencesBuilder,GetAllReferencesBuilder> builderCustomizer, @NotNull @NotNull OptionalInt maxRecords) throws NessieNotFoundException
Default implementation to return a stream of references, functionally equivalent to callingNessieApiV1.getAllReferences()with manual paging.- Parameters:
api- TheNessieApiV1to usebuilderCustomizer- a Function that takes and returnsGetAllReferencesBuilderthat is passed to the caller of this method. It allows the caller to customize the GetAllReferencesBuilder with additional parameters (e.g.: filter).maxRecords- - a maximum number of records in the stream. If it isOptional.empty()the stream will be unbounded.- Returns:
- stream of
Referenceobjects - Throws:
NessieNotFoundException
-
getEntriesStream
public static Stream<EntriesResponse.Entry> getEntriesStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull Function<GetEntriesBuilder,GetEntriesBuilder> builderCustomizer, @NotNull @NotNull 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:
api- TheNessieApiV1to usebuilderCustomizer- a Function that takes and returnsGetEntriesBuilderthat is passed to the caller of this method. It allows the caller to customize the GetEntriesBuilder with additional parameters (e.g.: hashOnRef, filter).maxRecords- - a maximum number of records in the stream. If it isOptional.empty()the stream will be unbounded.- Returns:
- stream of
EntriesResponse.Entryobjects - Throws:
NessieNotFoundException
-
getCommitLogStream
public static Stream<LogResponse.LogEntry> getCommitLogStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull Function<GetCommitLogBuilder,GetCommitLogBuilder> builderCustomizer, @NotNull @NotNull 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 usebuilderCustomizer- a Function that takes and returnsGetCommitLogBuilderthat is passed to the caller of this method. It allows the caller to customize the GetCommitLogBuilder with additional parameters (e.g.: hashOnRef, untilHash, filter, fetchOption).maxRecords- - a maximum number of records in the stream. If it isOptional.empty()the stream will be unbounded.- Returns:
- stream of
CommitMetaobjects - Throws:
NessieNotFoundException
-
getReflogStream
public static Stream<RefLogResponse.RefLogResponseEntry> getReflogStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull Function<GetRefLogBuilder,GetRefLogBuilder> builderCustomizer, @NotNull @NotNull OptionalInt maxRecords) throws NessieNotFoundException
Default implementation to return a stream of reflog entries, functionally equivalent to callingNessieApiV1.getRefLog()with manual paging.The
Streamreturned bygetReflogStream(OptionalInt.empty()), if not limited, returns all reflog entries.- Parameters:
api- TheNessieApiV1to usebuilderCustomizer- a Function that takes and returnsGetRefLogBuilderthat is passed to the caller of this method. It allows the caller to customize the GetRefLogBuilder with additional parameters (e.g.: fromHash, untilHash, filter).maxRecords- - a maximum number of records in the stream. If it isOptional.empty()the stream will be unbounded.- Returns:
- stream of
RefLogResponse.RefLogResponseEntryobjects - Throws:
NessieNotFoundException
-
-