Package org.projectnessie.client.builder
Class StreamingUtil
- java.lang.Object
-
- org.projectnessie.client.builder.StreamingUtil
-
public final class StreamingUtil extends java.lang.ObjectHelper and utility methods around streaming ofNessieApiV1et al.Use the functions that return
Streams in the builders that implementPagingBuilder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceStreamingUtil.NextPage<R>
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <ENTRY,RESP extends org.projectnessie.model.PaginatedResponse>
java.util.stream.Stream<ENTRY>generateStream(java.util.function.Function<RESP,java.util.List<ENTRY>> entriesExtractor, StreamingUtil.NextPage<RESP> pageFetcher)static java.util.stream.Stream<org.projectnessie.model.Reference>getAllReferencesStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull java.util.function.Function<GetAllReferencesBuilder,GetAllReferencesBuilder> builderCustomizer, @NotNull @NotNull java.util.OptionalInt pageSizeHint)Deprecated.static java.util.stream.Stream<org.projectnessie.model.LogResponse.LogEntry>getCommitLogStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull java.util.function.Function<GetCommitLogBuilder,GetCommitLogBuilder> builderCustomizer, @NotNull @NotNull java.util.OptionalInt pageSizeHint)Deprecated.static java.util.stream.Stream<org.projectnessie.model.EntriesResponse.Entry>getEntriesStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull java.util.function.Function<GetEntriesBuilder,GetEntriesBuilder> builderCustomizer, @NotNull @NotNull java.util.OptionalInt pageSizeHint)Deprecated.static java.util.stream.Stream<org.projectnessie.model.RefLogResponse.RefLogResponseEntry>getReflogStream(@NotNull @NotNull NessieApiV1 api, @NotNull @NotNull java.util.function.Function<GetRefLogBuilder,GetRefLogBuilder> builderCustomizer, @NotNull @NotNull java.util.OptionalInt pageSizeHint)Deprecated.
-
-
-
Method Detail
-
getAllReferencesStream
@Deprecated public static java.util.stream.Stream<org.projectnessie.model.Reference> getAllReferencesStream(@NotNull @NotNull @NotNull @NotNull NessieApiV1 api, @NotNull @NotNull @NotNull @NotNull java.util.function.Function<GetAllReferencesBuilder,GetAllReferencesBuilder> builderCustomizer, @NotNull @NotNull @NotNull @NotNull java.util.OptionalInt pageSizeHint) throws org.projectnessie.error.NessieNotFoundExceptionDeprecated.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).pageSizeHint- A hint sent to the Nessie server to return no more than this amount of entries in a single response, the server may decide to ignore this hint or return more or less results. UseOptionalInt.empty()to omit the hint.- Returns:
- stream of
Referenceobjects - Throws:
org.projectnessie.error.NessieNotFoundException
-
getEntriesStream
@Deprecated public static java.util.stream.Stream<org.projectnessie.model.EntriesResponse.Entry> getEntriesStream(@NotNull @NotNull @NotNull @NotNull NessieApiV1 api, @NotNull @NotNull @NotNull @NotNull java.util.function.Function<GetEntriesBuilder,GetEntriesBuilder> builderCustomizer, @NotNull @NotNull @NotNull @NotNull java.util.OptionalInt pageSizeHint) throws org.projectnessie.error.NessieNotFoundExceptionDeprecated.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).pageSizeHint- A hint sent to the Nessie server to return no more than this amount of entries in a single response, the server may decide to ignore this hint or return more or less results. UseOptionalInt.empty()to omit the hint.- Returns:
- stream of
EntriesResponse.Entryobjects - Throws:
org.projectnessie.error.NessieNotFoundException
-
getCommitLogStream
@Deprecated public static java.util.stream.Stream<org.projectnessie.model.LogResponse.LogEntry> getCommitLogStream(@NotNull @NotNull @NotNull @NotNull NessieApiV1 api, @NotNull @NotNull @NotNull @NotNull java.util.function.Function<GetCommitLogBuilder,GetCommitLogBuilder> builderCustomizer, @NotNull @NotNull @NotNull @NotNull java.util.OptionalInt pageSizeHint) throws org.projectnessie.error.NessieNotFoundExceptionDeprecated.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).pageSizeHint- A hint sent to the Nessie server to return no more than this amount of entries in a single response, the server may decide to ignore this hint or return more or less results. UseOptionalInt.empty()to omit the hint.- Returns:
- stream of
CommitMetaobjects - Throws:
org.projectnessie.error.NessieNotFoundException
-
getReflogStream
@Deprecated public static java.util.stream.Stream<org.projectnessie.model.RefLogResponse.RefLogResponseEntry> getReflogStream(@NotNull @NotNull @NotNull @NotNull NessieApiV1 api, @NotNull @NotNull @NotNull @NotNull java.util.function.Function<GetRefLogBuilder,GetRefLogBuilder> builderCustomizer, @NotNull @NotNull @NotNull @NotNull java.util.OptionalInt pageSizeHint) throws org.projectnessie.error.NessieNotFoundExceptionDeprecated.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).pageSizeHint- A hint sent to the Nessie server to return no more than this amount of entries in a single response, the server may decide to ignore this hint or return more or less results. UseOptionalInt.empty()to omit the hint.- Returns:
- stream of
RefLogResponse.RefLogResponseEntryobjects - Throws:
org.projectnessie.error.NessieNotFoundException
-
generateStream
public static <ENTRY,RESP extends org.projectnessie.model.PaginatedResponse> java.util.stream.Stream<ENTRY> generateStream(java.util.function.Function<RESP,java.util.List<ENTRY>> entriesExtractor, StreamingUtil.NextPage<RESP> pageFetcher) throws org.projectnessie.error.NessieNotFoundException- Throws:
org.projectnessie.error.NessieNotFoundException
-
-