-
Notifications
You must be signed in to change notification settings - Fork 170
Fix global and on-reference state #2313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,14 +28,14 @@ | |
| * Represents the state of an Iceberg table in Nessie. An Iceberg table is globally identified via | ||
| * its {@link Contents#getId() unique ID}. | ||
| * | ||
| * <p>The Iceberg-table-state consists of the location to the table-metadata and the snapshot-ID. | ||
| * <p>The Iceberg-table-state consists of the location to the table-metadata and the state of the ID | ||
| * generators using the serialized version of Iceberg's {@code TableIdGenerators} object. | ||
| * | ||
| * <p>The table-metadata-location is managed globally within Nessie, which means that all versions | ||
| * of the same table share the table-metadata across all named-references (branches and tags). There | ||
| * is only one version, the current version, of Iceberg's table-metadata. | ||
| * <p>The table-metadata-location is managed on each Nessie reference, which means that all versions | ||
| * of the same table have distinct table-metadata across all named-references (branches and tags). | ||
| * | ||
| * <p>Within each named-reference (branch or tag), the (current) Iceberg-snapshot-ID will be | ||
| * different. In other words: changes to an Iceberg table update the snapshot-ID. | ||
| * <p>The information needed to generate IDs for an Iceberg table that need to be globally unique, | ||
| * for example the last-column-ID, is managed globally within Nessie. | ||
| * | ||
| * <p>When adding a new table (aka contents-object identified by a contents-id), use a {@link | ||
| * org.projectnessie.model.Operation.Put} without an expected-value. In all other cases (updating an | ||
|
|
@@ -69,20 +69,20 @@ public abstract class IcebergTable extends Contents { | |
| @NotBlank | ||
| public abstract String getMetadataLocation(); | ||
|
|
||
| /** ID of the current Iceberg snapshot. This value is not present, if there is no snapshot. */ | ||
| public abstract long getSnapshotId(); | ||
| /** Opaque representation of Iceberg's {@code TableIdGenerators}. */ | ||
| public abstract String getIdGenerators(); | ||
|
|
||
| public static IcebergTable of(String metadataLocation, long snapshotId) { | ||
| public static IcebergTable of(String metadataLocation, String idGenerators) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happened to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we handle going back to an old snapshot now?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either you refer to a specific Nessie commit (as before) or you use Iceberg's time-travel functionality.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The table-metadata's tracked now (again) - so it's currentSnapshotId is the one |
||
| return ImmutableIcebergTable.builder() | ||
| .metadataLocation(metadataLocation) | ||
| .snapshotId(snapshotId) | ||
| .idGenerators(idGenerators) | ||
| .build(); | ||
| } | ||
|
|
||
| public static IcebergTable of(String metadataLocation, long snapshotId, String contentsId) { | ||
| public static IcebergTable of(String metadataLocation, String idGenerators, String contentsId) { | ||
| return ImmutableIcebergTable.builder() | ||
| .metadataLocation(metadataLocation) | ||
| .snapshotId(snapshotId) | ||
| .idGenerators(idGenerators) | ||
| .id(contentsId) | ||
| .build(); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.