-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Remote vtables #4375
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
Open
belliottsmith
wants to merge
6
commits into
apache:trunk
Choose a base branch
from
belliottsmith:remote-vtables
base: trunk
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
Remote vtables #4375
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
09b5266
Accord: Add Rebootstrap and unsafe Bootstrap
ifesdjeen add004b
Lazy Virtual Tables
belliottsmith 1ccec48
- Support mutable lazy vtables and port remaining accord tables
belliottsmith 03d5e79
RemoteToLocalVirtualKeyspace: supporting access to all nodes' local v…
belliottsmith 958ba39
Imports
ifesdjeen 12d3157
Add distributed test
ifesdjeen 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 hidden or 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[submodule "modules/accord"] | ||
path = modules/accord | ||
url = https://github.com/apache/cassandra-accord.git | ||
branch = trunk | ||
url = https://github.com/belliottsmith/cassandra-accord.git | ||
branch = rebootstrap-sq |
Submodule accord
updated
94 files
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
import org.apache.cassandra.io.util.DataOutputPlus; | ||
import org.apache.cassandra.schema.ColumnMetadata; | ||
import org.apache.cassandra.schema.TableMetadata; | ||
import org.apache.cassandra.utils.btree.BTree; | ||
|
||
/** | ||
* Represents which (non-PK) columns (and optionally which sub-part of a column for complex columns) are selected | ||
|
@@ -64,7 +65,6 @@ | |
*/ | ||
public abstract class ColumnFilter | ||
{ | ||
|
||
public static final ColumnFilter NONE = selection(RegularAndStaticColumns.NONE); | ||
|
||
public static final Serializer serializer = new Serializer(); | ||
|
@@ -305,6 +305,11 @@ public boolean isWildcard() | |
return false; | ||
} | ||
|
||
/** | ||
* Rebinds matching columns into a new filter; ignores any missing but fails if any are a different type | ||
*/ | ||
public abstract ColumnFilter rebind(TableMetadata newTable); | ||
|
||
/** | ||
* Returns the CQL string corresponding to this {@code ColumnFilter}. | ||
* | ||
|
@@ -630,6 +635,12 @@ public boolean isWildcard() | |
return true; | ||
} | ||
|
||
@Override | ||
public ColumnFilter rebind(TableMetadata newTable) | ||
{ | ||
return new WildCardColumnFilter(ColumnFilter.rebind(newTable, fetchedAndQueried)); | ||
} | ||
|
||
@Override | ||
protected SortedSetMultimap<ColumnIdentifier, ColumnSubselection> subSelections() | ||
{ | ||
|
@@ -779,6 +790,17 @@ public Tester newTester(ColumnMetadata column) | |
return new Tester(fetchingStrategy.fetchesAllColumns(column.isStatic()), s.iterator()); | ||
} | ||
|
||
@Override | ||
public ColumnFilter rebind(TableMetadata newTable) | ||
{ | ||
RegularAndStaticColumns queried = ColumnFilter.rebind(newTable, this.queried); | ||
RegularAndStaticColumns fetched = this.queried == this.fetched ? queried : ColumnFilter.rebind(newTable, this.fetched); | ||
SortedSetMultimap<ColumnIdentifier, ColumnSubselection> subSelections = this.subSelections; | ||
if (subSelections != null) | ||
subSelections = TreeMultimap.create(subSelections); | ||
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. Could you elaborate, why we need to re-wrap this? I thought this should be effectively immutable. |
||
return new SelectionColumnFilter(fetchingStrategy, queried, fetched, subSelections); | ||
} | ||
|
||
@Override | ||
protected SortedSetMultimap<ColumnIdentifier, ColumnSubselection> subSelections() | ||
{ | ||
|
@@ -1003,4 +1025,26 @@ private long subSelectionsSerializedSize(SortedSetMultimap<ColumnIdentifier, Col | |
return size; | ||
} | ||
} | ||
|
||
private static RegularAndStaticColumns rebind(TableMetadata newTable, RegularAndStaticColumns columns) | ||
{ | ||
return new RegularAndStaticColumns(rebind(newTable, columns.statics), rebind(newTable, columns.regulars)); | ||
} | ||
|
||
private static Columns rebind(TableMetadata newTable, Columns columns) | ||
{ | ||
if (columns.isEmpty()) | ||
return columns; | ||
|
||
try (BTree.FastBuilder<ColumnMetadata> builder = BTree.fastBuilder()) | ||
{ | ||
for (ColumnMetadata in : columns) | ||
{ | ||
ColumnMetadata out = newTable.getColumn(in.name); | ||
if (out != null) | ||
builder.add(out); | ||
} | ||
return Columns.from(builder); | ||
} | ||
} | ||
} |
This file contains hidden or 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 hidden or 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.
Seems like a dangerous feature to generally expose. Could we add an assert that this is for virtual tables only, and add a comment that this is not for general use?