neo4j-ruby-driver 5.7.0.alpha.4 → 6.0.3.alpha.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +440 -40
- data/jruby/neo4j/driver/ext/async_converter.rb +55 -0
- data/jruby/neo4j/driver/ext/auth_tokens.rb +20 -0
- data/jruby/neo4j/driver/ext/config_converter.rb +83 -0
- data/jruby/neo4j/driver/ext/exception_checkable.rb +34 -0
- data/jruby/neo4j/driver/ext/exception_mapper.rb +92 -0
- data/jruby/neo4j/driver/ext/graph_database.rb +33 -0
- data/jruby/neo4j/driver/ext/internal/abstract_query_runner.rb +18 -0
- data/jruby/neo4j/driver/ext/internal/async/internal_async_session.rb +23 -0
- data/jruby/neo4j/driver/ext/internal/cluster/routing_table_registry_impl.rb +15 -0
- data/jruby/neo4j/driver/ext/internal/cursor/disposable_async_result_cursor.rb +15 -0
- data/jruby/neo4j/driver/ext/internal/driver_factory.rb +24 -0
- data/jruby/neo4j/driver/ext/internal/eager_result_value.rb +17 -0
- data/jruby/neo4j/driver/ext/internal/metrics/internal_connection_pool_metrics.rb +17 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_notification.rb +27 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_plan.rb +26 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb +34 -0
- data/jruby/neo4j/driver/ext/internal_driver.rb +52 -0
- data/jruby/neo4j/driver/ext/internal_entity.rb +21 -0
- data/jruby/neo4j/driver/ext/internal_keys.rb +15 -0
- data/jruby/neo4j/driver/ext/internal_node.rb +13 -0
- data/jruby/neo4j/driver/ext/internal_record.rb +29 -0
- data/jruby/neo4j/driver/ext/internal_relationship.rb +13 -0
- data/jruby/neo4j/driver/ext/internal_result.rb +27 -0
- data/jruby/neo4j/driver/ext/internal_session.rb +44 -0
- data/jruby/neo4j/driver/ext/internal_transaction.rb +19 -0
- data/jruby/neo4j/driver/ext/logger.rb +60 -0
- data/jruby/neo4j/driver/ext/map_converter.rb +14 -0
- data/jruby/neo4j/driver/ext/neo_converter.rb +59 -0
- data/jruby/neo4j/driver/ext/query.rb +13 -0
- data/jruby/neo4j/driver/ext/ruby_converter.rb +57 -0
- data/jruby/neo4j/driver/ext/run_override.rb +22 -0
- data/jruby/neo4j/driver/ext/start_end_naming.rb +17 -0
- data/{ruby → jruby}/neo4j/driver/version.rb +1 -1
- data/jruby/neo4j/driver.rb +62 -0
- data/lib/neo4j/driver/{auto_closable.rb → auto_closeable.rb} +6 -6
- data/lib/neo4j/driver/exceptions/neo4j_exception.rb +6 -6
- data/lib/neo4j/driver/internal/deprecator.rb +15 -0
- metadata +91 -277
- data/ruby/neo4j/driver/access_mode.rb +0 -10
- data/ruby/neo4j/driver/auth_tokens.rb +0 -34
- data/ruby/neo4j/driver/bookmark.rb +0 -21
- data/ruby/neo4j/driver/config.rb +0 -89
- data/ruby/neo4j/driver/graph_database.rb +0 -78
- data/ruby/neo4j/driver/internal/async/connection/bolt_protocol_util.rb +0 -51
- data/ruby/neo4j/driver/internal/async/connection/bootstrap_factory.rb +0 -22
- data/ruby/neo4j/driver/internal/async/connection/channel_attributes.rb +0 -31
- data/ruby/neo4j/driver/internal/async/connection/channel_connected_listener.rb +0 -32
- data/ruby/neo4j/driver/internal/async/connection/channel_connector_impl.rb +0 -83
- data/ruby/neo4j/driver/internal/async/connection/channel_pipeline_builder_impl.rb +0 -22
- data/ruby/neo4j/driver/internal/async/connection/direct_connection.rb +0 -30
- data/ruby/neo4j/driver/internal/async/connection/event_loop_group_factory.rb +0 -83
- data/ruby/neo4j/driver/internal/async/connection/handshake_completed_listener.rb +0 -27
- data/ruby/neo4j/driver/internal/async/connection/handshake_handler.rb +0 -113
- data/ruby/neo4j/driver/internal/async/connection/netty_channel_initializer.rb +0 -57
- data/ruby/neo4j/driver/internal/async/connection/netty_domain_name_resolver.rb +0 -26
- data/ruby/neo4j/driver/internal/async/connection/netty_domain_name_resolver_group.rb +0 -19
- data/ruby/neo4j/driver/internal/async/connection/routing_connection.rb +0 -36
- data/ruby/neo4j/driver/internal/async/connection/stream.rb +0 -12
- data/ruby/neo4j/driver/internal/async/connection/stream_reader.rb +0 -16
- data/ruby/neo4j/driver/internal/async/connection_context.rb +0 -10
- data/ruby/neo4j/driver/internal/async/immutable_connection_context.rb +0 -24
- data/ruby/neo4j/driver/internal/async/inbound/byte_buf_input.rb +0 -30
- data/ruby/neo4j/driver/internal/async/inbound/channel_error_handler.rb +0 -77
- data/ruby/neo4j/driver/internal/async/inbound/chunk_decoder.rb +0 -41
- data/ruby/neo4j/driver/internal/async/inbound/connect_timeout_handler.rb +0 -32
- data/ruby/neo4j/driver/internal/async/inbound/connection_read_timeout_handler.rb +0 -17
- data/ruby/neo4j/driver/internal/async/inbound/inbound_message_dispatcher.rb +0 -171
- data/ruby/neo4j/driver/internal/async/inbound/inbound_message_handler.rb +0 -42
- data/ruby/neo4j/driver/internal/async/inbound/message_decoder.rb +0 -51
- data/ruby/neo4j/driver/internal/async/internal_async_session.rb +0 -98
- data/ruby/neo4j/driver/internal/async/internal_async_transaction.rb +0 -13
- data/ruby/neo4j/driver/internal/async/leak_logging_network_session.rb +0 -34
- data/ruby/neo4j/driver/internal/async/network_connection.rb +0 -194
- data/ruby/neo4j/driver/internal/async/network_session.rb +0 -150
- data/ruby/neo4j/driver/internal/async/outbound/chunk_aware_byte_buf_output.rb +0 -110
- data/ruby/neo4j/driver/internal/async/outbound/outbound_message_handler.rb +0 -39
- data/ruby/neo4j/driver/internal/async/pool/channel.rb +0 -66
- data/ruby/neo4j/driver/internal/async/pool/channel_pool.rb +0 -31
- data/ruby/neo4j/driver/internal/async/pool/channel_tracker.rb +0 -135
- data/ruby/neo4j/driver/internal/async/pool/connection_pool_impl.rb +0 -156
- data/ruby/neo4j/driver/internal/async/pool/netty_channel_health_checker.rb +0 -87
- data/ruby/neo4j/driver/internal/async/pool/netty_channel_pool.rb +0 -52
- data/ruby/neo4j/driver/internal/async/pool/network_connection_factory.rb +0 -21
- data/ruby/neo4j/driver/internal/async/pool/pool_settings.rb +0 -34
- data/ruby/neo4j/driver/internal/async/pool/timed_stack.rb +0 -15
- data/ruby/neo4j/driver/internal/async/result_cursors_holder.rb +0 -17
- data/ruby/neo4j/driver/internal/async/unmanaged_transaction.rb +0 -212
- data/ruby/neo4j/driver/internal/bookmark_holder.rb +0 -9
- data/ruby/neo4j/driver/internal/cluster/cluster_composition.rb +0 -48
- data/ruby/neo4j/driver/internal/cluster/cluster_composition_lookup_result.rb +0 -14
- data/ruby/neo4j/driver/internal/cluster/cluster_routing_table.rb +0 -122
- data/ruby/neo4j/driver/internal/cluster/identity_resolver.rb +0 -10
- data/ruby/neo4j/driver/internal/cluster/loadbalancing/least_connected_load_balancing_strategy.rb +0 -68
- data/ruby/neo4j/driver/internal/cluster/loadbalancing/load_balancer.rb +0 -125
- data/ruby/neo4j/driver/internal/cluster/loadbalancing/round_robin_array_index.rb +0 -13
- data/ruby/neo4j/driver/internal/cluster/multi_databases_routing_procedure_runner.rb +0 -31
- data/ruby/neo4j/driver/internal/cluster/rediscovery_impl.rb +0 -147
- data/ruby/neo4j/driver/internal/cluster/route_message_routing_procedure_runner.rb +0 -43
- data/ruby/neo4j/driver/internal/cluster/routing_context.rb +0 -77
- data/ruby/neo4j/driver/internal/cluster/routing_procedure_cluster_composition_provider.rb +0 -60
- data/ruby/neo4j/driver/internal/cluster/routing_procedure_response.rb +0 -35
- data/ruby/neo4j/driver/internal/cluster/routing_settings.rb +0 -24
- data/ruby/neo4j/driver/internal/cluster/routing_table_handler_impl.rb +0 -95
- data/ruby/neo4j/driver/internal/cluster/routing_table_registry_impl.rb +0 -121
- data/ruby/neo4j/driver/internal/cluster/single_database_routing_procedure_runner.rb +0 -73
- data/ruby/neo4j/driver/internal/connection_settings.rb +0 -16
- data/ruby/neo4j/driver/internal/cursor/async_result_cursor_impl.rb +0 -55
- data/ruby/neo4j/driver/internal/cursor/async_result_cursor_only_factory.rb +0 -24
- data/ruby/neo4j/driver/internal/cursor/disposable_async_result_cursor.rb +0 -61
- data/ruby/neo4j/driver/internal/cursor/result_cursor_factory_impl.rb +0 -24
- data/ruby/neo4j/driver/internal/cursor/rx_result_cursor_impl.rb +0 -110
- data/ruby/neo4j/driver/internal/database_name_util.rb +0 -37
- data/ruby/neo4j/driver/internal/default_bookmark_holder.rb +0 -9
- data/ruby/neo4j/driver/internal/default_domain_name_resolver.rb +0 -11
- data/ruby/neo4j/driver/internal/direct_connection_provider.rb +0 -40
- data/ruby/neo4j/driver/internal/driver_factory.rb +0 -126
- data/ruby/neo4j/driver/internal/handlers/begin_tx_response_handler.rb +0 -20
- data/ruby/neo4j/driver/internal/handlers/channel_releasing_reset_response_handler.rb +0 -30
- data/ruby/neo4j/driver/internal/handlers/commit_tx_response_handler.rb +0 -25
- data/ruby/neo4j/driver/internal/handlers/hello_response_handler.rb +0 -65
- data/ruby/neo4j/driver/internal/handlers/init_response_handler.rb +0 -34
- data/ruby/neo4j/driver/internal/handlers/legacy_pull_all_response_handler.rb +0 -199
- data/ruby/neo4j/driver/internal/handlers/no_op_response_handler.rb +0 -16
- data/ruby/neo4j/driver/internal/handlers/ping_response_handler.rb +0 -29
- data/ruby/neo4j/driver/internal/handlers/pull_handlers.rb +0 -32
- data/ruby/neo4j/driver/internal/handlers/pulln/auto_pull_response_handler.rb +0 -168
- data/ruby/neo4j/driver/internal/handlers/pulln/basic_pull_response_handler.rb +0 -298
- data/ruby/neo4j/driver/internal/handlers/pulln/fetch_size_util.rb +0 -20
- data/ruby/neo4j/driver/internal/handlers/reset_response_handler.rb +0 -34
- data/ruby/neo4j/driver/internal/handlers/rollback_tx_response_handler.rb +0 -25
- data/ruby/neo4j/driver/internal/handlers/route_message_response_handler.rb +0 -21
- data/ruby/neo4j/driver/internal/handlers/routing_response_handler.rb +0 -70
- data/ruby/neo4j/driver/internal/handlers/run_response_handler.rb +0 -38
- data/ruby/neo4j/driver/internal/handlers/session_pull_response_completion_listener.rb +0 -34
- data/ruby/neo4j/driver/internal/handlers/transaction_pull_response_completion_listener.rb +0 -20
- data/ruby/neo4j/driver/internal/impersonation_util.rb +0 -22
- data/ruby/neo4j/driver/internal/internal_bookmark.rb +0 -36
- data/ruby/neo4j/driver/internal/internal_database_name.rb +0 -9
- data/ruby/neo4j/driver/internal/internal_driver.rb +0 -74
- data/ruby/neo4j/driver/internal/internal_entity.rb +0 -21
- data/ruby/neo4j/driver/internal/internal_node.rb +0 -21
- data/ruby/neo4j/driver/internal/internal_pair.rb +0 -9
- data/ruby/neo4j/driver/internal/internal_path.rb +0 -35
- data/ruby/neo4j/driver/internal/internal_point2_d.rb +0 -9
- data/ruby/neo4j/driver/internal/internal_point3_d.rb +0 -6
- data/ruby/neo4j/driver/internal/internal_record.rb +0 -27
- data/ruby/neo4j/driver/internal/internal_relationship.rb +0 -27
- data/ruby/neo4j/driver/internal/internal_result.rb +0 -49
- data/ruby/neo4j/driver/internal/internal_session.rb +0 -81
- data/ruby/neo4j/driver/internal/internal_transaction.rb +0 -48
- data/ruby/neo4j/driver/internal/logging/channel_activity_logger.rb +0 -29
- data/ruby/neo4j/driver/internal/logging/channel_error_logger.rb +0 -17
- data/ruby/neo4j/driver/internal/logging/prefixed_logger.rb +0 -19
- data/ruby/neo4j/driver/internal/logging/reformatted_logger.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/abstract_message_writer.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/bolt_protocol.rb +0 -32
- data/ruby/neo4j/driver/internal/messaging/bolt_protocol_version.rb +0 -48
- data/ruby/neo4j/driver/internal/messaging/common/common_message_reader.rb +0 -51
- data/ruby/neo4j/driver/internal/messaging/common/common_value.rb +0 -33
- data/ruby/neo4j/driver/internal/messaging/common/common_value_packer.rb +0 -104
- data/ruby/neo4j/driver/internal/messaging/common/common_value_unpacker.rb +0 -256
- data/ruby/neo4j/driver/internal/messaging/encode/begin_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/commit_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/discard_all_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/discard_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/goodbye_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/hello_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/init_message_encoder.rb +0 -16
- data/ruby/neo4j/driver/internal/messaging/encode/logoff_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/logon_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/pull_all_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/pull_message_encoder.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/encode/reset_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/rollback_message_encoder.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/encode/route_message_encoder.rb +0 -24
- data/ruby/neo4j/driver/internal/messaging/encode/route_v44_message_encoder.rb +0 -22
- data/ruby/neo4j/driver/internal/messaging/encode/run_message_encoder.rb +0 -16
- data/ruby/neo4j/driver/internal/messaging/encode/run_with_metadata_message_encoder.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/request/abstract_streaming_message.rb +0 -25
- data/ruby/neo4j/driver/internal/messaging/request/begin_message.rb +0 -25
- data/ruby/neo4j/driver/internal/messaging/request/commit_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/discard_all_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/discard_message.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/request/goodbye_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/hello_message.rb +0 -30
- data/ruby/neo4j/driver/internal/messaging/request/init_message.rb +0 -19
- data/ruby/neo4j/driver/internal/messaging/request/logoff_message.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/request/logon_message.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/request/message_with_metadata.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/request/multi_database_util.rb +0 -26
- data/ruby/neo4j/driver/internal/messaging/request/pull_all_message.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/request/pull_message.rb +0 -22
- data/ruby/neo4j/driver/internal/messaging/request/reset_message.rb +0 -32
- data/ruby/neo4j/driver/internal/messaging/request/rollback_message.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/request/route_message.rb +0 -28
- data/ruby/neo4j/driver/internal/messaging/request/run_message.rb +0 -23
- data/ruby/neo4j/driver/internal/messaging/request/run_with_metadata_message.rb +0 -49
- data/ruby/neo4j/driver/internal/messaging/request/transaction_metadata_builder.rb +0 -24
- data/ruby/neo4j/driver/internal/messaging/response/failure_message.rb +0 -40
- data/ruby/neo4j/driver/internal/messaging/response/ignored_message.rb +0 -29
- data/ruby/neo4j/driver/internal/messaging/response/record_message.rb +0 -33
- data/ruby/neo4j/driver/internal/messaging/response/success_message.rb +0 -34
- data/ruby/neo4j/driver/internal/messaging/v3/bolt_protocol_v3.rb +0 -82
- data/ruby/neo4j/driver/internal/messaging/v3/message_format_v3.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v3/message_writer_v3.rb +0 -27
- data/ruby/neo4j/driver/internal/messaging/v4/bolt_protocol_v4.rb +0 -29
- data/ruby/neo4j/driver/internal/messaging/v4/message_format_v4.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/v4/message_writer_v4.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v41/bolt_protocol_v41.rb +0 -25
- data/ruby/neo4j/driver/internal/messaging/v42/bolt_protocol_v42.rb +0 -13
- data/ruby/neo4j/driver/internal/messaging/v43/bolt_protocol_v43.rb +0 -19
- data/ruby/neo4j/driver/internal/messaging/v43/message_format_v43.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/v43/message_writer_v43.rb +0 -20
- data/ruby/neo4j/driver/internal/messaging/v44/bolt_protocol_v44.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v44/message_format_v44.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/v44/message_writer_v44.rb +0 -15
- data/ruby/neo4j/driver/internal/messaging/v5/bolt_protocol_v5.rb +0 -21
- data/ruby/neo4j/driver/internal/messaging/v5/message_format_v5.rb +0 -18
- data/ruby/neo4j/driver/internal/messaging/v5/value_unpacker_v5.rb +0 -17
- data/ruby/neo4j/driver/internal/messaging/v51/bolt_protocol_v51.rb +0 -40
- data/ruby/neo4j/driver/internal/messaging/v51/message_format_v51.rb +0 -14
- data/ruby/neo4j/driver/internal/messaging/v51/message_writer_v51.rb +0 -17
- data/ruby/neo4j/driver/internal/metrics/connection_pool_metrics_listener.rb +0 -34
- data/ruby/neo4j/driver/internal/metrics/internal_abstract_metrics.rb +0 -46
- data/ruby/neo4j/driver/internal/metrics/internal_connection_pool_metrics.rb +0 -105
- data/ruby/neo4j/driver/internal/metrics/internal_metrics.rb +0 -82
- data/ruby/neo4j/driver/internal/metrics/internal_metrics_provider.rb +0 -18
- data/ruby/neo4j/driver/internal/metrics/listener_event.rb +0 -17
- data/ruby/neo4j/driver/internal/metrics/metrics_provider.rb +0 -24
- data/ruby/neo4j/driver/internal/metrics/time_recorder_listener_event.rb +0 -15
- data/ruby/neo4j/driver/internal/packstream/byte_array_incompatible_packer.rb +0 -12
- data/ruby/neo4j/driver/internal/packstream/pack_input.rb +0 -47
- data/ruby/neo4j/driver/internal/packstream/pack_output.rb +0 -39
- data/ruby/neo4j/driver/internal/packstream/pack_stream.rb +0 -326
- data/ruby/neo4j/driver/internal/packstream/pack_type.rb +0 -17
- data/ruby/neo4j/driver/internal/read_only_bookmark_holder.rb +0 -13
- data/ruby/neo4j/driver/internal/resolved_bolt_server_address.rb +0 -35
- data/ruby/neo4j/driver/internal/retry/exponential_backoff_retry_logic.rb +0 -151
- data/ruby/neo4j/driver/internal/revocation_strategy.rb +0 -19
- data/ruby/neo4j/driver/internal/scheme.rb +0 -32
- data/ruby/neo4j/driver/internal/security/internal_auth_token.rb +0 -15
- data/ruby/neo4j/driver/internal/security/security_plan_impl.rb +0 -48
- data/ruby/neo4j/driver/internal/security_setting.rb +0 -66
- data/ruby/neo4j/driver/internal/session_factory_impl.rb +0 -32
- data/ruby/neo4j/driver/internal/spi/connection.rb +0 -19
- data/ruby/neo4j/driver/internal/spi/connection_pool.rb +0 -9
- data/ruby/neo4j/driver/internal/spi/response_handler.rb +0 -23
- data/ruby/neo4j/driver/internal/summary/internal_database_info.rb +0 -7
- data/ruby/neo4j/driver/internal/summary/internal_input_position.rb +0 -11
- data/ruby/neo4j/driver/internal/summary/internal_notification.rb +0 -16
- data/ruby/neo4j/driver/internal/summary/internal_plan.rb +0 -41
- data/ruby/neo4j/driver/internal/summary/internal_profiled_plan.rb +0 -32
- data/ruby/neo4j/driver/internal/summary/internal_result_summary.rb +0 -33
- data/ruby/neo4j/driver/internal/summary/internal_server_info.rb +0 -6
- data/ruby/neo4j/driver/internal/summary/internal_summary_counters.rb +0 -18
- data/ruby/neo4j/driver/internal/svm/netty_substitutions.rb +0 -196
- data/ruby/neo4j/driver/internal/svm/z_lib_substitutions.rb +0 -21
- data/ruby/neo4j/driver/internal/util/certificate_tool.rb +0 -65
- data/ruby/neo4j/driver/internal/util/clock.rb +0 -29
- data/ruby/neo4j/driver/internal/util/error_util.rb +0 -104
- data/ruby/neo4j/driver/internal/util/extract.rb +0 -123
- data/ruby/neo4j/driver/internal/util/format.rb +0 -39
- data/ruby/neo4j/driver/internal/util/futures.rb +0 -99
- data/ruby/neo4j/driver/internal/util/iterables.rb +0 -35
- data/ruby/neo4j/driver/internal/util/lock_util.rb +0 -23
- data/ruby/neo4j/driver/internal/util/metadata_extractor.rb +0 -107
- data/ruby/neo4j/driver/internal/util/mutex.rb +0 -9
- data/ruby/neo4j/driver/internal/util/preconditions.rb +0 -16
- data/ruby/neo4j/driver/internal/util/result_holder.rb +0 -72
- data/ruby/neo4j/driver/internal/util/server_version.rb +0 -60
- data/ruby/neo4j/driver/logging1.rb +0 -51
- data/ruby/neo4j/driver/net/server_address.rb +0 -9
- data/ruby/neo4j/driver/query.rb +0 -48
- data/ruby/neo4j/driver/records.rb +0 -13
- data/ruby/neo4j/driver/transaction_config.rb +0 -50
- data/ruby/neo4j/driver/values.rb +0 -26
- data/ruby/neo4j/driver.rb +0 -28
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
class InternalAsyncSession
|
|
5
|
-
def initialize(session)
|
|
6
|
-
@session = session
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
delegate :last_bookmark, :close_async, to: :@session
|
|
10
|
-
|
|
11
|
-
def run_async(query, parameters = {}, config = {})
|
|
12
|
-
@session.run_async(org.neo4j.driver.Query.new(query, **parameters), **config)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def begin_transaction_async(**config)
|
|
16
|
-
@session.begin_transaction_async(**config).then(&InternalAsyncTransaction.method(:new))
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def read_transaction_async(**config, &work)
|
|
20
|
-
transaction_async(org.neo4j.driver.AccessMode::READ, **config, &work)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def write_transaction_async(**config, &work)
|
|
24
|
-
transaction_async(org.neo4j.driver.AccessMode::WRITE, **config, &work)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
def transaction_async(mode, **config, &work)
|
|
30
|
-
@session.retry_logic.retry_async do
|
|
31
|
-
result_future = java.util.concurrent.CompletableFuture.new
|
|
32
|
-
tx_future = @session.begin_transaction_async(mode, ** config)
|
|
33
|
-
|
|
34
|
-
tx_future.when_complete do |tx, completion_error|
|
|
35
|
-
error = Util::Futures.completion_exception_cause(completion_error)
|
|
36
|
-
|
|
37
|
-
if !error.nil?
|
|
38
|
-
result_future.complete_exceptionally(error)
|
|
39
|
-
else
|
|
40
|
-
execute_work(result_future, tx, &work)
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
result_future
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def execute_work(result_future, tx, &work)
|
|
48
|
-
work_future = safe_execute_work(tx, &work)
|
|
49
|
-
|
|
50
|
-
work_future.when_complete do |result, completion_error|
|
|
51
|
-
error = Util::Futures.completion_exception_cause(completion_error)
|
|
52
|
-
|
|
53
|
-
if !error.nil?
|
|
54
|
-
close_tx_after_failed_transaction_work(tx, result_future, error)
|
|
55
|
-
else
|
|
56
|
-
close_tx_after_succeeded_transaction_work(tx, result_future, result)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def safe_execute_work(tx)
|
|
62
|
-
# given work might fail in both async and sync way
|
|
63
|
-
# async failure will result in a failed future being returned
|
|
64
|
-
# sync failure will result in an exception being thrown
|
|
65
|
-
begin
|
|
66
|
-
result = yield InternalAsyncTransaction.new(tx)
|
|
67
|
-
|
|
68
|
-
# protect from given transaction function returning null
|
|
69
|
-
result == nil ? Util::Futures.completed_with_null : result
|
|
70
|
-
rescue StandardError => work_error
|
|
71
|
-
# work threw an exception, wrap it in a future and proceed
|
|
72
|
-
Util::Futures.failed_future(work_error)
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
def close_tx_after_failed_transaction_work(tx, result_future, error)
|
|
77
|
-
tx.close_async.when_complete do |_ignored, rollback_error|
|
|
78
|
-
error.add_suppressed(rollback_error) unless rollback_error.nil?
|
|
79
|
-
|
|
80
|
-
result_future.complete_exceptionally(error)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def close_tx_after_succeeded_transaction_work(tx, result_future, result)
|
|
85
|
-
tx.close_async(true).when_complete do |_ignored, completion_error|
|
|
86
|
-
commit_error = Util::Futures.completion_exception_cause(completion_error)
|
|
87
|
-
|
|
88
|
-
if !commit_error.nil?
|
|
89
|
-
result_future.complete_exceptionally(commit_error)
|
|
90
|
-
else
|
|
91
|
-
result_future.complete(result)
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
class LeakLoggingNetworkSession < NetworkSession
|
|
5
|
-
def initialize(connection_provider, retry_logic, database_name, mode, bookmark_holder, impersonated_user, fetch_size, logger)
|
|
6
|
-
super
|
|
7
|
-
@stack_trace = capture_stack_trace
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def finalize
|
|
11
|
-
log_leak_if_needed
|
|
12
|
-
super
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
def log_leak_if_needed
|
|
18
|
-
is_open = Util::Futures.blocking_get(current_connection_is_open)
|
|
19
|
-
if is_open
|
|
20
|
-
@log.error do
|
|
21
|
-
"Neo4j Session object leaked, please ensure that your application fully consumes results in "\
|
|
22
|
-
"Sessions or explicitly calls `close` on Sessions before disposing of the objects.\n"\
|
|
23
|
-
"Session was created at:\n#{@stack_trace}"
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def capture_stack_trace
|
|
29
|
-
Thread.current.backtrace.join("\n")
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
class NetworkConnection
|
|
5
|
-
include Spi::Connection
|
|
6
|
-
delegate :protocol, to: :@channel
|
|
7
|
-
|
|
8
|
-
attr_reader :server_agent, :server_address, :server_version
|
|
9
|
-
|
|
10
|
-
def initialize(channel, channel_pool, logger, &on_pool_shutdown)
|
|
11
|
-
@log = logger
|
|
12
|
-
@channel = channel
|
|
13
|
-
@message_dispatcher = channel.attributes[:message_dispatcher]
|
|
14
|
-
@server_agent = channel.attributes[:server_agent]
|
|
15
|
-
@server_address = channel.attributes[:server_address]
|
|
16
|
-
@server_version = channel.attributes[:server_version]
|
|
17
|
-
@protocol = Messaging::BoltProtocol.for_channel(channel)
|
|
18
|
-
@channel_pool = channel_pool
|
|
19
|
-
@on_pool_shutdow = on_pool_shutdown
|
|
20
|
-
# @release_future = java.util.concurrent.CompletableFuture.new
|
|
21
|
-
# @clock = clock
|
|
22
|
-
# @connection_read_timeout = Connection::ChannelAttributes.connection_read_timeout(channel) || nil
|
|
23
|
-
@status = Concurrent::AtomicReference.new(Status::OPEN)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def open?
|
|
27
|
-
@status.get == Status::OPEN
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def enable_auto_read
|
|
31
|
-
@channel.auto_read = true if open?
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def disable_auto_read
|
|
35
|
-
@channel.auto_read = false if open?
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def flush
|
|
39
|
-
flush_in_event_loop if verify_open(nil, nil)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def write(message1, handler1, message2 = nil, handler2 = nil)
|
|
43
|
-
if message2.nil? && handler2.nil?
|
|
44
|
-
write_message_in_event_loop(message1, handler1, false) if verify_open(handler1, nil)
|
|
45
|
-
else
|
|
46
|
-
write_messages_in_event_loop(message1, handler1, message2, handler2, false) if verify_open(handler1, handler2)
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def write_and_flush(message1, handler1, message2 = nil, handler2 = nil)
|
|
51
|
-
if message2.nil? && handler2.nil?
|
|
52
|
-
write_message_in_event_loop(message1, handler1, true) if verify_open(handler1, nil)
|
|
53
|
-
else
|
|
54
|
-
write_messages_in_event_loop(message1, handler1, message2, handler2, true) if verify_open(handler1, handler2)
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def reset
|
|
59
|
-
result = java.util.concurrent.CompletableFuture.new
|
|
60
|
-
handler = Handlers::ResetResponseHandler.new(@message_dispatcher, result)
|
|
61
|
-
write_reset_message_if_needed(handler, true)
|
|
62
|
-
result
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def release
|
|
66
|
-
if @status.compare_and_set(Status::OPEN, Status::RELEASED)
|
|
67
|
-
handler = Handlers::ChannelReleasingResetResponseHandler.new(@channel, @channel_pool, @message_dispatcher, @log, @release)
|
|
68
|
-
write_reset_message_if_needed(handler, false)
|
|
69
|
-
# @metrics_listener.after_connection_released(Connection::ChannelAttributes.pool_id(@channel), @in_use_event)
|
|
70
|
-
# end
|
|
71
|
-
# @release_future
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def terminate_and_release(reason)
|
|
76
|
-
if @status.compare_and_set(Status::OPEN, Status::TERMINATED)
|
|
77
|
-
@channel.attributes[:termination_reason] = reason
|
|
78
|
-
@channel.close rescue nil
|
|
79
|
-
@channel_pool.release(@channel)
|
|
80
|
-
# @metrics_listener.after_connection_released(Connection::ChannelAttributes.pool_id(@channel), @in_use_event)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
private
|
|
85
|
-
|
|
86
|
-
def write_reset_message_if_needed(reset_handler, is_session_reset)
|
|
87
|
-
if is_session_reset && !open?
|
|
88
|
-
reset_handler.on_success
|
|
89
|
-
else
|
|
90
|
-
# auto-read could've been disabled, re-enable it to automatically receive response for RESET
|
|
91
|
-
@channel.auto_read = true
|
|
92
|
-
@message_dispatcher.enqueue(reset_handler)
|
|
93
|
-
write_to_channel(Messaging::Request::ResetMessage::RESET, true)
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def write_to_channel(message, flush = false)
|
|
98
|
-
if flush
|
|
99
|
-
@channel.write_and_flush(message) #.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
|
100
|
-
else
|
|
101
|
-
@channel.write(message)
|
|
102
|
-
end
|
|
103
|
-
rescue EOFError, Errno::ECONNRESET, Errno::EPIPE => e
|
|
104
|
-
terminate_and_release(e.message)
|
|
105
|
-
@log.debug("Shutting down connection pool towards #{@server_address} due to error: #{e.message}")
|
|
106
|
-
@channel_pool.shutdown(&:close)
|
|
107
|
-
@on_pool_shutdow.call
|
|
108
|
-
# should remove routing table entry as well
|
|
109
|
-
raise Exceptions::SessionExpiredException, e.message
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def flush_in_event_loop
|
|
113
|
-
@channel.event_loop.execute do
|
|
114
|
-
@channel.flush
|
|
115
|
-
register_connection_read_timeout(@channel)
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
def write_message_in_event_loop(message, handler, flush)
|
|
120
|
-
@message_dispatcher.enqueue(handler)
|
|
121
|
-
|
|
122
|
-
write_to_channel(message, flush)
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def write_messages_in_event_loop(message1, handler1, message2, handler2, flush)
|
|
126
|
-
@channel.event_loop.execute do
|
|
127
|
-
@message_dispatcher.enqueue(handler1)
|
|
128
|
-
@message_dispatcher.enqueue(handler2)
|
|
129
|
-
|
|
130
|
-
@channel.write(message1, channel.void_promise)
|
|
131
|
-
|
|
132
|
-
if flush
|
|
133
|
-
@channel.write_and_flush(message2).add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
|
134
|
-
else
|
|
135
|
-
@channel.write(message2, @channel.void_promise)
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
def verify_open(handler1, handler2)
|
|
141
|
-
connection_status = @status.get
|
|
142
|
-
|
|
143
|
-
case connection_status
|
|
144
|
-
when 'open'
|
|
145
|
-
true
|
|
146
|
-
when 'released'
|
|
147
|
-
error = Neo4j::Driver::Exceptions::IllegalStateException.new("Connection has been released to the pool and can't be used")
|
|
148
|
-
|
|
149
|
-
handler1.on_failure(error) unless handler1.nil?
|
|
150
|
-
|
|
151
|
-
handler2.on_failure(error) unless handler2.nil?
|
|
152
|
-
|
|
153
|
-
false
|
|
154
|
-
when 'terminated'
|
|
155
|
-
terminated_error = Neo4j::Driver::Exceptions::IllegalStateException.new("Connection has been terminated and can't be used")
|
|
156
|
-
|
|
157
|
-
handler1.on_failure(terminated_error) unless handler1.nil?
|
|
158
|
-
|
|
159
|
-
handler2.on_failure(terminated_error) unless handler2.nil?
|
|
160
|
-
|
|
161
|
-
false
|
|
162
|
-
else
|
|
163
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new("Unknown status: #{connection_status}")
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
def register_connection_read_timeout(channel)
|
|
168
|
-
if !channel.event_loop.in_event_loop
|
|
169
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new('This method may only be called in the EventLoop')
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
if !@connection_read_timeout.nil? && @connection_read_timeout_handler.nil?
|
|
173
|
-
connection_read_timeout_handler = Inbound::ConnectionReadTimeoutHandler.new(@connection_read_timeout, java.util.concurrent.TimeUnit::SECONDS)
|
|
174
|
-
channel.pipeline.add_first(connection_read_timeout_handler)
|
|
175
|
-
@log.debug('Added ConnectionReadTimeoutHandler')
|
|
176
|
-
|
|
177
|
-
@message_dispatcher.set_before_last_handler_hook do |message_type|
|
|
178
|
-
channel.pipeline.remove(connection_read_timeout_handler)
|
|
179
|
-
connection_read_timeout_handler = nil
|
|
180
|
-
@message_dispatcher.set_before_last_handler_hook(nil)
|
|
181
|
-
log.debug('Removed ConnectionReadTimeoutHandler')
|
|
182
|
-
end
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
class Status
|
|
187
|
-
OPEN = 'open'
|
|
188
|
-
RELEASED = 'released'
|
|
189
|
-
TERMINATED = 'terminated'
|
|
190
|
-
end
|
|
191
|
-
end
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
end
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
class NetworkSession
|
|
5
|
-
attr_reader :retry_logic
|
|
6
|
-
|
|
7
|
-
def initialize(connection_provider, retry_logic, database_name, mode, bookmark_holder, impersonated_user, fetch_size, logger)
|
|
8
|
-
@connection_provider = connection_provider
|
|
9
|
-
@mode = mode
|
|
10
|
-
@retry_logic = retry_logic
|
|
11
|
-
@log = Logging::PrefixedLogger.new("[#{hash}]", logger)
|
|
12
|
-
@bookmark_holder = bookmark_holder
|
|
13
|
-
# @database_name = database_name.database_name
|
|
14
|
-
@connection_context = NetworkSessionConnectionContext.new(database_name, @bookmark_holder.bookmark, impersonated_user)
|
|
15
|
-
@fetch_size = fetch_size
|
|
16
|
-
@open = Concurrent::AtomicBoolean.new(true)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def run_async(query, **config)
|
|
20
|
-
new_result_cursor = build_result_cursor_factory(query, config).async_result
|
|
21
|
-
@result_cursor = new_result_cursor
|
|
22
|
-
new_result_cursor.map_successful_run_completion_async
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def begin_transaction_async(mode = @mode, **config)
|
|
26
|
-
ensure_session_is_open
|
|
27
|
-
ensure_no_open_tx_before_starting_tx
|
|
28
|
-
acquire_connection(mode).then do |connection|
|
|
29
|
-
ImpersonationUtil.ensure_impersonation_support(connection, connection.impersonated_user)
|
|
30
|
-
tx = UnmanagedTransaction.new(connection, @bookmark_holder, @fetch_size)
|
|
31
|
-
tx.begin_async(@bookmark_holder.bookmark, config)
|
|
32
|
-
end&.tap { |new_transaction| @transaction = new_transaction }
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def reset_async
|
|
36
|
-
existing_transaction_or_null
|
|
37
|
-
.then_accept { |tx| tx&.mark_terminated }
|
|
38
|
-
.then_flat { @connection_stage }
|
|
39
|
-
.then_flat do |connection|
|
|
40
|
-
# there exists an active connection, send a RESET message over it
|
|
41
|
-
connection&.reset || Util::Futures.completed_with_null
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def last_bookmark
|
|
46
|
-
@bookmark_holder.bookmark
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def release_connection_async
|
|
50
|
-
@connection&.release
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def connection_async
|
|
54
|
-
@connection
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def open?
|
|
58
|
-
@open.true?
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def close_async
|
|
62
|
-
return unless @open.make_false
|
|
63
|
-
# there exists a cursor with potentially unconsumed error, try to extract and propagate it
|
|
64
|
-
error = @result_cursor&.discard_all_failure_async
|
|
65
|
-
close_transaction_and_release_connection
|
|
66
|
-
rescue => tx_close_error
|
|
67
|
-
error = Util::Futures.combine_errors(error, tx_close_error)
|
|
68
|
-
ensure
|
|
69
|
-
raise error if error
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def current_connection_open?
|
|
73
|
-
@connection&.open? # some connection has actually been acquired and it's still open
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
private
|
|
77
|
-
|
|
78
|
-
def build_result_cursor_factory(query, config)
|
|
79
|
-
ensure_session_is_open
|
|
80
|
-
ensure_no_open_tx_before_running_query
|
|
81
|
-
connection = acquire_connection(@mode)
|
|
82
|
-
ImpersonationUtil.ensure_impersonation_support(connection, connection.impersonated_user)
|
|
83
|
-
connection.protocol.run_in_auto_commit_transaction(connection, query, @bookmark_holder, config,
|
|
84
|
-
@fetch_size)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
def acquire_connection(mode)
|
|
88
|
-
# make sure previous result is fully consumed and connection is released back to the pool
|
|
89
|
-
@result_cursor&.pull_all_failure_async&.result!&.then(&method(:raise))
|
|
90
|
-
if @connection&.open?
|
|
91
|
-
# there somehow is an existing open connection, this should not happen, just a precondition
|
|
92
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new('Existing open connection detected')
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
@connection = @connection_provider.acquire_connection(@connection_context.context_with_mode(mode))
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def close_transaction_and_release_connection
|
|
99
|
-
existing_transaction_or_null&.close_async
|
|
100
|
-
ensure
|
|
101
|
-
release_connection_async
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
def ensure_no_open_tx_before_running_query
|
|
105
|
-
ensure_no_open_tx('Queries cannot be run directly on a session with an open transaction; either run from within the transaction or use a different session.')
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def ensure_no_open_tx_before_starting_tx
|
|
109
|
-
ensure_no_open_tx('You cannot begin a transaction on a session with an open transaction; either run from within the transaction or use a different session.')
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def ensure_no_open_tx(error_message)
|
|
113
|
-
existing_transaction_or_null&.then do
|
|
114
|
-
raise Neo4j::Driver::Exceptions::TransactionNestingException.new(error_message)
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def existing_transaction_or_null
|
|
119
|
-
@transaction if @transaction&.open?
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
def ensure_session_is_open
|
|
123
|
-
unless @open.true?
|
|
124
|
-
raise Neo4j::Driver::Exceptions::ClientException.new('No more interaction with this session are allowed as the current session is already closed.')
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# The {@link NetworkSessionConnectionContext#mode} can be mutable for a session connection context
|
|
129
|
-
class NetworkSessionConnectionContext
|
|
130
|
-
# This bookmark is only used for rediscovery.
|
|
131
|
-
# It has to be the initial bookmark given at the creation of the session.
|
|
132
|
-
# As only that bookmark could carry extra system bookmarks
|
|
133
|
-
attr_accessor :database_name
|
|
134
|
-
attr :mode, :rediscovery_bookmark, :impersonated_user
|
|
135
|
-
|
|
136
|
-
def initialize(database_name, bookmark, impersonated_user)
|
|
137
|
-
@database_name = database_name
|
|
138
|
-
@rediscovery_bookmark = bookmark
|
|
139
|
-
@impersonated_user = impersonated_user
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
def context_with_mode(mode)
|
|
143
|
-
@mode = mode
|
|
144
|
-
self
|
|
145
|
-
end
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
|
-
end
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Outbound
|
|
5
|
-
class ChunkAwareByteBufOutput
|
|
6
|
-
include Packstream::PackStream::Packer
|
|
7
|
-
include Messaging::Common::CommonValuePacker
|
|
8
|
-
|
|
9
|
-
class ChunkBuffer < ::Async::IO::Buffer
|
|
10
|
-
include Packstream::PackOutput
|
|
11
|
-
alias write <<
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def initialize(output, max_chunk_size: Connection::BoltProtocolUtil::DEFAULT_MAX_OUTBOUND_CHUNK_SIZE_BYTES)
|
|
15
|
-
@output = output
|
|
16
|
-
@max_chunk_size = verify_max_chunk_size(max_chunk_size)
|
|
17
|
-
@chunk = ChunkBuffer.new
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def start
|
|
21
|
-
assert_not_started
|
|
22
|
-
@chunk.clear
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def write_byte(value)
|
|
26
|
-
ensure_can_fit_in_current_chunk(1)
|
|
27
|
-
@chunk.write_byte(value)
|
|
28
|
-
self
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def write(data)
|
|
32
|
-
offset = 0
|
|
33
|
-
length = data.bytesize
|
|
34
|
-
|
|
35
|
-
while offset < length
|
|
36
|
-
# Ensure there is an open chunk, and that it has at least one byte of space left
|
|
37
|
-
ensure_can_fit_in_current_chunk(1)
|
|
38
|
-
|
|
39
|
-
# Write as much as we can into the current chunk
|
|
40
|
-
amount_to_write = [available_bytes_in_current_chunk, length - offset].min
|
|
41
|
-
|
|
42
|
-
@chunk.write(data.byteslice(offset, amount_to_write))
|
|
43
|
-
offset += amount_to_write
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
self
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def write_short(value)
|
|
50
|
-
ensure_can_fit_in_current_chunk(2)
|
|
51
|
-
@chunk.write_short(value)
|
|
52
|
-
self
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def write_int(value)
|
|
56
|
-
ensure_can_fit_in_current_chunk(4)
|
|
57
|
-
@chunk.write_int(value)
|
|
58
|
-
self
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def write_long(value)
|
|
62
|
-
ensure_can_fit_in_current_chunk(8)
|
|
63
|
-
@chunk.write_long(value)
|
|
64
|
-
self
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def write_double(value)
|
|
68
|
-
ensure_can_fit_in_current_chunk(8)
|
|
69
|
-
@chunk.write_double(value)
|
|
70
|
-
self
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def write_message_boundary
|
|
74
|
-
@output.write_short(0)
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def write_chunk
|
|
78
|
-
@output.write_short(@chunk.bytesize)
|
|
79
|
-
@output.write(@chunk)
|
|
80
|
-
@chunk.clear
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
alias stop write_chunk
|
|
84
|
-
|
|
85
|
-
private
|
|
86
|
-
|
|
87
|
-
def ensure_can_fit_in_current_chunk(number_of_bytes)
|
|
88
|
-
write_chunk if @chunk.bytesize + number_of_bytes > @max_chunk_size
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
def available_bytes_in_current_chunk
|
|
92
|
-
@max_chunk_size - @chunk.bytesize
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def assert_not_started
|
|
96
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new('Already started') unless @chunk.empty?
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
def verify_max_chunk_size(max_chunk_size)
|
|
100
|
-
if max_chunk_size <= 0
|
|
101
|
-
raise ArgumentError.new("Max chunk size should be > 0, given: #{max_chunk_size}")
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
max_chunk_size
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Outbound
|
|
5
|
-
class OutboundMessageHandler
|
|
6
|
-
NAME = self.class.name
|
|
7
|
-
|
|
8
|
-
def initialize(output, message_format, logger)
|
|
9
|
-
@output = output
|
|
10
|
-
@writer = message_format.new_writer(output)
|
|
11
|
-
@log = logger
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def handler_added(ctx)
|
|
15
|
-
@log = Logging::ChannelActivityLogger.new(ctx.channel, @log, self.class)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def handler_removed(ctx)
|
|
19
|
-
@log = nil
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def encode(msg)
|
|
23
|
-
@log.debug("C: #{msg}")
|
|
24
|
-
|
|
25
|
-
@output.start
|
|
26
|
-
begin
|
|
27
|
-
@writer.write(msg)
|
|
28
|
-
ensure
|
|
29
|
-
@output.stop
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
@output.write_message_boundary
|
|
33
|
-
# @log.debug( "C: #{}") if @log.debug_enabled?
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|