Interface TreeApi
-
- All Known Subinterfaces:
HttpTreeApi
public interface TreeApiInterface for working with "trees", that is with collections of contents at a particular point in the change history, organized in trees by their respective namespaces.A tree is identified by a reference (branch, tag or a "detached" commit hash).
Only branches and tags can be created / deleted / assigned via respective "*Reference" methods. Commits cannot be deleted and get created via commit / merge / transplant operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SingleReferenceResponseassignReference(Reference.ReferenceType type, @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String reference, @Valid @NotNull Reference assignTo)Update a reference's HEAD to point to a different commit.CommitResponsecommitMultipleOperations(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String branch, @Valid @NotNull Operations operations)Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit.SingleReferenceResponsecreateReference(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\'") java.lang.String name, Reference.ReferenceType type, @Valid Reference sourceRef)Create a new reference.SingleReferenceResponsedeleteReference(Reference.ReferenceType type, @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String reference)Delete a named reference.ReferencesResponsegetAllReferences(ReferencesParams params)Get all references.LogResponsegetCommitLog(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String ref, @Valid @NotNull CommitLogParams params)Retrieve the commit log for a ref, potentially truncated by the backend.ContentResponsegetContent(@Valid ContentKey key, @Valid @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String ref)DiffResponsegetDiff(@Valid @NotNull DiffParams params)Returns a set of content differences between two given references.EntriesResponsegetEntries(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String refName, @Valid @NotNull EntriesParams params)Retrieve objects for a ref, potentially truncated by the backend.GetMultipleContentsResponsegetMultipleContents(@Valid @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String ref, @Valid @NotNull GetMultipleContentsRequest request)Similar togetContent(ContentKey, String), but takes multipleContentKeys and returns theContentfor the one or moreContentKeys in a named-reference (aBranchorTag).SingleReferenceResponsegetReferenceByName(@Valid @NotNull GetReferenceParams params)Get details of a particular ref, if it exists.MergeResponsemergeRefIntoBranch(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String branch, @Valid @NotNull Merge merge)Merge commits from any reference onto a branch.MergeResponsetransplantCommitsIntoBranch(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String branch, @Valid Transplant transplant)Cherry-pick a set of commits into a branch.
-
-
-
Method Detail
-
getAllReferences
ReferencesResponse getAllReferences(ReferencesParams params)
Get all references.- Returns:
- A
ReferencesResponseinstance containing all references.
-
createReference
SingleReferenceResponse createReference(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\'") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\'") java.lang.String name, @Valid @NotNull Reference.ReferenceType type, @Valid @Nullable @Valid Reference sourceRef) throws NessieNotFoundException, NessieConflictException
Create a new reference.The type of
reference, which can be either aBranchorTag, determines the type of the reference to be created.Reference.getName()defines the name of the reference to be created,Reference.getHash()is the hash of the created reference, the HEAD of the created reference.sourceRefNameis the name of the reference which containsReference.getHash(), and must be present ifReference.getHash()is present.Specifying no
Reference.getHash()means that the new reference will be created "at the beginning of time".
-
getReferenceByName
SingleReferenceResponse getReferenceByName(@Valid @NotNull @Valid @NotNull GetReferenceParams params) throws NessieNotFoundException
Get details of a particular ref, if it exists.- Throws:
NessieNotFoundException
-
getEntries
EntriesResponse getEntries(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String refName, @Valid @NotNull @Valid @NotNull EntriesParams params) throws NessieNotFoundException
Retrieve objects for a ref, potentially truncated by the backend.Retrieves up to
maxRecordsobjects for the given named reference (tag or branch). The backend may respect the givenmaxrecords hint, but return less or more entries. Backends may also cap the returned entries at a hard-coded limit, the default REST server implementation has such a hard-coded limit.Invoking
getEntries()does not guarantee to return all commit log entries of a given reference, because the result can be truncated by the backend.To implement paging, check
EntriesResponse.isHasMore()and, iftrue, pass the value ofEntriesResponse.getToken()in the next invocation ofgetEntries()as thepageTokenparameter.See
org.projectnessie.client.StreamingUtilinnessie-client.- Throws:
NessieNotFoundException
-
getCommitLog
LogResponse getCommitLog(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String ref, @Valid @NotNull @Valid @NotNull CommitLogParams params) throws NessieNotFoundException
Retrieve the commit log for a ref, potentially truncated by the backend.Retrieves up to
maxRecordscommit-log-entries starting at the HEAD of the given named reference (tag or branch). The backend may respect the givenmaxrecords hint, but return less or more entries. Backends may also cap the returned entries at a hard-coded limit, the default REST server implementation has such a hard-coded limit.Invoking
getCommitLog()does not guarantee to return all commit log entries of a given reference, because the result can be truncated by the backend.To implement paging, check
LogResponse.isHasMore()and, iftrue, pass the value ofLogResponse.getToken()in the next invocation ofgetCommitLog()as thepageTokenparameter.See
org.projectnessie.client.StreamingUtilinnessie-client.- Throws:
NessieNotFoundException
-
getDiff
DiffResponse getDiff(@Valid @NotNull @Valid @NotNull DiffParams params) throws NessieNotFoundException
Returns a set of content differences between two given references.- Parameters:
params- TheDiffParamsthat includes the parameters for this API call.- Returns:
- A set of diff values that show the difference between two given references.
- Throws:
NessieNotFoundException
-
assignReference
SingleReferenceResponse assignReference(@Valid Reference.ReferenceType type, @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String reference, @Valid @NotNull @Valid @NotNull Reference assignTo) throws NessieNotFoundException, NessieConflictException
Update a reference's HEAD to point to a different commit.- Parameters:
type- Optional expected type of reference being assigned. Will be validated if present.- Throws:
NessieNotFoundExceptionNessieConflictException
-
deleteReference
SingleReferenceResponse deleteReference(@Valid Reference.ReferenceType type, @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String reference) throws NessieConflictException, NessieNotFoundException
Delete a named reference.- Parameters:
type- Optional expected type of reference being deleted. Will be validated if present.- Throws:
NessieConflictExceptionNessieNotFoundException
-
transplantCommitsIntoBranch
MergeResponse transplantCommitsIntoBranch(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String branch, @Valid @Valid Transplant transplant) throws NessieNotFoundException, NessieConflictException
Cherry-pick a set of commits into a branch.
-
mergeRefIntoBranch
MergeResponse mergeRefIntoBranch(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String branch, @Valid @NotNull @Valid @NotNull Merge merge) throws NessieNotFoundException, NessieConflictException
Merge commits from any reference onto a branch.
-
commitMultipleOperations
CommitResponse commitMultipleOperations(@Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @NotNull @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String branch, @Valid @NotNull @Valid @NotNull Operations operations) throws NessieNotFoundException, NessieConflictException
Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit. The hash in the successful response contains the hash of the commit that contains the operations of the invocation.- Parameters:
branch- Branch to change, defaults to default branch.operations-Operationsto apply- Returns:
- updated
Branchobjects with the hash of the new HEAD - Throws:
NessieNotFoundException- ifbranchNamecould not be foundNessieConflictException- if the operations could not be applied to some conflict, which is either caused by a conflicting commit or concurrent commits.
-
getContent
ContentResponse getContent(@Valid @Valid ContentKey key, @Valid @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String ref) throws NessieNotFoundException
This operation returns theContentfor aContentKeyin a named-reference (aBranchorTag).If the table-metadata is tracked globally (Iceberg), Nessie returns a
Contentobject, that contains the most up-to-date part for the globally tracked part (Iceberg: table-metadata) plus the per-Nessie-reference/hash specific part (Iceberg: snapshot-ID, schema-ID, partition-spec-ID, default-sort-order-ID).- Parameters:
key- theContentKeys to retrieveref- named-reference to retrieve the content for- Returns:
- list of
GetMultipleContentsResponse.ContentWithKeys - Throws:
NessieNotFoundException- ifreforhashOnRefdoes not exist
-
getMultipleContents
GetMultipleContentsResponse getMultipleContents(@Valid @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") @Valid @Pattern(regexp="^([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?(@([0-9a-fA-F]{8,64})?)?|@[0-9a-fA-F]{8,64})|-$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a commit hash, which must consist of the hex representation of 4-32 bytes") java.lang.String ref, @Valid @NotNull @Valid @NotNull GetMultipleContentsRequest request) throws NessieNotFoundException
Similar togetContent(ContentKey, String), but takes multipleContentKeys and returns theContentfor the one or moreContentKeys in a named-reference (aBranchorTag).If the table-metadata is tracked globally (Iceberg), Nessie returns a
Contentobject, that contains the most up-to-date part for the globally tracked part (Iceberg: table-metadata) plus the per-Nessie-reference/hash specific part (Iceberg: snapshot-id, schema-id, partition-spec-id, default-sort-order-id).- Parameters:
ref- named-reference to retrieve the content forrequest- theContentKeys to retrieve- Returns:
- list of
GetMultipleContentsResponse.ContentWithKeys - Throws:
NessieNotFoundException- ifreforhashOnRefdoes not exist
-
-