-
Notifications
You must be signed in to change notification settings - Fork 199
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
Added freshness aware table loading using entityId:entityVersion for ETag #1037
Open
mansehajsingh
wants to merge
12
commits into
apache:main
Choose a base branch
from
mansehajsingh:implement-freshness-aware-table-loading
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
39e0ea4
Pulled in iceberg 1.8.0 spec changes for freshness aware table loadin…
mansehajsingh 0ef4de8
Changed etag support to use entityId:version tuple
mansehajsingh bb82f56
Merge remote-tracking branch 'origin/main' into implement-freshness-a…
mansehajsingh 44b1859
fixed getresponse call
mansehajsingh ab27b82
Merge remote-tracking branch 'origin/main' into implement-freshness-a…
mansehajsingh be3da8d
Changed etagged response to record and gave default implementation to…
mansehajsingh e96bbdb
Made iceberg rest spec docs clearer
mansehajsingh 772c715
Added HTTP Compliant ETag and IfNoneMatch representations and separat…
mansehajsingh 662f24a
Changed ETag to be a record and improved semantics of IfNoneMatch
mansehajsingh 652cc08
Fixed semantics of if none match
mansehajsingh 2c4fd1b
Removed ETag representation, consolidated in IfNoneMatch
mansehajsingh 3b4e553
fixed if none match parsing
mansehajsingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
46 changes: 46 additions & 0 deletions
46
polaris-core/src/main/java/org/apache/polaris/core/entity/ETaggableEntity.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,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.apache.polaris.core.entity; | ||
|
||
import net.minidev.json.annotate.JsonIgnore; | ||
|
||
/** | ||
* Entities that can expose an ETag that can uniquely identify their current state. | ||
*/ | ||
public interface ETaggableEntity { | ||
|
||
/** | ||
* Obtain an ETag that uniquely identifies the current state of the entity. | ||
* @return the ETag | ||
*/ | ||
@JsonIgnore | ||
String getETag(); | ||
|
||
/** | ||
* Determines if the provided etag identifies the current version of the entity. | ||
* @param etag The etag to compare the entity against | ||
* @return true if the etag identifies the current state of the entity, false otherwise | ||
*/ | ||
@JsonIgnore | ||
default boolean isCurrent(String etag) { | ||
return getETag().equals(etag); | ||
} | ||
|
||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface mixes REST/HTTP concerns w/ persistence concerns. Please remove the ETag functionality from persistence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed! Removed all references to it in the persistence layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this separation is wise. Besides the fact that it complicates the code, we'll eventually want to expose etag semantics to the persistence layer in some form. i.e. if the entity an etag refers to is indeed still in the version specified in the etag, we don't need to pull the entity out of the metastore at all.