Skip to content

Commit

Permalink
Update doc url #target (#108)
Browse files Browse the repository at this point in the history
Co-authored-by: João Reis <joao.r.reis@outlook.com>
Co-authored-by: Madhavan <msmygit@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 6, 2024
1 parent f893984 commit b303698
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
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/data-migration/introduction.html#migration-phases).

## 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

0 comments on commit b303698

Please sign in to comment.