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,66 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class Channel
|
|
6
|
-
attr :stream
|
|
7
|
-
attr_accessor :version, :protocol, :message_format, :message_dispatcher
|
|
8
|
-
attr :attributes # should be attr
|
|
9
|
-
attr_accessor :auto_read
|
|
10
|
-
|
|
11
|
-
def initialize(address, connector, logger)
|
|
12
|
-
@attributes = Connection::ChannelAttributes.new
|
|
13
|
-
@attributes[:server_address] = address
|
|
14
|
-
@stream = Connection::Stream.new(connect_to_io_socket(connector, address))
|
|
15
|
-
@stream.write(Connection::BoltProtocolUtil.handshake_buf)
|
|
16
|
-
@stream.flush
|
|
17
|
-
Connection::HandshakeHandler.new(logger).decode(self)
|
|
18
|
-
stream_writer = Outbound::ChunkAwareByteBufOutput.new(@stream)
|
|
19
|
-
@message_dispatcher = Inbound::InboundMessageDispatcher.new(self, logger)
|
|
20
|
-
@attributes[:message_dispatcher] = @message_dispatcher
|
|
21
|
-
@outbound_handler = Outbound::OutboundMessageHandler.new(stream_writer, message_format, logger)
|
|
22
|
-
@common_message_reader = message_format.new_reader(@stream)
|
|
23
|
-
connector.initialize_channel(self, protocol)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def close
|
|
27
|
-
@stream.close
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def write(message)
|
|
31
|
-
@outbound_handler.encode(message)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def write_and_flush(message)
|
|
35
|
-
write(message)
|
|
36
|
-
@stream.flush
|
|
37
|
-
ensure_response_handling
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
private
|
|
41
|
-
|
|
42
|
-
def connect_to_io_socket(connector, address)
|
|
43
|
-
Sync { connector.connect(address) }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def bracketless(host)
|
|
47
|
-
host.delete_prefix('[').delete_suffix(']')
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def ensure_response_handling
|
|
51
|
-
# probably should be synchronized
|
|
52
|
-
return if @handling_active
|
|
53
|
-
@handling_active = true
|
|
54
|
-
while @message_dispatcher.queued_handlers_count > 0 do
|
|
55
|
-
@common_message_reader.read(@message_dispatcher)
|
|
56
|
-
end
|
|
57
|
-
@handling_active = false
|
|
58
|
-
rescue
|
|
59
|
-
@handling_active = false
|
|
60
|
-
raise
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class ChannelPool < ConnectionPool
|
|
6
|
-
def initialize(limit: nil, acquisition_timeout: nil, &block)
|
|
7
|
-
super(size: limit, timeout: acquisition_timeout, &block)
|
|
8
|
-
@available = TimedStack.new(@size, &block)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def acquire(options = {})
|
|
12
|
-
@available.pop(options[:timeout] || @timeout)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def release(resource)
|
|
16
|
-
@available.push(resource)
|
|
17
|
-
nil
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def close
|
|
21
|
-
@available.shutdown(&:close)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def busy?
|
|
25
|
-
@available.any_resource_busy?
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class ChannelTracker
|
|
6
|
-
attr_reader :lock, :read, :write, :address_to_in_use_channel_count, :address_to_idle_channel_count, :log,
|
|
7
|
-
:metrics_listener, :close_listener, :all_channels
|
|
8
|
-
|
|
9
|
-
def initialize(metrics_listener, logger, **options)
|
|
10
|
-
@metrics_listener = metrics_listener
|
|
11
|
-
@log = logger
|
|
12
|
-
@all_channels = options[:channels]
|
|
13
|
-
@lock = Concurrent::ReentrantReadWriteLock.new
|
|
14
|
-
@close_listener = method(:channel_closed)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def channel_released(channel)
|
|
18
|
-
@lock.with_write_lock do
|
|
19
|
-
decrement_in_use(channel)
|
|
20
|
-
increment_idle(channel)
|
|
21
|
-
channel.close_future.add_listener(close_listener)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
log.debug("Channel [0x#{channel.id}] acquired from the pool. Local address: #{channel.local_address}, remote address: #{channel.remote_address}")
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def channel_created(channel, creating_event = nil)
|
|
28
|
-
if creating_event.nil?
|
|
29
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new('Untraceable channel created.')
|
|
30
|
-
else
|
|
31
|
-
# when it is created, we count it as idle as it has not been acquired out of the pool
|
|
32
|
-
do_in_write_lock(->() { increment_idle(channel) })
|
|
33
|
-
|
|
34
|
-
metrics_listener.after_created(Connection::ChannelAttributes.pool_id(channel), creating_event)
|
|
35
|
-
all_channels.add(channel)
|
|
36
|
-
log.debug( "Channel [0x#{channel.id}] created. Local address: #{channel.local_address}, remote address: #{channel.remote_address}")
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def channel_creating(pool_id)
|
|
41
|
-
creating_event = metrics_listener.create_listener_event
|
|
42
|
-
metrics_listener.before_creating(pool_id, creating_event)
|
|
43
|
-
creating_event
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def channel_failed_to_create(pool_id)
|
|
47
|
-
metrics_listener.after_failed_to_create(pool_id)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def channel_closed(channel)
|
|
51
|
-
do_in_write_lock(-> () { decrement_idle(channel) })
|
|
52
|
-
metrics_listener.after_closed(Connection::ChannelAttributes.pool_id(channel))
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def in_use_channel_count(address)
|
|
56
|
-
retrieve_in_read_lock(-> () { address_to_in_use_channel_count.get_or_default(address, 0) })
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def idle_channel_count(address)
|
|
60
|
-
retrieve_in_read_lock(-> () { address_to_idle_channel_count.get_or_default(address, 0) })
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def prepare_to_close_channels
|
|
64
|
-
all_channels.each do |channel|
|
|
65
|
-
protocol = Messaging::BoltProtocol.for_channel(channel)
|
|
66
|
-
begin
|
|
67
|
-
protocol.prepare_to_close_channel(channel)
|
|
68
|
-
rescue Exception => e
|
|
69
|
-
# only logging it
|
|
70
|
-
log.debug( "Failed to prepare to close Channel #{channel} due to error #{e.get_message}. It is safe to ignore this error as the channel will be closed despite if it is successfully prepared to close or not.")
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
private
|
|
77
|
-
|
|
78
|
-
def increment_in_use(channel)
|
|
79
|
-
increment(channel, address_to_in_use_channel_count)
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def decrement_in_use(channel)
|
|
83
|
-
address = Connection::ChannelAttributes.server_address(channel)
|
|
84
|
-
|
|
85
|
-
unless address_to_in_use_channel_count.contains_key(address)
|
|
86
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new("No count exists for address '#{address}' in the 'in use' count")
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
count = address_to_in_use_channel_count.get(address)
|
|
90
|
-
address_to_in_use_channel_count.put(address, count - 1)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def increment_idle(channel)
|
|
94
|
-
increment(channel, address_to_idle_channel_count)
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def decrement_idle(channel)
|
|
98
|
-
address = Connection::ChannelAttributes.server_address(channel)
|
|
99
|
-
|
|
100
|
-
unless address_to_idle_channel_count.contains_key(address)
|
|
101
|
-
raise Neo4j::Driver::Exceptions::IllegalStateException.new("No count exists for address '#{address}' in the 'idle' count")
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
count = address_to_idle_channel_count.get(address)
|
|
105
|
-
address_to_idle_channel_count.put(address, count - 1)
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def increment(channel, count_map)
|
|
109
|
-
address = Connection::ChannelAttributes.server_address(channel)
|
|
110
|
-
count = count_map.compute_if_absent(address, -> (k) { 0 })
|
|
111
|
-
count_map.put(address, count + 1)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def do_in_write_lock(work)
|
|
115
|
-
begin
|
|
116
|
-
write.lock
|
|
117
|
-
work.run
|
|
118
|
-
ensure
|
|
119
|
-
write.unlock
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def retrieve_in_read_lock(work)
|
|
124
|
-
begin
|
|
125
|
-
read.lock
|
|
126
|
-
work.get
|
|
127
|
-
ensure
|
|
128
|
-
read.unlock
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
end
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class ConnectionPoolImpl
|
|
6
|
-
def initialize(connector, settings, logger)
|
|
7
|
-
@connector = connector
|
|
8
|
-
@settings = settings
|
|
9
|
-
@log = logger
|
|
10
|
-
@address_to_pool_lock = Concurrent::ReentrantReadWriteLock.new
|
|
11
|
-
@address_to_pool = {}
|
|
12
|
-
@closed = Concurrent::AtomicBoolean.new
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def acquire(address)
|
|
16
|
-
@log.debug("Acquiring a connection from pool towards #{address}")
|
|
17
|
-
|
|
18
|
-
assert_not_closed
|
|
19
|
-
pool = get_or_create_pool(address)
|
|
20
|
-
|
|
21
|
-
begin
|
|
22
|
-
channel = pool.acquire
|
|
23
|
-
@log.debug { "Channel #{channel.object_id} acquired" }
|
|
24
|
-
rescue => error
|
|
25
|
-
process_acquisition_error(pool, address, error)
|
|
26
|
-
end
|
|
27
|
-
assert_not_closed(address, channel, pool)
|
|
28
|
-
NetworkConnection.new(channel, pool, @log) { remove(pool) }
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def retain_all(addresses_to_retain)
|
|
32
|
-
@address_to_pool_lock.with_write_lock do
|
|
33
|
-
@address_to_pool.each do |address, pool|
|
|
34
|
-
unless addresses_to_retain.include?(address)
|
|
35
|
-
unless pool.busy?
|
|
36
|
-
# address is not present in updated routing table and has no active connections
|
|
37
|
-
# it's now safe to terminate corresponding connection pool and forget about it
|
|
38
|
-
@address_to_pool.delete(address)
|
|
39
|
-
if pool
|
|
40
|
-
@log.info("Closing connection pool towards #{address}, it has no active connections and is not in the routing table registry.")
|
|
41
|
-
close_pool_in_background(address, pool)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def remove(pool)
|
|
50
|
-
@address_to_pool_lock.with_write_lock do
|
|
51
|
-
@address_to_pool.each { |address, value| @address_to_pool.delete(address) if value == pool }
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def in_use_connections(address)
|
|
56
|
-
@address_to_pool[address]&.size || 0
|
|
57
|
-
# @netty_channel_tracker.in_use_channel_count(address)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def idle_connections(address)
|
|
61
|
-
@netty_channel_tracker.idle_channel_count(address)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def close
|
|
65
|
-
if @closed.make_true
|
|
66
|
-
@address_to_pool_lock.with_write_lock do
|
|
67
|
-
# We can only shutdown event loop group when all netty pools are fully closed,
|
|
68
|
-
# otherwise the netty pools might missing threads (from event loop group) to execute clean ups.
|
|
69
|
-
close_all_pools
|
|
70
|
-
@address_to_pool.clear
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def open?(address)
|
|
76
|
-
@address_to_pool_lock.with_read_lock { @address_to_pool.key?(address) }
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def to_string
|
|
80
|
-
@address_to_pool_lock.with_read_lock { "ConnectionPoolImpl{ pools=#{@address_to_pool}}" }
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
private
|
|
84
|
-
|
|
85
|
-
def process_acquisition_error(pool, server_address, error)
|
|
86
|
-
if error.is_a?(ConnectionPool::TimeoutError)
|
|
87
|
-
# NettyChannelPool returns future failed with TimeoutException if acquire operation takes more than
|
|
88
|
-
# configured time, translate this exception to a prettier one and re-throw
|
|
89
|
-
raise Neo4j::Driver::Exceptions::ClientException.new("Unable to acquire connection from the pool within configured maximum time of #{@settings.connection_acquisition_timeout.inspect}")
|
|
90
|
-
# elsif pool.closed?
|
|
91
|
-
# There is a race condition where a thread tries to acquire a connection while the pool is closed by another concurrent thread.
|
|
92
|
-
# Treat as failed to obtain connection for a direct driver. For a routing driver, this error should be retried.
|
|
93
|
-
# raise Neo4j::Driver::Exceptions::ServiceUnavailableException, "Connection pool for server #{server_address} is closed while acquiring a connection."
|
|
94
|
-
else
|
|
95
|
-
# some unknown error happened during connection acquisition, propagate it
|
|
96
|
-
raise error
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
def assert_not_closed(address = nil, channel = nil, pool = nil)
|
|
101
|
-
if @closed.true?
|
|
102
|
-
if address
|
|
103
|
-
pool.release(channel)
|
|
104
|
-
close_pool_in_background(address, pool)
|
|
105
|
-
@address_to_pool_lock.with_write_lock { @address_to_pool.delete(address) }
|
|
106
|
-
assert_not_closed
|
|
107
|
-
end
|
|
108
|
-
raise Exceptions::IllegalStateException, Spi::ConnectionPool::CONNECTION_POOL_CLOSED_ERROR_MESSAGE
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
# for testing only
|
|
113
|
-
protected def pool(address)
|
|
114
|
-
@address_to_pool_lock.with_read_lock { @address_to_pool[address] }
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
def new_pool(address)
|
|
118
|
-
ChannelPool.new(limit: @settings.max_connection_pool_size, acquisition_timeout: @settings.connection_acquisition_timeout) { Channel.new(address, @connector, @log) }
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
def get_or_create_pool(address)
|
|
122
|
-
@address_to_pool_lock.with_read_lock { @address_to_pool[address] } ||
|
|
123
|
-
@address_to_pool_lock.with_write_lock do
|
|
124
|
-
new_pool(address)&.tap do |pool|
|
|
125
|
-
# before the connection pool is added I can add the metrics for the pool.
|
|
126
|
-
# @metrics_listener.put_pool_metrics(pool.object_id, address, self)
|
|
127
|
-
@address_to_pool[address] = pool
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
def close_pool(pool)
|
|
133
|
-
pool.close
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
def close_pool_in_background(address, pool)
|
|
137
|
-
Async do
|
|
138
|
-
# Close in the background
|
|
139
|
-
close_pool(pool)
|
|
140
|
-
rescue => error
|
|
141
|
-
@log.warn("An error occurred while closing connection pool towards #{address}.", error)
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
def close_all_pools
|
|
146
|
-
@address_to_pool.map do |address, pool|
|
|
147
|
-
@log.info("Closing connection pool towards #{address}")
|
|
148
|
-
# Wait for all pools to be closed.
|
|
149
|
-
close_pool(pool)
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
end
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class NettyChannelHealthChecker
|
|
6
|
-
attr_reader :pool_settings, :clock, :logger, :log, :min_creation_timestamp_millis_opt
|
|
7
|
-
|
|
8
|
-
def initialize(pool_settings, clock, logger)
|
|
9
|
-
@pool_settings = pool_settings
|
|
10
|
-
@clock = clock
|
|
11
|
-
@log = logger
|
|
12
|
-
@min_creation_timestamp_millis_opt = java.util.concurrent.atomic.AtomicReference.new(java.util.Optional.empty)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def is_healthy(channel)
|
|
16
|
-
return channel.event_loop.new_succeeded_future(false) if is_too_old?(channel)
|
|
17
|
-
|
|
18
|
-
return ping(channel) if has_been_idle_for_too_long?(channel)
|
|
19
|
-
|
|
20
|
-
ACTIVE.is_healthy(channel)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def on_expired(e, channel)
|
|
24
|
-
ts = Connection::ChannelAttributes.creation_timestamp(channel)
|
|
25
|
-
|
|
26
|
-
# Override current value ONLY if the new one is greater
|
|
27
|
-
min_creation_timestamp_millis_opt.get_and_update do |prev|
|
|
28
|
-
java.util.Optional.of(prev.filter(-> (prev_ts) { ts <= prev_ts }.or_else(ts)))
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
private
|
|
33
|
-
|
|
34
|
-
def is_too_old?(channel)
|
|
35
|
-
creation_timestamp_millis = Connection::ChannelAttributes.creation_timestamp(channel)
|
|
36
|
-
min_creation_timestamp_millis_opt = min_creation_timestamp_millis_opt.get
|
|
37
|
-
|
|
38
|
-
if min_creation_timestamp_millis_opt.present? && creation_timestamp_millis <= min_creation_timestamp_millis_opt.get
|
|
39
|
-
log.debug("The channel #{channel} is marked for closure as its creation timestamp is older than or equal to the acceptable minimum timestamp: #{creation_timestamp_millis} <= #{min_creation_timestamp_millis_opt.get}")
|
|
40
|
-
return true
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
if pool_settings.max_connection_lifetime_enabled
|
|
44
|
-
current_timestamp_millis = clock.millis
|
|
45
|
-
|
|
46
|
-
age_millis = current_timestamp_millis - creation_timestamp_millis
|
|
47
|
-
max_age_millis = pool_settings.max_connection_lifetime
|
|
48
|
-
|
|
49
|
-
too_old = age_millis > max_age_millis
|
|
50
|
-
|
|
51
|
-
if too_old
|
|
52
|
-
log.debug("Failed acquire channel #{channel} from the pool because it is too old: #{age_millis} > #{max_age_millis}")
|
|
53
|
-
end
|
|
54
|
-
return too_old
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
false
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def has_been_idle_for_too_long?(channel)
|
|
61
|
-
if pool_settings.idle_time_before_connection_test_enabled?
|
|
62
|
-
last_used_timestamp = Connection::ChannelAttributes.last_used_timestamp(channel)
|
|
63
|
-
if !last_used_timestamp.nil?
|
|
64
|
-
idle_time = clock.millis - last_used_timestamp
|
|
65
|
-
idle_too_long = idle_time > pool_settings.idle_time_before_connection_test
|
|
66
|
-
|
|
67
|
-
if idle_too_long
|
|
68
|
-
log.debug( "Channel #{channel} has been idle for #{idle_time} and needs a ping")
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
return idle_too_long
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
false
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def ping(channel)
|
|
78
|
-
result = channel.event_loop.new_promise
|
|
79
|
-
Connection::ChannelAttributes.message_dispatcher.enqueue(Handlers::PingResponseHandler.new(result, channel, logger))
|
|
80
|
-
channel.write_and_flush(Messaging::Request::ResetMessage::RESET, channel.void_promise)
|
|
81
|
-
result
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class NettyChannelPool
|
|
6
|
-
# Unlimited amount of parties are allowed to request channels from the pool.
|
|
7
|
-
MAX_PENDING_ACQUIRES = nil
|
|
8
|
-
|
|
9
|
-
# Do not check channels when they are returned to the pool.
|
|
10
|
-
RELEASE_HEALTH_CHECK = false
|
|
11
|
-
|
|
12
|
-
attr_reader :id
|
|
13
|
-
|
|
14
|
-
def initialize(address, connector, bootstrap, handler, health_check, acquire_timeout_millis, max_connections)
|
|
15
|
-
java.util.Objects.require_non_null(address)
|
|
16
|
-
java.util.Objects.require_non_null(connector)
|
|
17
|
-
java.util.Objects.require_non_null(handler)
|
|
18
|
-
@id = pool_id(address)
|
|
19
|
-
@delegate = Java::IoNettyChannelPool::FixedChannelPool.new(bootstrap, handler, health_check,
|
|
20
|
-
Java::IoNettyChannelPool::FixedChannelPool::AcquireTimeoutAction::FAIL, acquire_timeout_millis,
|
|
21
|
-
max_connections, MAX_PENDING_ACQUIRES, RELEASE_HEALTH_CHECK)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def close
|
|
25
|
-
if closed.compare_and_set(false, true)
|
|
26
|
-
Util::Futurs.as_completion_stage(delegate.close_async, close_future)
|
|
27
|
-
end
|
|
28
|
-
close_future
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def acquire
|
|
32
|
-
Util::Futurs.as_completion_stage(delegate.acquire)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def release(channel)
|
|
36
|
-
Util::Futurs.as_completion_stage(delegate.release(channel))
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def is_closed?
|
|
40
|
-
closed.get
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
def pool_id(server_address)
|
|
46
|
-
[server_address.host, server_address.port, self.hash_code]
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class NetworkConnectionFactory
|
|
6
|
-
attr_reader :clock, :metrics_listener, :logger
|
|
7
|
-
|
|
8
|
-
def initialize(clock, metrics_listener, logger)
|
|
9
|
-
@clock = clock
|
|
10
|
-
@metrics_listener = metrics_listener
|
|
11
|
-
@logger = logger
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def create_connection(channel, pool)
|
|
15
|
-
NetworkConnection.new(channel, pool, clock, metrics_listener, @logger)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
module Pool
|
|
5
|
-
class PoolSettings
|
|
6
|
-
attr_reader :max_connection_pool_size, :connection_acquisition_timeout, :max_connection_lifetime,
|
|
7
|
-
:idle_time_before_connection_test
|
|
8
|
-
|
|
9
|
-
NOT_CONFIGURED = nil
|
|
10
|
-
DEFAULT_MAX_CONNECTION_POOL_SIZE = 100
|
|
11
|
-
DEFAULT_IDLE_TIME_BEFORE_CONNECTION_TEST = NOT_CONFIGURED
|
|
12
|
-
DEFAULT_MAX_CONNECTION_LIFETIME = 1.hour
|
|
13
|
-
DEFAULT_CONNECTION_ACQUISITION_TIMEOUT = 60.seconds
|
|
14
|
-
|
|
15
|
-
def initialize(max_connection_pool_size, connection_acquisition_timeout, max_connection_lifetime,
|
|
16
|
-
idle_time_before_connection_test)
|
|
17
|
-
@max_connection_pool_size = max_connection_pool_size
|
|
18
|
-
@connection_acquisition_timeout = connection_acquisition_timeout
|
|
19
|
-
@max_connection_lifetime = max_connection_lifetime
|
|
20
|
-
@idle_time_before_connection_test = idle_time_before_connection_test
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def idle_time_before_connection_test_enabled?
|
|
24
|
-
idle_time_before_connection_test&.send(:>=, 0)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def max_connection_lifetime_enabled?
|
|
28
|
-
max_connection_lifetime&.send(:>, 0)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Async
|
|
4
|
-
class ResultCursorsHolder < Array
|
|
5
|
-
def retrieve_not_consumed_error
|
|
6
|
-
retrieve_all_failures.find { |failure| failure }
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
def retrieve_all_failures
|
|
12
|
-
map(&:discard_all_failure_async)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|