-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storage: record previous HEADs of named references
Persisted `Reference`s now keep a history of previous HEADs, limited in size and age, defaults to up to 20 elementa with a maximum age of 300 seconds.
- Loading branch information
Showing
45 changed files
with
1,225 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
api/model/src/main/java/org/projectnessie/model/CommitConsistency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (C) 2023 Dremio | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.projectnessie.model; | ||
|
||
public enum CommitConsistency { | ||
/** Consistency of the commit was not checked. */ | ||
NOT_CHECKED, | ||
/** | ||
* The commit is inconsistent in a way that makes it impossible to access the commit, for example | ||
* if the commit object itself or its index information is missing. | ||
*/ | ||
COMMIT_INCONSISTENT, | ||
/** | ||
* The commit object is present and its index is accessible, but some content reachable from the | ||
* commit is not present. | ||
*/ | ||
COMMIT_CONTENT_INCONSISTENT, | ||
/** The commit object, its index information and all reachable content is present. */ | ||
COMMIT_CONSISTENT | ||
} |
21 changes: 21 additions & 0 deletions
21
api/model/src/main/java/org/projectnessie/model/ReferenceHistory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (C) 2023 Dremio | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.projectnessie.model; | ||
|
||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
public interface ReferenceHistory {} |
70 changes: 70 additions & 0 deletions
70
api/model/src/main/java/org/projectnessie/model/ReferenceHistoryResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (C) 2020 Dremio | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.projectnessie.model; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import java.util.List; | ||
import javax.annotation.Nullable; | ||
import javax.validation.constraints.NotNull; | ||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
import org.immutables.value.Value; | ||
|
||
@Schema(type = SchemaType.OBJECT, title = "ReferenceHistoryResponse") | ||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableReferenceHistoryResponse.class) | ||
@JsonDeserialize(as = ImmutableReferenceHistoryResponse.class) | ||
public interface ReferenceHistoryResponse { | ||
|
||
static ImmutableReferenceHistoryResponse.Builder builder() { | ||
return ImmutableReferenceHistoryResponse.builder(); | ||
} | ||
|
||
@NotNull | ||
@jakarta.validation.constraints.NotNull | ||
Reference getReference(); | ||
|
||
@NotNull | ||
@jakarta.validation.constraints.NotNull | ||
ReferenceHistoryState current(); | ||
|
||
@NotNull | ||
@jakarta.validation.constraints.NotNull | ||
List<ReferenceHistoryState> previous(); | ||
|
||
@Schema(type = SchemaType.OBJECT, title = "ReferenceHistoryState") | ||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableReferenceHistoryState.class) | ||
@JsonDeserialize(as = ImmutableReferenceHistoryState.class) | ||
interface ReferenceHistoryState { | ||
@Value.Parameter(order = 1) | ||
String pointer(); | ||
|
||
@Value.Parameter(order = 2) | ||
CommitConsistency commitConsistency(); | ||
|
||
@Value.Parameter(order = 3) | ||
@Nullable | ||
@jakarta.annotation.Nullable | ||
CommitMeta meta(); | ||
|
||
static ReferenceHistoryState referenceHistoryElement( | ||
String pointer, CommitConsistency commitConsistency, CommitMeta meta) { | ||
return ImmutableReferenceHistoryState.of(pointer, commitConsistency, meta); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
versioned/spi/src/main/java/org/projectnessie/versioned/CommitConsistency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (C) 2023 Dremio | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.projectnessie.versioned; | ||
|
||
public enum CommitConsistency { | ||
/** Consistency of the commit was not checked. */ | ||
NOT_CHECKED, | ||
/** | ||
* The commit is inconsistent in a way that makes it impossible to access the commit, for example | ||
* if the commit object itself or its index information is missing. | ||
*/ | ||
COMMIT_INCONSISTENT, | ||
/** | ||
* The commit object is present and its index is accessible, but some content reachable from the | ||
* commit is not present. | ||
*/ | ||
COMMIT_CONTENT_INCONSISTENT, | ||
/** The commit object, its index information and all reachable content is present. */ | ||
COMMIT_CONSISTENT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.