Skip to content
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

Update doc url #target #108

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ the proxy connects to both Origin and Target clusters.
By default, the proxy will forward read requests only to the Origin cluster, though you can optionally configure it to
forward reads to both clusters asynchronously, while writes will always be sent to both clusters concurrently.

An overview of the proxy architecture and logical flow can be viewed [here](https://docs.datastax.com/en/astra-serverless/docs/migrate/introduction.html#migration-workflow).
An overview of the proxy architecture and logical flow can be viewed [here](https://docs.datastax.com/en/astra-serverless/docs/migrate/introduction.html#_migration_phases).
joao-r-reis marked this conversation as resolved.
Show resolved Hide resolved

## Quick Start

Expand Down
28 changes: 15 additions & 13 deletions integration-tests/virtualization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ func TestVirtualizationTokenAwareness(t *testing.T) {
cqlsh> describe system.local;
#3.11
CREATE TABLE system.local (

key text PRIMARY KEY,
bootstrapped text,
broadcast_address inet,
Expand All @@ -358,21 +359,22 @@ CREATE TABLE system.local (
thrift_version text,
tokens set<text>,
truncated_at map<uuid, blob>

)
cqlsh> describe system.peers;
#3.11
CREATE TABLE system.peers (
peer inet PRIMARY KEY,
data_center text,
host_id uuid,
preferred_ip inet,
rack text,
release_version text,
rpc_address inet,
schema_version uuid,
tokens set<text>
)

cqlsh> describe system.peers;
#3.11
CREATE TABLE system.peers (
peer inet PRIMARY KEY,
data_center text,
host_id uuid,
preferred_ip inet,
rack text,
release_version text,
rpc_address inet,
schema_version uuid,
tokens set<text>
)
*/
func TestInterceptedQueries(t *testing.T) {
testSetup, err := setup.NewSimulacronTestSetupWithSessionAndNodes(t, false, false, 3)
Expand Down
34 changes: 19 additions & 15 deletions proxy/pkg/zdmproxy/queryinspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,25 @@ func (recv *selectClause) GetSelectors() []selector {
}

// selector represents a selector in the cql grammar. 'term' and 'K_CAST' selectors are not supported.
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
//
// unaliasedSelector
// : identifier
// | term
// | K_COUNT '(' '*' ')'
// | K_CAST '(' unaliasedSelector K_AS primitiveType ')'
// ;
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
//
// unaliasedSelector
// : identifier
// | term
// | K_COUNT '(' '*' ')'
// | K_CAST '(' unaliasedSelector K_AS primitiveType ')'
// ;
type selector interface {
Name() string
}

// idSelector represents an unaliased identifier selector:
// unaliasedSelector
// : identifier
//
// unaliasedSelector
// : identifier
type idSelector struct {
name string
}
Expand All @@ -196,7 +198,8 @@ func (recv *idSelector) Name() string {
}

// countSelector represents an unaliased count(*) selector:
// K_COUNT '(' '*' ')'
//
// K_COUNT '(' '*' ')'
type countSelector struct {
name string
}
Expand All @@ -206,9 +209,10 @@ func (recv *countSelector) Name() string {
}

// aliasedSelector represents an unaliased selector combined with an alias:
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
//
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
type aliasedSelector struct {
selector selector
alias string
Expand Down
4 changes: 2 additions & 2 deletions proxy/pkg/zdmproxy/querymodifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func NewQueryModifier(timeUuidGenerator TimeUuidGenerator) *QueryModifier {
}

// replaceQueryString modifies the incoming request in certain conditions:
// * the request is a QUERY or PREPARE
// * and it contains now() function calls
// - the request is a QUERY or PREPARE
// - and it contains now() function calls
func (recv *QueryModifier) replaceQueryString(currentKeyspace string, context *frameDecodeContext) (*frameDecodeContext, []*statementReplacedTerms, error) {
decodedFrame, statementsQueryData, err := context.GetOrDecodeAndInspect(currentKeyspace, recv.timeUuidGenerator)
if err != nil {
Expand Down