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

Address translation #624

Merged
merged 57 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
f6f4c6f
Open cloud connection with address translation, treat advertised addr…
dmitrii-ubskii Apr 4, 2024
8cefac4
Cloud address translation basic test
dmitrii-ubskii Apr 4, 2024
bb98855
Cloud address translation FFI
dmitrii-ubskii Apr 4, 2024
ce3e486
Cloud address translation in Java
dmitrii-ubskii Apr 4, 2024
d43c775
disambiguate arraySize in cscode
dmitrii-ubskii Apr 4, 2024
e55be7d
Cloud address translaton in Java cont'd
dmitrii-ubskii Apr 4, 2024
f58d529
test rust network integration tests
dmitrii-ubskii Apr 4, 2024
7895cae
Don't fail on unknown connection address
dmitrii-ubskii Apr 4, 2024
fac499e
Java address mapping test
dmitrii-ubskii Apr 8, 2024
dd8230f
Revert "Open cloud connection with address translation, treat adverti…
dmitrii-ubskii Apr 8, 2024
ecd277d
Post-revert fixes + keep server name instead of address
dmitrii-ubskii Apr 9, 2024
1d4960e
Server ID rather than name
dmitrii-ubskii Apr 9, 2024
bc4c9a9
ServerConnection no longer stores its own id
dmitrii-ubskii Apr 9, 2024
fdfd49e
Open cloud with address translation redux
dmitrii-ubskii Apr 9, 2024
c17499f
test: partial address translation no longer planned
dmitrii-ubskii Apr 9, 2024
2baa1f9
reorder
dmitrii-ubskii Apr 9, 2024
1c9079c
logic fix
dmitrii-ubskii Apr 9, 2024
c5e43c2
fmt
dmitrii-ubskii Apr 9, 2024
7c6c4b5
FFI: crash on length mismatch
dmitrii-ubskii Apr 9, 2024
b412883
unused imports
dmitrii-ubskii Apr 9, 2024
e53c116
java param name
dmitrii-ubskii Apr 9, 2024
0d7aab6
Docs
dmitrii-ubskii Apr 9, 2024
5174450
Rust integration fuller test
dmitrii-ubskii Apr 9, 2024
3547e47
FFI docs
dmitrii-ubskii Apr 9, 2024
20237e6
fmt
dmitrii-ubskii Apr 9, 2024
c74d0fd
new_cloud_address_map => new_cloud_with_translation
dmitrii-ubskii Apr 9, 2024
ab957eb
error message
dmitrii-ubskii Apr 9, 2024
d18658d
replica_info_{get_address => get_server_id}
dmitrii-ubskii Apr 9, 2024
2da9a72
UnknownAddress => UnknownServer, + handle in replica
dmitrii-ubskii Apr 9, 2024
a13c8ef
replica docs
dmitrii-ubskii Apr 9, 2024
550d552
Java: address => serverID
dmitrii-ubskii Apr 9, 2024
912a76c
docs + var names
dmitrii-ubskii Apr 9, 2024
9c51f06
C++: address => serverID
dmitrii-ubskii Apr 9, 2024
55a4c26
C#: address => serverID
dmitrii-ubskii Apr 9, 2024
90f845f
C# address translation
dmitrii-ubskii Apr 10, 2024
0dc7873
C#: address translation test
dmitrii-ubskii Apr 10, 2024
099f711
Java: doc fix
dmitrii-ubskii Apr 10, 2024
94137ae
Address{Mapping => Translation}Test
dmitrii-ubskii Apr 10, 2024
f19c7a6
C#: remove example usage messages
dmitrii-ubskii Apr 10, 2024
883ee39
Python: impl address translation
dmitrii-ubskii Apr 10, 2024
4ee0cc5
C++: test address translation
dmitrii-ubskii Apr 10, 2024
93b14c0
rustfmt
dmitrii-ubskii Apr 10, 2024
68f4ece
Replica::server_id => server
dmitrii-ubskii Apr 10, 2024
d9405d8
Python: address => server
dmitrii-ubskii Apr 10, 2024
bcd45ec
NodeJS: implement and test translation
dmitrii-ubskii Apr 10, 2024
d6e626c
test names + factory CI
dmitrii-ubskii Apr 11, 2024
14b814c
3 servers in Cloud integration tests
dmitrii-ubskii Apr 11, 2024
69762f7
Fix C# test
dmitrii-ubskii Apr 11, 2024
3cdac7a
note
dmitrii-ubskii Apr 11, 2024
118f1c9
fix override docs
dmitrii-ubskii Apr 11, 2024
47fa63a
NodeJS: replica address => server
dmitrii-ubskii Apr 11, 2024
0862dd9
docs
dmitrii-ubskii Apr 11, 2024
9e51989
emph equal array sizes in C driver
dmitrii-ubskii Apr 11, 2024
71a271d
Java: serverID => server
dmitrii-ubskii Apr 11, 2024
c196f9a
Rust: server_id => server
dmitrii-ubskii Apr 11, 2024
5649de2
Clean up rust doc
dmitrii-ubskii Apr 11, 2024
1840c61
fix node failover test
dmitrii-ubskii Apr 11, 2024
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
Prev Previous commit
Next Next commit
FFI: crash on length mismatch
  • Loading branch information
dmitrii-ubskii committed Apr 9, 2024
commit 7c6c4b51be74cdf4c92feaf9083b7d2e8748b9ed
6 changes: 3 additions & 3 deletions c/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* under the License.
*/

use std::{collections::HashMap, ffi::c_char, path::Path};
use std::{ffi::c_char, path::Path};

use itertools::Itertools;
use typedb_driver::{Connection, Credential};

use super::{
Expand Down Expand Up @@ -62,8 +63,7 @@ pub extern "C" fn connection_open_cloud_translated(
translated_addresses: *const *const c_char,
credential: *const Credential,
) -> *mut Connection {
let addresses: HashMap<&str, &str> =
string_array_view(advertised_addresses).zip(string_array_view(translated_addresses)).collect();
let addresses = string_array_view(advertised_addresses).zip_eq(string_array_view(translated_addresses)).collect();
try_release(Connection::new_cloud_address_map(addresses, borrow(credential).clone()))
}

Expand Down