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

Cloud address translation #241

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

dmitrii-ubskii
Copy link
Member

@dmitrii-ubskii dmitrii-ubskii commented Apr 17, 2024

Usage and product changes

We allow connection to the cloud servers using an address translation mapping (cf. typedb/typedb-driver#624). This is useful when the route from the user to the servers differs from the route the servers are configured with (e.g. connection to public-facing servers from an internal network).

Example usage:

console \
    --cloud=typedb1.domain.com:1729=typedb.local:11729,typedb2.domain.com:1729=typedb.local:21729 \
    --username=<user> --password=<password>

or:

console \
    --cloud=typedb1.domain.com:1729=typedb.local:11729 \
    --cloud=typedb2.domain.com:1729=typedb.local:21729 \
    --username=<user> --password=<password>

Note: we currently require that the user provides translation for the addresses of all nodes in the Cloud deployment.

Implementation

We also update the license headers and file from AGPL to MPL 2.0.

Comment on lines -99 to +88
colorJsonKey("address: ") + replica.address() + ";" +
colorJsonKey(" server: ") + replica.server() + ";" +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to reflect changes in driver

Comment on lines -501 to +492
TypeDBDriver driver = null;
try {
TypeDBDriver driver;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this version, driver is never null

Comment on lines 515 to 517
System.exit(1);
return null; // unreachable, but needed to satisfy the compiler
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java compiler doesn't understand that System.exit() diverges.

Comment on lines -505 to -507
} else {
String optCloud = options.cloud();
if (optCloud != null) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flattened

Comment on lines +868 to +871
split = ","
)
private @Nullable
String cloud;
String[] cloud;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

picocli treats --cloud=1,2,3 --cloud=4 as [1, 2, 3, 4] with these settings.

TypeDBConsole.java Outdated Show resolved Hide resolved
@dmitrii-ubskii dmitrii-ubskii changed the title Address translation Cloud address translation Apr 17, 2024
@dmitrii-ubskii dmitrii-ubskii merged commit 57ab13d into typedb:development Apr 17, 2024
3 checks passed
@dmitrii-ubskii dmitrii-ubskii deleted the address-translation branch April 17, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants