public YtdbRemoteGraphProvider()

in ytdb/src/main/java/com/youtrackdb/ldbc/ytdb/YtdbRemoteGraphProvider.java [27:55]


    public YtdbRemoteGraphProvider(@Named("properties") Map<String, String> properties) {
        String host = properties.get("ytdb.host");
        Integer port = Optional.ofNullable(properties.get("ytdb.port")).map(Integer::parseInt).orElse(8182);
        String database = properties.get("ytdb.database");
        String username = properties.get("ytdb.username");
        String password = properties.get("ytdb.password");

        var serializer = new GraphBinaryMessageSerializerV1();
        var config = new HashMap<String, Object>();
        var registries = List.of(
                YTDBIoRegistry.class.getName(),
                TinkerIoRegistryV3.class.getName()
        );

        config.put(AbstractMessageSerializer.TOKEN_IO_REGISTRIES, registries);
        serializer.configure(config, Collections.emptyMap());

        cluster = Cluster.build()
                .addContactPoint(host)
                .port(port)
                .credentials(username, password)
                .serializer(serializer)
                .channelizer(YTDBDriverWebSocketChannelizer.class)
                .create();

        traversal = AnonymousTraversalSource
                .traversal(YTDBGraphTraversalSource.class)
                .with(DriverRemoteConnection.using(cluster, database));
    }