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,151 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver
|
|
4
|
-
module Internal
|
|
5
|
-
module Retry
|
|
6
|
-
class ExponentialBackoffRetryLogic
|
|
7
|
-
DEFAULT_MAX_RETRY_TIME = 30.seconds
|
|
8
|
-
INITIAL_RETRY_DELAY = 1.second
|
|
9
|
-
RETRY_DELAY_MULTIPLIER = 2.0
|
|
10
|
-
RETRY_DELAY_JITTER_FACTOR = 0.2
|
|
11
|
-
|
|
12
|
-
def initialize(max_retry_time, event_executor_group, logger = nil)
|
|
13
|
-
@max_retry_time = max_retry_time || DEFAULT_MAX_RETRY_TIME
|
|
14
|
-
@event_executor_group = event_executor_group
|
|
15
|
-
@log = logger
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def retry
|
|
19
|
-
errors = nil
|
|
20
|
-
start_time = nil
|
|
21
|
-
next_delay = INITIAL_RETRY_DELAY
|
|
22
|
-
begin
|
|
23
|
-
yield
|
|
24
|
-
rescue StandardError => error
|
|
25
|
-
if can_retry_on?(error)
|
|
26
|
-
curr_time = Util::Clock::System.time
|
|
27
|
-
start_time ||= curr_time
|
|
28
|
-
elapsed_time = curr_time - start_time
|
|
29
|
-
if elapsed_time < @max_retry_time
|
|
30
|
-
delay_with_jitter = compute_delay_with_jitter(next_delay)
|
|
31
|
-
@log&.warn { "Transaction failed and will be retried in #{delay_with_jitter}ms\n#{error}" }
|
|
32
|
-
sleep(delay_with_jitter)
|
|
33
|
-
next_delay *= RETRY_DELAY_MULTIPLIER
|
|
34
|
-
errors = record_error(error, errors)
|
|
35
|
-
retry
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
add_suppressed(error, errors)
|
|
39
|
-
raise error
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def retry_async(&work)
|
|
44
|
-
result_future = Concurrent::Promises.resolvable_future
|
|
45
|
-
execute_work_in_event_loop(result_future, &work)
|
|
46
|
-
result_future
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
protected
|
|
50
|
-
|
|
51
|
-
def can_retry_on?(error)
|
|
52
|
-
error.is_a?(Exceptions::SessionExpiredException) ||
|
|
53
|
-
error.is_a?(Exceptions::ServiceUnavailableException) ||
|
|
54
|
-
transient_error?(error)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
|
|
59
|
-
def extract_possible_termination_cause(error)
|
|
60
|
-
# Having a dedicated "TerminatedException" inheriting from ClientException might be a good idea.
|
|
61
|
-
error.is_a? Exceptions::ClientException && error.cause || error
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def execute_work_in_event_loop(result_future, &work)
|
|
65
|
-
# this is the very first time we execute given work
|
|
66
|
-
event_executor = @event_executor_group.next
|
|
67
|
-
|
|
68
|
-
event_executor.execute do
|
|
69
|
-
execute_work(result_future, -1, INITIAL_RETRY_DELAY, nil, &work)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def retry_work_in_event_loop(result_future, error, start_time, delay, errors, &work)
|
|
74
|
-
# work has failed before, we need to schedule retry with the given delay
|
|
75
|
-
event_executor = event_executor_group.next
|
|
76
|
-
|
|
77
|
-
delay_with_jitter = compute_delay_with_jitter(delay)
|
|
78
|
-
@log.warn("Async transaction failed and is scheduled to retry in " + delay_with_jitter + "s", error);
|
|
79
|
-
|
|
80
|
-
event_executor.schedule(->() { execute_work(result_future, start_time, delay * multiplier, errors, &work) },
|
|
81
|
-
DurationNormalizer.milliseconds(delay_with_jitter),
|
|
82
|
-
java.util.concurrent.TimeUnit::MILLISECONDS)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def execute_work(result_future, start_time, retry_delay, errors, &work)
|
|
86
|
-
begin
|
|
87
|
-
work_stage = work.call
|
|
88
|
-
rescue StandardError => error
|
|
89
|
-
# work failed in a sync way, attempt to schedule a retry
|
|
90
|
-
retry_on_error(result_future, start_time, retry_delay, error, errors, &work)
|
|
91
|
-
return
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
work_stage.on_resolution do |fulfilled, result, completion_error|
|
|
95
|
-
error = Futures.completion_exception_cause(completion_error)
|
|
96
|
-
if error
|
|
97
|
-
# work failed in async way, attempt to schedule a retry
|
|
98
|
-
retry_on_error(result_future, work, start_time, retry_delay, error, errors)
|
|
99
|
-
else
|
|
100
|
-
result_future.fulfill(result)
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def retry_on_error(result_future, start_time, retry_delay, throwable, errors, &work)
|
|
106
|
-
error = extract_possible_termination_cause(throwable)
|
|
107
|
-
if can_retry_on?(error)
|
|
108
|
-
current_time = Util::Clock::System.time
|
|
109
|
-
start_time ||= current_time
|
|
110
|
-
|
|
111
|
-
elapsed_time = current_time - start_time
|
|
112
|
-
if elapsed_time < @max_retry_time
|
|
113
|
-
errors = record_error(error, errors)
|
|
114
|
-
retry_work_in_event_loop(result_future, error, start_time, retry_delay, errors, &work)
|
|
115
|
-
return
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
add_suppressed(throwable, errors)
|
|
120
|
-
result_future.reject(throwable)
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def compute_delay_with_jitter(delay)
|
|
124
|
-
jitter = delay * RETRY_DELAY_JITTER_FACTOR
|
|
125
|
-
min = delay - jitter
|
|
126
|
-
max = delay + jitter
|
|
127
|
-
@rand ||= Random.new
|
|
128
|
-
@rand.rand(min..max)
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
def transient_error?(error)
|
|
132
|
-
# Retries should not happen when transaction was explicitly terminated by the user.
|
|
133
|
-
# Termination of transaction might result in two different error codes depending on where it was
|
|
134
|
-
# terminated. These are really client errors but classification on the server is not entirely correct and
|
|
135
|
-
# they are classified as transient.
|
|
136
|
-
error.is_a?(Exceptions::TransientException) &&
|
|
137
|
-
!%w[Neo.TransientError.Transaction.Terminated Neo.TransientError.Transaction.LockClientStopped]
|
|
138
|
-
.include?(error.code)
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
def record_error(error, errors)
|
|
142
|
-
(errors || []) << error
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
def add_suppressed(error, suppressed_errors)
|
|
146
|
-
suppressed_errors&.reject(&error.method(:equal?))&.each(&error.method(:add_suppressed)) if error.is_a? Exceptions::Neo4jException
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal
|
|
4
|
-
module RevocationStrategy
|
|
5
|
-
# Don't do any OCSP revocation checks, regardless whether there are stapled revocation statuses or not.
|
|
6
|
-
NO_CHECKS = :no_checks
|
|
7
|
-
|
|
8
|
-
# Verify OCSP revocation checks when the revocation status is stapled to the certificate, continue if not.
|
|
9
|
-
VERIFY_IF_PRESENT = :verify_if_present
|
|
10
|
-
|
|
11
|
-
# Require stapled revocation status and verify OCSP revocation checks,
|
|
12
|
-
# fail if no revocation status is stapled to the certificate.
|
|
13
|
-
STRICT = :strict
|
|
14
|
-
|
|
15
|
-
def self.requires_revocation_checking?(revocation_strategy)
|
|
16
|
-
revocation_strategy == STRICT || revocation_strategy == VERIFY_IF_PRESENT
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver::Internal::Scheme
|
|
2
|
-
BOLT_URI_SCHEME = 'bolt'
|
|
3
|
-
BOLT_HIGH_TRUST_URI_SCHEME = 'bolt+s'
|
|
4
|
-
BOLT_LOW_TRUST_URI_SCHEME = 'bolt+ssc'
|
|
5
|
-
NEO4J_URI_SCHEME = 'neo4j'
|
|
6
|
-
NEO4J_HIGH_TRUST_URI_SCHEME = 'neo4j+s'
|
|
7
|
-
NEO4J_LOW_TRUST_URI_SCHEME = 'neo4j+ssc'
|
|
8
|
-
|
|
9
|
-
def validate_scheme!(scheme)
|
|
10
|
-
unless [BOLT_URI_SCHEME, BOLT_LOW_TRUST_URI_SCHEME, BOLT_HIGH_TRUST_URI_SCHEME, NEO4J_URI_SCHEME,
|
|
11
|
-
NEO4J_LOW_TRUST_URI_SCHEME, NEO4J_HIGH_TRUST_URI_SCHEME].include?(scheme)
|
|
12
|
-
raise ArgumentError, scheme ? "Invalid address format #{scheme}" : 'Scheme must not be null'
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def high_trust_scheme?(scheme)
|
|
17
|
-
[BOLT_HIGH_TRUST_URI_SCHEME, NEO4J_HIGH_TRUST_URI_SCHEME].include?(scheme)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def low_trust_scheme?(scheme)
|
|
21
|
-
[BOLT_LOW_TRUST_URI_SCHEME, NEO4J_LOW_TRUST_URI_SCHEME].include?(scheme)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def security_scheme?(scheme)
|
|
25
|
-
[BOLT_LOW_TRUST_URI_SCHEME, NEO4J_LOW_TRUST_URI_SCHEME, BOLT_HIGH_TRUST_URI_SCHEME, NEO4J_HIGH_TRUST_URI_SCHEME]
|
|
26
|
-
.include?(scheme)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def routing_scheme?(scheme)
|
|
30
|
-
[NEO4J_LOW_TRUST_URI_SCHEME, NEO4J_HIGH_TRUST_URI_SCHEME, NEO4J_URI_SCHEME].include?(scheme)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Security
|
|
4
|
-
# A simple common token for authentication schemes that easily convert to
|
|
5
|
-
# an auth token map
|
|
6
|
-
class InternalAuthToken < Hash
|
|
7
|
-
SCHEME_KEY = :scheme
|
|
8
|
-
PRINCIPAL_KEY = :principal
|
|
9
|
-
CREDENTIALS_KEY = :credentials
|
|
10
|
-
REALM_KEY = :realm
|
|
11
|
-
PARAMETERS_KEY = :parameters
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver::Internal
|
|
2
|
-
module Security
|
|
3
|
-
class SecurityPlanImpl < Struct.new(:requires_encryption?, :ssl_context, :requires_hostname_verification?,
|
|
4
|
-
:revocation_strategy)
|
|
5
|
-
class << self
|
|
6
|
-
def for_all_certificates(requires_hostname_verification, revocation_strategy)
|
|
7
|
-
new(true, all_context(requires_hostname_verification), requires_hostname_verification, revocation_strategy)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def for_custom_ca_signed_certificates(cert_files, requires_hostname_verification, revocation_strategy)
|
|
11
|
-
new(true, custom_ca_signed_context(cert_files, requires_hostname_verification),
|
|
12
|
-
requires_hostname_verification, revocation_strategy)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def for_system_ca_signed_certificates(requires_hostname_verification, revocation_strategy)
|
|
16
|
-
new(true, ca_signed_context(requires_hostname_verification), requires_hostname_verification,
|
|
17
|
-
revocation_strategy)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def insecure
|
|
21
|
-
new(false, nil, false, RevocationStrategy::NO_CHECKS)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
|
|
26
|
-
def all_context(requires_hostname_verification)
|
|
27
|
-
ssl_context(verify_mode: OpenSSL::SSL::VERIFY_NONE, verify_hostname: requires_hostname_verification)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def ca_signed_context(requires_hostname_verification)
|
|
31
|
-
ssl_context(verify_hostname: requires_hostname_verification)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def custom_ca_signed_context(cert_files, requires_hostname_verification)
|
|
35
|
-
ssl_context(
|
|
36
|
-
cert_store: OpenSSL::X509::Store.new.tap do |store|
|
|
37
|
-
cert_files.each(&store.method(:add_file))
|
|
38
|
-
end,
|
|
39
|
-
verify_hostname: requires_hostname_verification)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def ssl_context(**params)
|
|
43
|
-
OpenSSL::SSL::SSLContext.new.tap { |context| context.set_params(params) }
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver
|
|
4
|
-
module Internal
|
|
5
|
-
class SecuritySetting
|
|
6
|
-
include Scheme
|
|
7
|
-
|
|
8
|
-
attr_reader :encrypted, :trust_strategy, :customized
|
|
9
|
-
|
|
10
|
-
def initialize(encrypted, trust_strategy, customized)
|
|
11
|
-
@encrypted = encrypted
|
|
12
|
-
@trust_strategy = trust_strategy
|
|
13
|
-
@customized = customized
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def create_security_plan(uri_scheme)
|
|
17
|
-
validate_scheme!(uri_scheme)
|
|
18
|
-
if security_scheme?(uri_scheme)
|
|
19
|
-
assert_security_settings_not_user_configured(uri_scheme)
|
|
20
|
-
create_security_plan_from_scheme(uri_scheme)
|
|
21
|
-
else
|
|
22
|
-
create_security_plan_impl(encrypted, trust_strategy)
|
|
23
|
-
end
|
|
24
|
-
rescue IOError
|
|
25
|
-
raise Neo4j::Driver::Exceptions::ClientException, 'Unable to establish SSL parameters'
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def create_security_plan_from_scheme(uri_scheme)
|
|
29
|
-
if high_trust_scheme?(uri_scheme)
|
|
30
|
-
Security::SecurityPlanImpl.for_system_ca_signed_certificates(true, RevocationStrategy::NO_CHECKS)
|
|
31
|
-
else
|
|
32
|
-
Security::SecurityPlanImpl.for_all_certificates(false, RevocationStrategy::NO_CHECKS)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
def assert_security_settings_not_user_configured(uri_scheme)
|
|
39
|
-
if customized
|
|
40
|
-
raise Neo4j::Driver::Exceptions::ClientException,
|
|
41
|
-
"Scheme #{uri_scheme} is not configurable with manual encryption and trust settings"
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def create_security_plan_impl(encrypted, trust_strategy)
|
|
46
|
-
return Security::SecurityPlanImpl.insecure unless encrypted
|
|
47
|
-
|
|
48
|
-
hostname_verification_enabled = trust_strategy.hostname_verification_enabled?
|
|
49
|
-
revocation_strategy = trust_strategy.revocation_strategy
|
|
50
|
-
|
|
51
|
-
case trust_strategy.strategy
|
|
52
|
-
when Config::TrustStrategy::TRUST_CUSTOM_CA_SIGNED_CERTIFICATES
|
|
53
|
-
Security::SecurityPlanImpl.for_custom_ca_signed_certificates(
|
|
54
|
-
trust_strategy.cert_files, hostname_verification_enabled, revocation_strategy)
|
|
55
|
-
when Config::TrustStrategy::TRUST_SYSTEM_CA_SIGNED_CERTIFICATES
|
|
56
|
-
Security::SecurityPlanImpl
|
|
57
|
-
.for_system_ca_signed_certificates(hostname_verification_enabled, revocation_strategy)
|
|
58
|
-
when Config::TrustStrategy::TRUST_ALL_CERTIFICATES
|
|
59
|
-
Security::SecurityPlanImpl.for_all_certificates(hostname_verification_enabled, revocation_strategy)
|
|
60
|
-
else
|
|
61
|
-
raise ClientException, "Unknown TLS authentication strategy: #{trust_strategy.strategy}"
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
class SessionFactoryImpl
|
|
4
|
-
attr_reader :connection_provider
|
|
5
|
-
delegate :verify_connectivity, :close, :supports_multi_db?, to: :connection_provider
|
|
6
|
-
|
|
7
|
-
def initialize(connection_provider, retry_logic, config)
|
|
8
|
-
@connection_provider = connection_provider
|
|
9
|
-
@leaked_sessions_logging_enabled = config[:leaked_session_logging]
|
|
10
|
-
@retry_logic = retry_logic
|
|
11
|
-
@logger = config[:logger]
|
|
12
|
-
@default_fetch_size = config[:fetch_size]
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def new_instance(fetch_size: @default_fetch_size, default_access_mode: AccessMode::WRITE, **config)
|
|
16
|
-
bookmark_holder = DefaultBookmarkHolder.new(InternalBookmark.from(*config[:bookmarks]))
|
|
17
|
-
create_session(parse_database_name(config), default_access_mode, bookmark_holder, fetch_size, config[:impersonated_user])
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
def parse_database_name(config)
|
|
23
|
-
config[:database]&.then(&DatabaseNameUtil.method(:database)) || DatabaseNameUtil.default_database
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def create_session(database_name, mode, bookmark_holder, fetch_size, impersonated_user)
|
|
27
|
-
(@leaked_sessions_logging_enabled ? org.neo4j.driver.internal.async.LeakLoggingNetworkSession : Async::NetworkSession)
|
|
28
|
-
.new(@connection_provider, @retry_logic, database_name, mode, bookmark_holder, impersonated_user, fetch_size, @logger)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Spi
|
|
4
|
-
module Connection
|
|
5
|
-
def mode
|
|
6
|
-
raise java.lang.UnsupportedOperationException, "#{self.class} does not support access mode."
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def database_name
|
|
10
|
-
raise java.lang.UnsupportedOperationException, "#{self.class} does not support database name."
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def impersonated_user
|
|
14
|
-
raise java.lang.UnsupportedOperationException, "#{self.class} does not support impersonated user."
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module Neo4j::Driver
|
|
2
|
-
module Internal
|
|
3
|
-
module Spi
|
|
4
|
-
module ResponseHandler
|
|
5
|
-
# Tells whether this response handler is able to manage auto-read of the underlying connection using {@link Connection#enableAutoRead()} and
|
|
6
|
-
# {@link Connection#disableAutoRead()}.
|
|
7
|
-
# <p>
|
|
8
|
-
# Implementations can use auto-read management to apply network-level backpressure when receiving a stream of records.
|
|
9
|
-
# There should only be a single such handler active for a connection at one point in time. Otherwise, handlers can interfere and turn on/off auto-read
|
|
10
|
-
# racing with each other. {@link InboundMessageDispatcher} is responsible for tracking these handlers and disabling auto-read management to maintain just
|
|
11
|
-
# a single auto-read managing handler per connection.
|
|
12
|
-
def can_manage_auto_read?
|
|
13
|
-
false
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# If this response handler is able to manage auto-read of the underlying connection, then this method signals it to
|
|
17
|
-
# stop changing auto-read setting for the connection.
|
|
18
|
-
def disable_auto_read_management
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
# Creating a position from and offset, line number and a column number.
|
|
5
|
-
#
|
|
6
|
-
# @param offset the offset from the start of the string, starting from 0.
|
|
7
|
-
# @param line the line number, starting from 1.
|
|
8
|
-
# @param column the column number, starting from 1.
|
|
9
|
-
class InternalInputPosition < Struct.new(:offset, :line, :column)
|
|
10
|
-
end
|
|
11
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
class InternalNotification < Struct.new(:code, :title, :description, :severity, :position)
|
|
5
|
-
|
|
6
|
-
VALUE_TO_NOTIFICATION = lambda do |value|
|
|
7
|
-
severity = value[:severity] || 'N/A'
|
|
8
|
-
|
|
9
|
-
position = value[:position]&.then do |pos_value|
|
|
10
|
-
InternalInputPosition.new(*pos_value.values_at(:offset, :line, :column).map(&:to_i))
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
InternalNotification.new(*value.values_at(:code, :title, :description), severity, position)
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
# Only call #initialize when sub-classing, for constructing plans, use .plan instead
|
|
5
|
-
class InternalPlan < Struct.new(:operator_type, :arguments, :identifiers, :children)
|
|
6
|
-
# Since a plan with or without profiling looks almost the same, we just keep two impls. of this
|
|
7
|
-
# around to contain the small difference, and share the rest of the code for building plan trees.
|
|
8
|
-
# @param <T>
|
|
9
|
-
|
|
10
|
-
class Converter
|
|
11
|
-
def initialize(&plan_creator)
|
|
12
|
-
@plan_creator = plan_creator
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def apply(plan)
|
|
16
|
-
operator_type = plan[:operatorType]
|
|
17
|
-
|
|
18
|
-
arguments_value = plan[:args]
|
|
19
|
-
arguments = arguments_value || {}
|
|
20
|
-
|
|
21
|
-
identifiers_value = plan[:identifiers]
|
|
22
|
-
identifiers = identifiers_value || []
|
|
23
|
-
|
|
24
|
-
children_value = plan[:children]
|
|
25
|
-
children = children_value || []
|
|
26
|
-
|
|
27
|
-
@plan_creator.call(operator_type, arguments, identifiers, children, plan)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
EXPLAIN_PLAN = lambda { |operator_type, arguments, identifiers, children, _original_plan_value|
|
|
32
|
-
new(operator_type, arguments, identifiers, children) }
|
|
33
|
-
|
|
34
|
-
# Builds a regular plan without profiling information - eg. a plan that came as a result of an `EXPLAIN` query
|
|
35
|
-
EXPLAIN_PLAN_FROM_VALUE = Converter.new(&EXPLAIN_PLAN).method(:apply)
|
|
36
|
-
|
|
37
|
-
def self.plan(operator_type, arguments, identifiers, children)
|
|
38
|
-
EXPLAIN_PLAN.call(operator_type, arguments, identifiers, children, nil)
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
class InternalProfiledPlan < InternalPlan
|
|
5
|
-
attr_reader :db_hits, :records, :page_cache_hits, :page_cache_misses, :page_cache_hit_ratio, :time
|
|
6
|
-
|
|
7
|
-
PROFILED_PLAN = lambda { |operator_type, arguments, identifiers, children, original_plan_value|
|
|
8
|
-
new(
|
|
9
|
-
operator_type, arguments, identifiers, children, original_plan_value[:db_hits].to_i,
|
|
10
|
-
original_plan_value[:rows].to_i, original_plan_value[:page_cache_hits].to_i,
|
|
11
|
-
original_plan_value[:page_cache_misses].to_i, original_plan_value[:page_cache_hit_ratio].to_f,
|
|
12
|
-
original_plan_value[:time].to_i
|
|
13
|
-
) }
|
|
14
|
-
|
|
15
|
-
# Builds a regular plan without profiling information - eg. a plan that came as a result of an `EXPLAIN` query
|
|
16
|
-
PROFILED_PLAN_FROM_VALUE = Converter.new(&PROFILED_PLAN).method(:apply)
|
|
17
|
-
|
|
18
|
-
def initialize(operator_type, arguments, identifiers, children, db_hits, records, page_cache_hits, page_cache_misses, page_cache_hit_ratio, time)
|
|
19
|
-
super(operator_type, arguments, identifiers, children)
|
|
20
|
-
@db_hits = db_hits
|
|
21
|
-
@records = records
|
|
22
|
-
@page_cache_hits = page_cache_hits
|
|
23
|
-
@page_cache_misses = page_cache_misses
|
|
24
|
-
@page_cache_hit_ratio = page_cache_hit_ratio
|
|
25
|
-
@time = time
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def page_cache_stats?
|
|
29
|
-
page_cache_hits.positive? || page_cache_misses.positive? || page_cache_hit_ratio.positive?
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
class InternalResultSummary < Struct.new(:query, :server, :database, :query_type, :counters, :plan, :profile,
|
|
5
|
-
:notifications, :result_available_after, :result_consumed_after)
|
|
6
|
-
alias has_plan? plan
|
|
7
|
-
alias has_profile? profile
|
|
8
|
-
|
|
9
|
-
def initialize(*args)
|
|
10
|
-
super
|
|
11
|
-
self.plan = resolve_plan(plan, profile)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def counters
|
|
15
|
-
super || InternalSummaryCounters::EMPTY_STATS
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def notifications
|
|
19
|
-
super || []
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
# Profiled plan is a superset of plan. This method returns profiled plan if plan is {@code null}.
|
|
25
|
-
#
|
|
26
|
-
# @param plan the given plan, possibly {@code null}.
|
|
27
|
-
# @param profiled_plan the given profiled plan, possibly {@code null}.
|
|
28
|
-
# @return available plan.
|
|
29
|
-
def resolve_plan(plan, profiled_plan)
|
|
30
|
-
plan || profiled_plan
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Neo4j::Driver::Internal::Summary
|
|
4
|
-
class InternalSummaryCounters < Struct.new(:nodes_created, :nodes_deleted, :relationships_created,
|
|
5
|
-
:relationships_deleted, :properties_set, :labels_added, :labels_removed,
|
|
6
|
-
:indexes_added, :indexes_removed, :constraints_added, :constraints_removed,
|
|
7
|
-
:system_updates)
|
|
8
|
-
EMPTY_STATS = InternalSummaryCounters.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
9
|
-
|
|
10
|
-
def contains_updates?
|
|
11
|
-
any?(&:positive?)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def contains_system_updates?
|
|
15
|
-
system_updates.positive?
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|